FOTOWARE ... FOTOSTATION

Started by Archive, May 12, 2010, 08:53:57 AM

Previous topic - Next topic

Archive

[Originally posted by themonk on 2006-10-27 17:35:50-07]

Hello

Fotoware's FotoStation embeds a block of data at the end of a JPEG image containing details of any
applied softcrop..

I was wondering if anybody has used exiftool to extract this information....

I would have a go at adding this myself if I knew the spec..

Any thoughts ?

Archive

[Originally posted by exiftool on 2006-10-27 19:20:57-07]

I didn't even know that FotoStation did this until now.  Usually I have to
rely on reverse engineering to determine the format of information like this.

I just downloaded a trial version of Fotostation, and it looks like the crop information
is in the last 46 bytes of the trailer (this 46-byte block begins and ends with the byte
sequence a1 b2 c3 d4).

Just doing a bit of quick testing, here is what I found:

Code:
offset 00: start signature (a1 b2 c3 d4)
offset 04:  image width
offset 08: image height
offset 0c: ? (00 00 00 03)
offset 10: ? (but changes with crop area)
offset 14: counterclockwise rotation angle * 100 deg
offset 18: ? (11 22 22 11)
offset 1c: top crop coordinate in inches
offset 20: left crop coordinate in inches
offset 24: right crop coordinate in inches
offset 28: bottom crop coordinate in inches
offset 2c: ? (00 00 00 00)
offset 30: ? (00 00 00 00)
offset 34: ? (00 02)
offset 36: ? (00 00)
offset 38: ? (00 3a)
offset 3a: end signature (a1 b2 c3 d4)

- Phil

Archive

[Originally posted by exiftool on 2006-10-27 19:33:14-07]

Ah.  At offset 0x38, the 0x3a is the block length.  So what I called the "start signature"
is in fact the end signature of the previous block.  And I counted wrong, it isn't 46 bytes long,
but 58 bytes (=0x3a) not including the end signature of the previous block.

Right. So this is how you scan backwards through the Fotostation blocks.

- Phil

Archive

[Originally posted by exiftool on 2006-10-28 15:10:21-07]

I've been playing around with this a bit more, and have
added some preliminary code to provide read/write support
for the PhotoStation trailer.  It still needs some testing,
but I have uploaded a
6.51 pre-release
with these changes for you to play with if you want.

I have decoded a bit more information since my last post,
but I was wrong about the crop position being in inches (I
haven't figured out what units these coordinates are in yet).
You can use the -U option to see unknown tags in the crop
information, and the -v3 option to dump the FotoStation
trailer records in hex.

I'll let you know if I discover anything else.

- Phil

Archive

[Originally posted by themonk on 2006-10-30 10:59:52-08]

Hi Phil ....

I've got hold of the spec.....

Each tag has a 10-byte footer, including the 4-byte signature (A1 B2 C3 D4). When you find the signature, the 4
bytes before it give the length of the tag (including footer); the 2 bytes before that are the
tag type.

Tag types are IPTC (type 1), image info (type 2), thumbnail jpg (3) and preview jpg (4)

The image info, which includes crop, is as follows:

(Motorola byte order is used)

 

PPL    4 bytes,   Pixel Per Line
     
NOL    4 bytes,   Number Of Lines     
 
SEPS    4 bytes,   Separations 1,3 or 4   
   
RES    4 bytes,    1000 * pix/inch     

ROTATE    4 bytes,    angle (0-360) * 100   
   
SOFTCROP VALID    4 bytes,    0x11 0x22 0x22 0x11
     
XSTART    4 bytes,    % of PPL * 1000     

YSTART    4 bytes,    % of NOL * 1000     

XEND    4 bytes,    % of PPL * 1000     

YEND    4 bytes,    % of NOL * 1000   

Hope this helps.... I will download your BETA later and have a play ....

Thanks

Archive

[Originally posted by themonk on 2006-10-30 11:14:52-08]

Hi Phil ....

I've got hold of the spec.....

Each tag has a 10-byte footer, including the 4-byte signature (A1 B2 C3 D4). When you find the signature, the 4
bytes before it give the length of the tag (including footer); the 2 bytes before that are the
tag type.

Tag types are IPTC (type 1), image info (type 2), thumbnail jpg (3) and preview jpg (4)

The image info, which includes crop, is as follows:

(Motorola byte order is used)

 

PPL    4 bytes,   Pixel Per Line
     
NOL    4 bytes,   Number Of Lines     
 
SEPS    4 bytes,   Separations 1,3 or 4   
   
RES    4 bytes,    1000 * pix/inch     

ROTATE    4 bytes,    angle (0-360) * 100   
   
SOFTCROP VALID    4 bytes,    0x11 0x22 0x22 0x11
     
XSTART    4 bytes,    % of PPL * 1000     

YSTART    4 bytes,    % of NOL * 1000     

XEND    4 bytes,    % of PPL * 1000     

YEND    4 bytes,    % of NOL * 1000   

Hope this helps.... I will download your BETA later and have a play ....

Thanks

Archive

[Originally posted by exiftool on 2006-10-30 13:24:41-08]

Thanks for this!  I didn't know about the thumbnail or preview, and I
hadn't figured out what the "Separations" value meant -- Do you think
they mean "Color Planes" by "Separations" ?

But there are 2 more values after YEND that you don't mention.  I have
decoded the second as CropRotation, but still don't know the meaning of
the first (I have only seen a zero here).

And do you have a reference for this specification?  I would like to add
this to the documentation if possible.

I have added the ThumbnailImage, PreviewImage and ColorPlanes tags,
and uploaded a new 6.51 pre-release for you.

- Phil

Archive

[Originally posted by themonk on 2006-10-30 14:11:03-08]

Hi Phil ....

I've got hold of the spec.....

Each tag has a 10-byte footer, including the 4-byte signature (A1 B2 C3 D4). When you find the signature, the 4
bytes before it give the length of the tag (including footer); the 2 bytes before that are the
tag type.

Tag types are IPTC (type 1), image info (type 2), thumbnail jpg (3) and preview jpg (4)

The image info, which includes crop, is as follows:

(Motorola byte order is used)

 

PPL    4 bytes,   Pixel Per Line
     
NOL    4 bytes,   Number Of Lines     
 
SEPS    4 bytes,   Separations 1,3 or 4   
   
RES    4 bytes,    1000 * pix/inch     

ROTATE    4 bytes,    angle (0-360) * 100   
   
SOFTCROP VALID    4 bytes,    0x11 0x22 0x22 0x11
     
XSTART    4 bytes,    % of PPL * 1000     

YSTART    4 bytes,    % of NOL * 1000     

XEND    4 bytes,    % of PPL * 1000     

YEND    4 bytes,    % of NOL * 1000   

Hope this helps.... I will download your BETA later and have a play ....

Thanks

Archive

[Originally posted by themonk on 2006-10-30 15:17:10-08]

Hello ...

Sorry about the multiple posts of my last response... (my fault)...

Yes colour planes.... 1 for grayscale, 3 for RGB and 4 for CMYK

I'll email you the full spec but I'm not sure whether it tell you anything new....

I've done some basic testing and what you've done so far is already extremely useful....

I spoke with a colleague who was parsing the tags using some VBscript and he

said that he often saw some extra bytes at the end of the tag which he could never explain.

They were not always there....

Mark

Archive

[Originally posted by themonk on 2006-10-30 15:18:34-08]

Hello ...

Sorry about the multiple posts of my last response... (my fault)...

Yes colour planes.... 1 for grayscale, 3 for RGB and 4 for CMYK

I'll email you the full spec but I'm not sure whether it tell you anything new....

I've done some basic testing and what you've done so far is already extremely useful....

I spoke with a colleague who was parsing the tags using some VBscript and he

said that he often saw some extra bytes at the end of the tag which he could never explain.

They were not always there....

Mark