The following command line deletes the APP2 ICC_Profile segment entirely from the photo:
exiftool -all= -tagsfromfile @ -all:all -unsafe IMG_7640-4.jpg
(See the attached file.) Is that a bug?
Some background: We're using Exiftool to rewrite the metadata of JPEGs exported by LR 6, which has two problems, an atypical layout of IFDs in the APP1 segment:
http://feedback.photoshop.com/photoshop_family/topics/lightroom-cc-jpeg-format-tripping-up-other-programs?rfm=1
and a bug in writing large amounts of XMP metadata:
http://feedback.photoshop.com/photoshop_family/topics/lightroom-6-invalid-xmp-metadata-written-to-exported-jpegs-tripping-up-reading-software
This is by design to prevent the color profile from being copied accidentally. (The ICC_Profile is marked as "unsafe", as can be seen in the Extra tags documentation (https://exiftool.org/TagNames/Extra.html).) So you must specify -icc_profile explicitly if you want this to be copied.
Perhaps it is an oversight, but the -unsafe shortcut doesn't include the ICC_Profile (https://exiftool.org/TagNames/Shortcuts.html). I'll think about adding this.
I'll read your references tomorrow when I have more time. Thanks for these.
- Phil
Thanks very much for the clarification.
I think it is best to leave the Unsafe tag as it is (since it is documented as representing unsafe EXIF tags, and the ICC profile isn't part of EXIF), so instead I have added -icc_profile to the command in FAQ 20 (https://exiftool.org/faq.html#Q20).
Thanks for mentioning this.
- Phil
Your references describing the Adobe LR6 bugs are interesting. In looking into this I added a few more details about the Adobe extended XMP segments to the ExifTool HtmlDump. These additions will appear in ExifTool 9.96.
The unused bytes after the TIFF header are an aborted attempt at IFD0, and contain all the same information as the actual IFD0 (located at the end of the APP1 EXIF segment), except for the Orientation tag.
- Phil
Thanks much for your help on this issue!
You might consider also updating the Copying Example in the application documentation: http://www.exiftool.org/exiftool_pod.html
exiftool -exif:all= -tagsfromfile @ -all:all -unsafe bad.jpg
which is where we first read about the idiom.
Hi John,
Quote from: johnrellis on May 11, 2015, 03:37:46 PM
You might consider also updating the Copying Example in the application documentation: http://www.exiftool.org/exiftool_pod.html
exiftool -exif:all= -tagsfromfile @ -all:all -unsafe bad.jpg
But it isn't necessary to copy back the ICC_Profile with this command because it
deletes only EXIF tags (with
-exif:all=), while the command you were using earlier deleted everything (with
-all=). So the example in the application documentation is fine as is. (This is actually the reason why I decided against adding ICC_Profile to the Unsafe shortcut.)
- Phil
Oops, got it, thanks.