ExifTool vs. Photoshop--metadata retention issue

I know this isn’t strictly AppleScript, but I’m at a loss and hoping the folks here who use ExifTools regularly could help. I’ve sent a variation of this to Phil (creator of ExifTools) as well:

I’m having a wierd problem with Adobe metadata I hoped you could enlighten me on…

I have an AppleScript I’m writing that, among other things, uses ExifTools (nice tool!) to append some information to the metadata in an image file. The basic goings-ons are:

–Script edits metadata (some already exists from a stock photo house)
–Script restores resource fork info (did you know ExifTools eradicates the File Type and File Creator in the Mac Resource Fork?), metadata edits still okay
–Script opens file in Photoshop, performs some operations.
–Script saves image out of Photoshop…metadata edits disappear (but original metadata before the edits is fine)

So the gist is that while the metadata added by ExifTools survives, is visible in Adobe Bridge, etc., the minute the file is resaved out of Photoshop to a new file, the edits are removed and the state previous to the edits is restored.

It is almost like Adobe has some invisible “pointer” or “flag” set that recognizes edits it’s software didn’t make and simply ignores everything after the pointer. Best way I have to describe it.

The line in my script used to write the metadata is:

do shell script ((quoted form of g_command_path) & " -SpecialInstructions=" & quoted form of write_instructions & " " & quoted form of (POSIX path of item_alias))

If that looks bizarre, the actual code ExifTools sees is:

So right after the edit is made, the [Clorox Creatve Contract ID: ] is there in the metadata, very happy, right after any copy that was already there (RF Image, Not Model Released, Not Property Released). But when the script opens the file and then resaves it, the “[Clorox” info is missing from the new file, but the previously existing “RF Image” stuff is still there. Very odd.

Wierder is that the way I have it set-up above, it erases Special Instructions and re-writes it with a a variable that has manually recombined the existing data with my new data (i.e. not using ExifTool’s appending features, since I couldn’t figure out how to make that work):

	if exif_instructions is "" then
		set write_instructions to ""
	else
		set write_instructions to paragraph 1 of exif_instructions & " "
	end if
	
	set write_instructions to write_instructions & " [Clorox Creative Contract ID: " & add_contract_ID & "]"

I can get around it by doing the metadata edits last after the Photoshop work, but it concerns me that the data may simply vanish the next time the user opens and resaves the file…unbeknownst to me.

Any ideas?

Yes. This is why the -overwrite_original_in_place option exists.

You are writing IPTC, but Photoshop will likely prioritize the XMP information. IPTC:SpecialInstructions has an equivalent of XMP:Instructions.

When both IPTC and XMP exist, you must take care to keep them synchronized. See the xmp2iptc.args and iptc2xmp.args files that come with the full exiftool distribution to see how to synchronize these.

- Phil

LOL…had no idea you watched this forum Phil…or I wouldn’t have sent it to both places!

Wow…never ceases to amaze me, 10+ years with Macs and the support from shareware, freeware and relative “budgetware” software is always excellent.

Thanks Phil, I will do the reading you suggested about synchronizied the IPTC and XMP data. This just turned out to be more complicated than I thought. :stuck_out_tongue:

Kevin, take a look here yes its far more complicated.

http://www.adobe.com/devnet/xmp/

I also suggest you post a Bug Report with Adobe, Kevin.

Both Illustrator and Photoshop strip out extended attributes metadata when saving files - data that it neither owns or creates. This is a bug! And a rather obnoxious one for the workflow I’m developing.

Jim Neumann
BLUEFROG

Yeeeeaaaaaaah.

They still haven’t fixed, since CS2:

–Printing composite color prints with transparency over spot color causing wierd CMYK block-outs.

In CS3:

–Printing multi-page or multiple-copies of a horizontally-oriented file…first page prints fine, additional copies or pages print landscape orientation
–OS X 10.5.6 update fixed the above bug, but then caused us to be unable to use our large-format printers: keeps printing everything enlarged no matter what we tell the plotters. Admittedly, these two exists somewhere between Apple and Adobe, likely, but neither is talking and Adobe long ago could have worked around it…and the RIP companies like EFI just blame Adobe…)
–Copy-n-paste of masked objects to a new document often causes them to resize, exit their masks, and other wierdness when the objects are on multiple layers
–Issues with fx and spot colors

Need I say more? I can keep going it you’d like… ;-p

I half expect all these bugs to still exist in CS4…just started testing.

Adobe doesn’t listen to bug reports, and when they do, they fix it in the next version rather than do patches. I’ve really come to think of them as “Microsoft Light” these days.

Easier to work

I have always found it odd that InDesign and Quark both support alpha channel masks but having alpha channels in the placed file can cause printing problems. Since alpha channels were the original way to save selections you think that they would not have a problem with them. It is always a pain to go back and remove the channels you spent so long to build. Sure you can save them as layer masks but that is beside the point.

And if people stop reporting bugs, nothing will ever get fixed.

The final stage to Adobe actually becoming Microsoft…cool. Nothing quite like live participation in a science experiment to get the blood going. Kinda like voting. :stuck_out_tongue:

(You’ll have to excuse my cynicism, but after having the rare opportunity of being able to report bugs to Adobe, Apple, and EFI at the developer and alpha-testing level for over 5 years…and seeing nothing done, one tends to choose other battles after a while…)

I decided rather than fight with whatever Adobe is doing to metadata to just put that feature of my script on-hold for now. The rest of it is working and it does the main goal of the project. The metadata would have been a bonus. Details, details…