Photo Mechanic > Support

Perl Image::ExifTool finds error in IPTC Tag from PhotoMechanic

(1/2) > >>

gregkeene:
In addition to using Photo Mechanic as part of my work flow, I have some custom software written in Perl which loads IPTC tags and writes out a some additional tags. The module I'm using is by Phil Harvey called Image::ExifTool (http://www.sno.phy.queensu.ca/~phil/exiftool/).

What I found is that when I try to write the file, I get this error:
Error: [minor] 2064 unreferenced bytes at end of file not copied

I contacted Phil and he looked at the file and stated that '... the software is adding a non-standard trailer containing what looks to be an empty IPTC structure'. 

If I use my same custom software on native 30D .CR2 images, I don't get the error. It's only after Photo Mechanic edits the IPTC tags. I'd be interested in your thoughts and happy to help pursue the issue.

I'm using 4.4.3 on Mac OS X (10.4.6 - Intel).

Thanks,

Greg

Kirk Baker:

--- Quote from: gregkeene on May 25, 2006, 12:04:48 PM ---In addition to using Photo Mechanic as part of my work flow, I have some custom software written in Perl which loads IPTC tags and writes out a some additional tags. The module I'm using is by Phil Harvey called Image::ExifTool (http://www.sno.phy.queensu.ca/~phil/exiftool/).

What I found is that when I try to write the file, I get this error:
Error: [minor] 2064 unreferenced bytes at end of file not copied

I contacted Phil and he looked at the file and stated that '... the software is adding a non-standard trailer containing what looks to be an empty IPTC structure'. 

If I use my same custom software on native 30D .CR2 images, I don't get the error. It's only after Photo Mechanic edits the IPTC tags. I'd be interested in your thoughts and happy to help pursue the issue.

I'm using 4.4.3 on Mac OS X (10.4.6 - Intel).
--- End quote ---

While the data you are referring to is formatted like IPTC data, it is Photo Mechanic's image preferences that are contained in that data.  The last 12 bytes of the file are a backward link to the image preferences that are a fixed size 2048 byte block. (2048 + 12 accounts for your 2064 bytes as called out in the warning.)

You can choose to not preserve that data, but if you do decide to discard it, then you will lose the Color Class, Tag, Rotation, Crop, and in some cases the frame number.  But no IPTC caption data will be lost.

What data are you adding to the CR2 files?  Be very careful.  We only decided to implement IPTC/XMP captioning in CR2 files (and other RAW files) when we were able to come up with a way to completely revert any changes that we had added.  Only then did we feel safe in making the feature available in Photo Mechanic.

HTH,

-Kirk

gregkeene:

--- Quote from: Kirk Baker on May 25, 2006, 12:37:32 PM ---
--- Quote from: gregkeene on May 25, 2006, 12:04:48 PM ---In addition to using Photo Mechanic as part of my work flow, I have some custom software written in Perl which loads IPTC tags and writes out a some additional tags. The module I'm using is by Phil Harvey called Image::ExifTool (http://www.sno.phy.queensu.ca/~phil/exiftool/).

What I found is that when I try to write the file, I get this error:
Error: [minor] 2064 unreferenced bytes at end of file not copied

I contacted Phil and he looked at the file and stated that '... the software is adding a non-standard trailer containing what looks to be an empty IPTC structure'. 

If I use my same custom software on native 30D .CR2 images, I don't get the error. It's only after Photo Mechanic edits the IPTC tags. I'd be interested in your thoughts and happy to help pursue the issue.

I'm using 4.4.3 on Mac OS X (10.4.6 - Intel).
--- End quote ---

While the data you are referring to is formatted like IPTC data, it is Photo Mechanic's image preferences that are contained in that data.  The last 12 bytes of the file are a backward link to the image preferences that are a fixed size 2048 byte block. (2048 + 12 accounts for your 2064 bytes as called out in the warning.)

You can choose to not preserve that data, but if you do decide to discard it, then you will lose the Color Class, Tag, Rotation, Crop, and in some cases the frame number.  But no IPTC caption data will be lost.

What data are you adding to the CR2 files?  Be very careful.  We only decided to implement IPTC/XMP captioning in CR2 files (and other RAW files) when we were able to come up with a way to completely revert any changes that we had added.  Only then did we feel safe in making the feature available in Photo Mechanic.

HTH,

-Kirk


--- End quote ---
Kirk:

Thanks for the info. I'm assuming the the EXIF rotation will stay, just not yours, correct?

FYI, the data I'm trying to add are values for keywords and captions. Because those values are being pulled from a database, I can't use Photo Mechanic to do it. My work flow is to set the Object Name to the SKU# using Photo Mechanic, then all the keywords and caption are added using my software (again, thousands of photos and SKUs). So, I'm not adding any new fields, just values to existing fields.

Phil may download your software to see if there are changes to make to support the values.

Greg

Kirk Baker:

--- Quote from: gregkeene on May 25, 2006, 12:44:41 PM ---
--- Quote from: Kirk Baker on May 25, 2006, 12:37:32 PM ---
--- Quote from: gregkeene on May 25, 2006, 12:04:48 PM ---In addition to using Photo Mechanic as part of my work flow, I have some custom software written in Perl which loads IPTC tags and writes out a some additional tags. The module I'm using is by Phil Harvey called Image::ExifTool (http://www.sno.phy.queensu.ca/~phil/exiftool/).

What I found is that when I try to write the file, I get this error:
Error: [minor] 2064 unreferenced bytes at end of file not copied

I contacted Phil and he looked at the file and stated that '... the software is adding a non-standard trailer containing what looks to be an empty IPTC structure'. 

If I use my same custom software on native 30D .CR2 images, I don't get the error. It's only after Photo Mechanic edits the IPTC tags. I'd be interested in your thoughts and happy to help pursue the issue.

I'm using 4.4.3 on Mac OS X (10.4.6 - Intel).
--- End quote ---

While the data you are referring to is formatted like IPTC data, it is Photo Mechanic's image preferences that are contained in that data.  The last 12 bytes of the file are a backward link to the image preferences that are a fixed size 2048 byte block. (2048 + 12 accounts for your 2064 bytes as called out in the warning.)

You can choose to not preserve that data, but if you do decide to discard it, then you will lose the Color Class, Tag, Rotation, Crop, and in some cases the frame number.  But no IPTC caption data will be lost.

What data are you adding to the CR2 files?  Be very careful.  We only decided to implement IPTC/XMP captioning in CR2 files (and other RAW files) when we were able to come up with a way to completely revert any changes that we had added.  Only then did we feel safe in making the feature available in Photo Mechanic.

--- End quote ---
Kirk:

Thanks for the info. I'm assuming the the EXIF rotation will stay, just not yours, correct?
--- End quote ---

That's correct.


--- Quote from: gregkeene ---FYI, the data I'm trying to add are values for keywords and captions. Because those values are being pulled from a database, I can't use Photo Mechanic to do it. My work flow is to set the Object Name to the SKU# using Photo Mechanic, then all the keywords and caption are added using my software (again, thousands of photos and SKUs). So, I'm not adding any new fields, just values to existing fields.
--- End quote ---

But when you make the block of IPTC data bigger are you relocating the tiff table and putting your expanded IPTC data in a new location?  Because if you don't you risk damaging the CR2 file in such a way that some programs, including Canon's may not be able to parse the files any longer.


--- Quote from: gregkeene ---Phil may download your software to see if there are changes to make to support the values.
--- End quote ---

I'd be happy to give him a license if he wants one.

-Kirk

gregkeene:

--- Quote from: Kirk Baker on May 25, 2006, 12:51:19 PM ---
--- Quote from: gregkeene on May 25, 2006, 12:44:41 PM ---
--- Quote from: Kirk Baker on May 25, 2006, 12:37:32 PM ---
--- Quote from: gregkeene on May 25, 2006, 12:04:48 PM ---In addition to using Photo Mechanic as part of my work flow, I have some custom software written in Perl which loads IPTC tags and writes out a some additional tags. The module I'm using is by Phil Harvey called Image::ExifTool (http://www.sno.phy.queensu.ca/~phil/exiftool/).

What I found is that when I try to write the file, I get this error:
Error: [minor] 2064 unreferenced bytes at end of file not copied

I contacted Phil and he looked at the file and stated that '... the software is adding a non-standard trailer containing what looks to be an empty IPTC structure'. 

If I use my same custom software on native 30D .CR2 images, I don't get the error. It's only after Photo Mechanic edits the IPTC tags. I'd be interested in your thoughts and happy to help pursue the issue.

I'm using 4.4.3 on Mac OS X (10.4.6 - Intel).
--- End quote ---

While the data you are referring to is formatted like IPTC data, it is Photo Mechanic's image preferences that are contained in that data.  The last 12 bytes of the file are a backward link to the image preferences that are a fixed size 2048 byte block. (2048 + 12 accounts for your 2064 bytes as called out in the warning.)

You can choose to not preserve that data, but if you do decide to discard it, then you will lose the Color Class, Tag, Rotation, Crop, and in some cases the frame number.  But no IPTC caption data will be lost.

What data are you adding to the CR2 files?  Be very careful.  We only decided to implement IPTC/XMP captioning in CR2 files (and other RAW files) when we were able to come up with a way to completely revert any changes that we had added.  Only then did we feel safe in making the feature available in Photo Mechanic.

--- End quote ---
Kirk:

Thanks for the info. I'm assuming the the EXIF rotation will stay, just not yours, correct?
--- End quote ---

--- Quote from: gregkeene ---FYI, the data I'm trying to add are values for keywords and captions. Because those values are being pulled from a database, I can't use Photo Mechanic to do it. My work flow is to set the Object Name to the SKU# using Photo Mechanic, then all the keywords and caption are added using my software (again, thousands of photos and SKUs). So, I'm not adding any new fields, just values to existing fields.
--- End quote ---

But when you make the block of IPTC data bigger are you relocating the tiff table and putting your expanded IPTC data in a new location?  Because if you don't you risk damaging the CR2 file in such a way that some programs, including Canon's may not be able to parse the files any longer.


--- Quote from: gregkeene ---Phil may download your software to see if there are changes to make to support the values.
--- End quote ---

I'd be happy to give him a license if he wants one.

-Kirk

--- End quote ---

I've told Phil about your generous offer.

Hopefully he's correctly relocating the TIFF table to keep it compatible. I pointed him to this thread so he'll hopefully respond.

Also, if you are ever looking for beta testers, etc., I have experience there and would be happy to help do that in the future. I can test both Window and Mac (Intel only).

Greg

Navigation

[0] Message Index

[#] Next page

Go to full version