I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2006-10-27 17:35:50-07 by themonk
FOTOWARE ... FOTOSTATION
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 ?
Direct Responses: 3352 | Write a response
Posted on 2006-10-27 19:20:57-07 by exiftool in response to 3351
Re: FOTOWARE ... FOTOSTATION
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:

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
Direct Responses: 3353 | Write a response
Posted on 2006-10-27 19:33:14-07 by exiftool in response to 3352
Re: FOTOWARE ... FOTOSTATION
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
Direct Responses: 3356 | Write a response
Posted on 2006-10-28 15:10:21-07 by exiftool in response to 3353
Re: FOTOWARE ... FOTOSTATION
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
Direct Responses: 3367 | 3368 | 3374 | Write a response
Posted on 2006-10-30 10:59:52-08 by themonk in response to 3356
Re: FOTOWARE ... FOTOSTATION
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

Direct Responses: 3372 | Write a response
Posted on 2006-10-30 11:14:52-08 by themonk in response to 3356
Re: FOTOWARE ... FOTOSTATION
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

Direct Responses: Write a response
Posted on 2006-10-30 13:24:41-08 by exiftool in response to 3367
Re: FOTOWARE ... FOTOSTATION
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
Direct Responses: 3375 | 3376 | Write a response
Posted on 2006-10-30 14:11:03-08 by themonk in response to 3356
Re: FOTOWARE ... FOTOSTATION
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

Direct Responses: Write a response
Posted on 2006-10-30 15:17:10-08 by themonk in response to 3372
Re: FOTOWARE ... FOTOSTATION
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
Direct Responses: Write a response
Posted on 2006-10-30 15:18:34-08 by themonk in response to 3372
Re: FOTOWARE ... FOTOSTATION
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
Direct Responses: Write a response