Unable to exclude XMP tag from 'all' operation

Started by banisco, July 17, 2018, 11:46:09 PM

Previous topic - Next topic

banisco

Hello,

This is a two-fold question relating to the XMP Photoshop 'Instructions' tag.  I have a PNG file saved from a Photoshop PSD.  It contains XMP metadata including an Instructions tag:

λ exiftool -xmp:instructions xmp.png
Instructions                    : front-standard:x:20, y:40, width:1500

If I attempt to strip all XMP metadata - excluding the instructions tag - it doesn't work:

λ exiftool --xmp:instructions -xmp:all= xmp.png
    1 image files updated

λ exiftool -xmp:instructions xmp.png


Going the other way, I can add an XMP Instructions tag to the cleaned PNG and EXIFTool will report it:

λ copy xmp.png xmp_stripped.png
        1 file(s) copied.

λ exiftool -xmp:instructions=foo:bar xmp_stripped.png
    1 image files updated

λ exiftool -xmp:instructions xmp_stripped.png
Instructions                    : foo:bar


However, Photoshop does not recognize the XMP metadata - see attached screenshots displaying the Instructions field and XML raw data from Photoshop.

Am I not excluding the xmp:instructions tag correctly?  Is there a compatibility issue between EXIF XMP and Photoshop XMP?

(FYI I'm testing this using EXIFTool V11.06 on Windows 10 64-bit.)

Thanks!


Phil Harvey

I don't know what is up with my copy of Photoshop, but it hangs whenever I do "File Info..." on any image. :(  (PS CS4 incompatible with High Sierra?)

The order of operations for this command command

exiftool --xmp:instructions -xmp:all= xmp.png

is wrong.  It should be:

exiftool -xmp:all= --xmp:instructions xmp.png

Regarding Photoshop not displaying the Instructions written by ExifTool.  Try writing the same instructions with Photoshop and compare the two files with exiftool -a -G1 FILE to see what is different.

- 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 ($).

banisco

I copied your command line for excluding your tag verbatim, and it still appears to remove the excluded tag?

λ exiftool -xmp:instructions xmp.png
Instructions                    : front-standard:x:20, y:40, width:1500

λ exiftool -xmp:all= --xmp:instructions xmp.png
    1 image files updated

λ exiftool -xmp:instructions xmp.png

λ exiftool -a -G1 xmp.png
[ExifTool]      ExifTool Version Number         : 11.06
[System]        File Name                       : xmp.png
[System]        Directory                       : .
[System]        File Size                       : 86 kB
[System]        File Modification Date/Time     : 2018:07:18 09:00:59-07:00
[System]        File Access Date/Time           : 2018:07:18 09:00:59-07:00
[System]        File Creation Date/Time         : 2018:07:17 20:16:25-07:00
[System]        File Permissions                : rw-rw-rw-
[File]          File Type                       : PNG
[File]          File Type Extension             : png
[File]          MIME Type                       : image/png
[PNG]           Image Width                     : 1400
[PNG]           Image Height                    : 1400
[PNG]           Bit Depth                       : 8
[PNG]           Color Type                      : RGB with Alpha
[PNG]           Compression                     : Deflate/Inflate
[PNG]           Filter                          : Adaptive
[PNG]           Interlace                       : Noninterlaced
[PNG]           Profile Name                    : Adobe RGB (1998)
[ICC-header]    Profile CMM Type                : Adobe Systems Inc.
[ICC-header]    Profile Version                 : 2.1.0
[ICC-header]    Profile Class                   : Display Device Profile
[ICC-header]    Color Space Data                : RGB
[ICC-header]    Profile Connection Space        : XYZ
[ICC-header]    Profile Date Time               : 1999:06:03 00:00:00
[ICC-header]    Profile File Signature          : acsp
[ICC-header]    Primary Platform                : Apple Computer Inc.
[ICC-header]    CMM Flags                       : Not Embedded, Independent
[ICC-header]    Device Manufacturer             : none
[ICC-header]    Device Model                    :
[ICC-header]    Device Attributes               : Reflective, Glossy, Positive, Color
[ICC-header]    Rendering Intent                : Media-Relative Colorimetric
[ICC-header]    Connection Space Illuminant     : 0.9642 1 0.82491
[ICC-header]    Profile Creator                 : Adobe Systems Inc.
[ICC-header]    Profile ID                      : 0
[ICC_Profile]   Profile Copyright               : Copyright 1999 Adobe Systems Incorporated
[ICC_Profile]   Profile Description             : Adobe RGB (1998)
[ICC_Profile]   Media White Point               : 0.95045 1 1.08905
[ICC_Profile]   Media Black Point               : 0 0 0
[ICC_Profile]   Red Tone Reproduction Curve     : (Binary data 14 bytes, use -b option to extract)
[ICC_Profile]   Green Tone Reproduction Curve   : (Binary data 14 bytes, use -b option to extract)
[ICC_Profile]   Blue Tone Reproduction Curve    : (Binary data 14 bytes, use -b option to extract)
[ICC_Profile]   Red Matrix Column               : 0.60974 0.31111 0.01947
[ICC_Profile]   Green Matrix Column             : 0.20528 0.62567 0.06087
[ICC_Profile]   Blue Matrix Column              : 0.14919 0.06322 0.74457
[PNG-pHYs]      Pixels Per Unit X               : 7874
[PNG-pHYs]      Pixels Per Unit Y               : 7874
[PNG-pHYs]      Pixel Units                     : meters
[Composite]     Image Size                      : 1400x1400
[Composite]     Megapixels                      : 2.0

Separately, I added the instruction tag via Photoshop and then used your command to generate the tag info, and the output for the two files are as follows.
EXIFTool:
[ExifTool]      ExifTool Version Number         : 11.06
[System]        File Name                       : xmp_stripped_with_instructions.png
[System]        Directory                       : .
[System]        File Size                       : 86 kB
[System]        File Modification Date/Time     : 2018:07:17 20:27:52-07:00
[System]        File Access Date/Time           : 2018:07:17 20:27:52-07:00
[System]        File Creation Date/Time         : 2018:07:17 20:27:26-07:00
[System]        File Permissions                : rw-rw-rw-
[File]          File Type                       : PNG
[File]          File Type Extension             : png
[File]          MIME Type                       : image/png
[PNG]           Image Width                     : 1400
[PNG]           Image Height                    : 1400
[PNG]           Bit Depth                       : 8
[PNG]           Color Type                      : RGB with Alpha
[PNG]           Compression                     : Deflate/Inflate
[PNG]           Filter                          : Adaptive
[PNG]           Interlace                       : Noninterlaced
[PNG]           Profile Name                    : Adobe RGB (1998)
[ICC-header]    Profile CMM Type                : Adobe Systems Inc.
[ICC-header]    Profile Version                 : 2.1.0
[ICC-header]    Profile Class                   : Display Device Profile
[ICC-header]    Color Space Data                : RGB
[ICC-header]    Profile Connection Space        : XYZ
[ICC-header]    Profile Date Time               : 1999:06:03 00:00:00
[ICC-header]    Profile File Signature          : acsp
[ICC-header]    Primary Platform                : Apple Computer Inc.
[ICC-header]    CMM Flags                       : Not Embedded, Independent
[ICC-header]    Device Manufacturer             : none
[ICC-header]    Device Model                    :
[ICC-header]    Device Attributes               : Reflective, Glossy, Positive, Color
[ICC-header]    Rendering Intent                : Media-Relative Colorimetric
[ICC-header]    Connection Space Illuminant     : 0.9642 1 0.82491
[ICC-header]    Profile Creator                 : Adobe Systems Inc.
[ICC-header]    Profile ID                      : 0
[ICC_Profile]   Profile Copyright               : Copyright 1999 Adobe Systems Incorporated
[ICC_Profile]   Profile Description             : Adobe RGB (1998)
[ICC_Profile]   Media White Point               : 0.95045 1 1.08905
[ICC_Profile]   Media Black Point               : 0 0 0
[ICC_Profile]   Red Tone Reproduction Curve     : (Binary data 14 bytes, use -b option to extract)
[ICC_Profile]   Green Tone Reproduction Curve   : (Binary data 14 bytes, use -b option to extract)
[ICC_Profile]   Blue Tone Reproduction Curve    : (Binary data 14 bytes, use -b option to extract)
[ICC_Profile]   Red Matrix Column               : 0.60974 0.31111 0.01947
[ICC_Profile]   Green Matrix Column             : 0.20528 0.62567 0.06087
[ICC_Profile]   Blue Matrix Column              : 0.14919 0.06322 0.74457
[PNG-pHYs]      Pixels Per Unit X               : 7874
[PNG-pHYs]      Pixels Per Unit Y               : 7874
[PNG-pHYs]      Pixel Units                     : meters
[XMP-x]         XMP Toolkit                     : Image::ExifTool 11.06
[XMP-photoshop] Instructions                    : foo:bar

[Composite]     Image Size                      : 1400x1400
[Composite]     Megapixels                      : 2.0


Photoshop:
[ExifTool]      ExifTool Version Number         : 11.06
[System]        File Name                       : xmp_stripped_with_instructions_ps.png
[System]        Directory                       : .
[System]        File Size                       : 87 kB
[System]        File Modification Date/Time     : 2018:07:18 08:31:11-07:00
[System]        File Access Date/Time           : 2018:07:18 08:31:11-07:00
[System]        File Creation Date/Time         : 2018:07:18 08:31:08-07:00
[System]        File Permissions                : rw-rw-rw-
[File]          File Type                       : PNG
[File]          File Type Extension             : png
[File]          MIME Type                       : image/png
[PNG]           Image Width                     : 1400
[PNG]           Image Height                    : 1400
[PNG]           Bit Depth                       : 8
[PNG]           Color Type                      : RGB with Alpha
[PNG]           Compression                     : Deflate/Inflate
[PNG]           Filter                          : Adaptive
[PNG]           Interlace                       : Noninterlaced
[PNG]           Profile Name                    : Adobe RGB (1998)
[ICC-header]    Profile CMM Type                : Adobe Systems Inc.
[ICC-header]    Profile Version                 : 2.1.0
[ICC-header]    Profile Class                   : Display Device Profile
[ICC-header]    Color Space Data                : RGB
[ICC-header]    Profile Connection Space        : XYZ
[ICC-header]    Profile Date Time               : 1999:06:03 00:00:00
[ICC-header]    Profile File Signature          : acsp
[ICC-header]    Primary Platform                : Apple Computer Inc.
[ICC-header]    CMM Flags                       : Not Embedded, Independent
[ICC-header]    Device Manufacturer             : none
[ICC-header]    Device Model                    :
[ICC-header]    Device Attributes               : Reflective, Glossy, Positive, Color
[ICC-header]    Rendering Intent                : Media-Relative Colorimetric
[ICC-header]    Connection Space Illuminant     : 0.9642 1 0.82491
[ICC-header]    Profile Creator                 : Adobe Systems Inc.
[ICC-header]    Profile ID                      : 0
[ICC_Profile]   Profile Copyright               : Copyright 1999 Adobe Systems Incorporated
[ICC_Profile]   Profile Description             : Adobe RGB (1998)
[ICC_Profile]   Media White Point               : 0.95045 1 1.08905
[ICC_Profile]   Media Black Point               : 0 0 0
[ICC_Profile]   Red Tone Reproduction Curve     : (Binary data 14 bytes, use -b option to extract)
[ICC_Profile]   Green Tone Reproduction Curve   : (Binary data 14 bytes, use -b option to extract)
[ICC_Profile]   Blue Tone Reproduction Curve    : (Binary data 14 bytes, use -b option to extract)
[ICC_Profile]   Red Matrix Column               : 0.60974 0.31111 0.01947
[ICC_Profile]   Green Matrix Column             : 0.20528 0.62567 0.06087
[ICC_Profile]   Blue Matrix Column              : 0.14919 0.06322 0.74457
[PNG-pHYs]      Pixels Per Unit X               : 7874
[PNG-pHYs]      Pixels Per Unit Y               : 7874
[PNG-pHYs]      Pixel Units                     : meters
[XMP-x]         XMP Toolkit                     : Adobe XMP Core 5.6-c142 79.160924, 2017/07/13-01:06:39
[XMP-xmp]       Creator Tool                    : Adobe Photoshop CC 2018 (Windows)
[XMP-xmp]       Create Date                     : 2018:07:17 20:27:26-07:00
[XMP-xmp]       Modify Date                     : 2018:07:18 08:31:09-07:00
[XMP-xmp]       Metadata Date                   : 2018:07:18 08:31:09-07:00
[XMP-dc]        Format                          : image/png
[XMP-photoshop] Color Mode                      : RGB
[XMP-photoshop] ICC Profile Name                : Adobe RGB (1998)
[XMP-photoshop] Instructions                    : foo:bar
[XMP-xmpMM]     Instance ID                     : xmp.iid:148a6c99-cdc6-e64c-aa7f-e2f0311ce090
[XMP-xmpMM]     Document ID                     : adobe:docid:photoshop:5e086148-9d96-3643-8cf7-8624ebf3d1e5
[XMP-xmpMM]     Original Document ID            : xmp.did:2c284d66-2909-4344-8ccd-53f700054236
[XMP-xmpMM]     History Action                  : saved, saved
[XMP-xmpMM]     History Instance ID             : xmp.iid:2c284d66-2909-4344-8ccd-53f700054236, xmp.iid:148a6c99-cdc6-e64c-aa7f-e2f0311ce090
[XMP-xmpMM]     History When                    : 2018:07:18 08:31:09-07:00, 2018:07:18 08:31:09-07:00
[XMP-xmpMM]     History Software Agent          : Adobe Photoshop CC 2018 (Windows), Adobe Photoshop CC 2018 (Windows)
[XMP-xmpMM]     History Changed                 : /, /
[Composite]     Image Size                      : 1400x1400
[Composite]     Megapixels                      : 2.0


The Instruction tag exists in both files, so it must be a limitation of what the Photoshop XMP parser expects?

Apologies for bringing up two separate issues on one thread; my main concern is the preservation of the XMP Instructions tag when removing everything else XMP.

Phil Harvey

Ah right.  Sorry.  I should read the documentation:

            But note that this will not exclude individual tags
            from a group delete (unless a family 2 group is specified, see
            note 4 below).  Instead, individual tags may be recovered using
            the -tagsFromFile option (eg. "-all= -tagsfromfile @ -artist").


- Phil

(PS. Sorry for the site going offline for a bit, probably while you were posting -- I just did a system update.)
...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 ($).

banisco

Actually, I should read the instructions  :D

The -tagsfromfile works perfectly, and Photoshop is rendering the tag correctly in File Info.  Thanks again for your help!