IPTC data location in file

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

Previous topic - Next topic

Archive

[Originally posted by 00coday on 2005-12-19 21:22:02-08]

I am dealing with JPEG's with metadata is three locations:

1.  Metadata provided by photoshop 5.5 or lower place the IPTC data in the "header" of the image file before the image data.

2.  Metadata provided by SCC MediaGrid places the IPTC data after the image data if the "footer" of the image file.

3.  XMP data is entered by photoshop cs and up and is placed in yet a third location.

My question is, is there a way to force the exif tool to write to both the "header" and "footer" of the file?  

I notice that the "application version" tags contain different data based on where the IPTC data is stored.  Can I specify where the IPTC data is inserted with the ExifTool by specifying which Application Version is being used?

Archive

[Originally posted by exiftool on 2005-12-20 12:39:53-08]

This is an interesting question to me because I have never seen a JPEG image where the meta information comes after the image data.  It shouldn't happen.

By convention, in a JPEG image the IPTC meta information is stored within the Photoshop IRB records inside the JPEG APP13 segment.   By the EXIF specification, the EXIF APP1 segment should come first in the image, then typically the APP13 segment comes next.  I have sometimes seen Photoshop files where the APP13 segment comes first, but this is incorrect and ExifTool will not write an image like this.  In either case though, both APP1 and APP13 come before the image data.  In fact, for speed ExifTool does not even parse an image beyond the SOI (Start Of Image) marker when extracting information.

The XMP information is stored in a second APP1 segment, which ExifTool writes after the Photoshop APP13 segment, but other utilities may write the APP segments in a different order.  This is fine, as long as the EXIF APP1 segment comes first and they all come before the SOI.

The IPTC Application version has nothing to do with where the information is stored.

Perhaps a sample would be useful so I can see what you are talking about.  Also, why do you care about where the information is stored?

Archive

[Originally posted by 00coday on 2005-12-23 22:21:50-08]

A sample can be found at:

http://www.o-day.net/sample/ it is called mgupdate2.jpeg.

What I did was create an image in Photoshop 5.5 (white background, nothing pretty) and entered IPTC data.  I then updated the IPTC data with MediaGrid.  This resulted in IPTC data both before and after the image data. I then used the ExifTool to update the IPTC data.  This updated the IPTC before the image data, but not after.

We are concerned about IPTC placement due to the vast number of tools that can be used to get at it.  We have not found one tool that hits all possible IPTC data places at once.  This can cause a problem if a tool like MediaGrid is used to enter IPTC data information by a photographer and some data entered is classified or not for public release.  When the IPTC data is "cleaned" we use photoshop or ExifTool to load data from a database.  Nither of these tools deals with the IPTC data after the image data, which leaves the initial, uncleaned, data in the image.  Opening a jpg file in wordpad will display this information at the bottom of the file.

Archive

[Originally posted by exiftool on 2005-12-24 20:52:10-08]

Thanks for the sample.  I can see the problem.

There is a trailer after the JPEG image containing the IPTC information.  The trailer starts with a byte sequence including the characters "AXS!", so I did a search on this and discovered that it is indeed a documented protocol for storing information in JPEG images.

I will look into this.  I should be able to read this information, but I don't want to slow down ExifTool, and parsing to the end of the JPEG could be time consuming.  There may be some tricks I can use though.  I'll see.  It may take a week or two (it's Christmas so I'm not working too hard.. ), but I should be able to add the ability to read/write both sets of IPTC information.

- Phil

Archive

[Originally posted by exiftool on 2006-01-01 17:27:47-08]

I've just released ExifTool 5.88 which will read and write this IPTC trailer information.  It does a quick seek
to the end of the file to check for the information to avoid slowing things down if it doesn't exist.

This technique for storing IPTC information is known as the AXS File Concatination Protocol (AFCP), and ExifTool
will look for this information in JPEG images.

Archive

[Originally posted by 00coday on 2006-01-04 22:45:35-08]

Thank you for the response.  Now, I am a windows weenie and wondering how to get this update installed.  I installed the ExifTool via PPM and it installed version 5.3x.  Needless to say, I am a little behind.  My attempts to get Perl mods installed via CPAN on windows have ended in failure.  Any thoughts/words of advice about going about the update?

Thanks again

Archive

[Originally posted by exiftool on 2006-01-04 23:44:39-08]

I'm not a Windows guru, so I'm not a big help here, but it should be trivial because (in fact) no installation is actually necessary.  All you need to do is download the distribution and unzip the archive.  Then you can launch exiftool like this:

Code:
   perl c:\path_to_exiftool\exiftool image.jpg

Perhaps this description from a more Windows-savvy user will help.  According to him, you can use either WinZIP or pkzip to unzip the distribution archive.

I hope this helps.

Archive

[Originally posted by exiftool on 2006-01-05 00:26:57-08]

I just re-read one of your earlier posts, and realized that you're using another script which relies on the ExifTool libraries.
If this is the case, my previous advice won't work, and you must install the libraries in a standard location.

The trick then is to figure out where ExifTool is installed, then copy all files in the "lib" directory over top of the old ExifTool installation.  You can list the Perl library include path like this:

Code:
   perl -e "print join(' ',@INC)"

Look for an "Image" directory containing "ExifTool.pm" in the listed directories (check the directories in order -- you
only need to replace ExifTool in the first directory that you find it).  Then copy Image\ExifTool.pm and the entire Image\ExifTool directory over top of the old files you had installed.  You may also want to copy File\RandomAccess.pm over too, although it is likely this file didn't change.

A bit trickier, but still not too difficult.

Archive

[Originally posted by 00coday on 2006-01-18 18:54:28-08]

Is there a way to direct the tool to write the trailer information, even if it does not exist in the original image?  

What I am ultimately looking to do is clear all metadata from an image and write data from a database to both IPTC locations (header/trailer) and to XMP.  The goal is to make all three locations match so we don't run into descrepencies if different applications are used to read the image.

Any thoughts?

Archive

[Originally posted by exiftool on 2006-01-18 20:59:32-08]

I understand.  When I added the AFCP support, I tried to think of an easy way to specify to add this information if it didn't exist, but didn't come up with an acceptable solution.  The use of AFCP information is very uncommon, so I would rather not add a new option just for this.

But the actual mechanics of adding AFCP information is trivial, so maybe for now it is easiest to do this outside of ExifTool.  I have prepared a simple script that will add a blank AFCP trailer to a JPEG image if it doesn't already have one.  So all you have to do is run this script before using ExifTool to add IPTC information to an image.  I realize this isn't ideal, but at least it allows you to accomplish your goal.

You can download the script from https://exiftool.org/add_afcp.tar.gz

If necessary, you can remove the AFCP again using ExifTool:

Code:
   exiftool -afcp:all= image.jpg