Why Photoshop doesn't like my tiffs with XMP

Started by my-spot, March 16, 2011, 12:31:35 PM

Previous topic - Next topic

my-spot

Hello All,

I am authoring a program that writes TIF files. All has been fine for years however I recently decided to try to add an XMP packet to the metadata (via tiff tag 700). However, I have access to PS7 and CS2 and both give me an error when opening my tiff files with an XMP tag. I have started out slow and only include two or three Dublin Core items so far. Anyway after a number of hours of unsuccessfully trying to figure out what the issue is, I figured I would try here for some advice.
Here is the behavior / background:

- My tiff header data is not the most size efficient (lots of empty space).
- Exiftool and other programs report no problem with my XMP tag data.
- Photoshop is happy if I remove (don't write) the 700 tag.
- If I do write the 700 tag, PS7 doesn't read as much of the non xmp metadata as it does with the tag removed.
- CS2 reports the error but still seems to read the metadata.
- I can "Load" my extracted xmp packet as a file into PS7 via "File Info"->"Load" and PS7 happily adds the metadata.

If I run the file through the following, then PS is happy.

exiftool -tagsfromfile eRPL_RPL.tif -all:all RPL.xmp
exiftool -tagsfromfile RPL.xmp -all:all eRPL_RPL.tif


My xmp packet and the one exiftool produces after this is almost identical and other then a more efficient tiff header (and data placement), exiftool doesn't report any real differences.
Sample files produced from my program (RPL) and Exiftool (ET) are here: http://www.my-spot.com/RPL/...

- eRPL_RPL.tif is my program's output.
- eRPL_ET.tif is the file after the above exiftool sequence.
- The xmp files here are cut and paste directly from the resulting tiff files' xmp packets (not exiftool output).

Any insight as to why my tif files are tripping up PS would be greatly appreciated.

Thanks!
Frank

Phil Harvey

#1
Hi Frank,

Do you think that maybe Photoshop doesn't like the trailing NULL byte in your XMP record?

Either that or there are a couple of problems in the TIFF structure of eRPL_RPL.tif that are fixed when it is rewritten by ExifTool.  It is possible that these could cause problems too.  (Use the -htmldump option to see these.)

- Phil

(I should really charge $ for this stuff...) :)

Edit: OK, so the problems aren't really serious, and are just values referenced by more than one tag, which is questionable, but may be intentional.
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Phil Harvey

Quote from: Phil Harvey on March 16, 2011, 01:31:18 PM
(I should really charge $ for this stuff...) :)

Hey, Frank!  I just got a PayPal donation from you!! :)

Thanks!!

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

my-spot

Quote from: Phil Harvey on March 16, 2011, 01:31:18 PM
Hi Frank,

Do you think that maybe Photoshop doesn't like the trailing NULL byte in your XMP record?

Either that or there are a couple of problems in the TIFF structure of eRPL_RPL.tif that are fixed when it is rewritten by ExifTool.  It is possible that these could cause problems too.  (Use the -htmldump option to see these.)

- Phil

(I should really charge $ for this stuff...) :)

Edit: OK, so the problems aren't really serious, and are just values referenced by more than one tag, which is questionable, but may be intentional.

You nailed it!!! That NULL byte was the problem. I figured it was something minor and stupid like that - I was just too "close" to the problem and needed a fresh set of eyes. As for the other stuff, yep, I do have a some values that are referenced by multiple tags which I intend to clean up now that I'm adding more metadata fields. I will likely rewrite things so all of those empty bytes are cleaned up too.

BTW - I'm so delighted that I just subsidized your next couple Happy-Meals!

Frank
http://www.my-spot.com/RHC/

Phil Harvey

Great.  Glad that fixed it.

Quote from: my-spot on March 16, 2011, 02:46:48 PM
BTW - I'm so delighted that I just subsidized your next couple Happy-Meals!

While I do enjoy the happy-meal toys, I think I'll put it towards a new SDHC card for my camera instead. :)

Thanks!

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).