Unable to Remove Photoshop DocumentAncestors tag

Started by banisco, November 15, 2018, 05:27:57 PM

Previous topic - Next topic

banisco

Hello,

I'm trying to strip the XMP-photoshop:DocumentAncestors tag from a PNG.  The PNG is a Photoshop layer that was extracted via ImageMagick.

I can list the documentancestors just fine:

exiftool -documentancestors foo.png

This displays a blizzard of info that I obviously don't need, and would like to remove. However if I try and delete the tag:

exiftool -documentancestors= foo.png
Warning: [minor] Excessive number of items for photoshop:DocumentAncestors. Processing may be slow - foo.png
    1 image files updated


I still see document ancestors:

exiftool -documentancestors foo.png
Document Ancestors              : 0014AFC47E4765ED0D1D510962B4EE62, 00AFAA8005F337E2C30FC053241B2482, blah blah blah


If I try and delete the remaining document ancesors EXIFTool reports that there is nothing changed:

exiftool -documentancestors= foo.png
    0 image files updated
    1 image files unchanged


I've tried variations of the tag name (.e.g. "-XMP-photoshop:DocumentAncestors") to no avail.

I can set a value on the tag that effectively 'clears' it:

exiftool -XMP-photoshop:documentancestors='' foo.png
    1 image files updated

exiftool -XMP-photoshop:DocumentAncestors foo.png
Document Ancestors              : ''

However, if I try and then really clear the tag, the ancestors come back:

exiftool -XMP-photoshop:DocumentAncestors= foo.png
    1 image files updated

exiftool -XMP-photoshop:DocumentAncestors foo.png
Document Ancestors              : 0014AFC47E4765ED0D1D510962B4EE62, 00AFAA8005F337E2C30FC053241B2482, 011EC86A319B777C77BE05FF371B50A0, 026D35E03F60BC2A0D1BF3F3A32F84FB, 02D3B8CF90B4B24CF32805FDD323F2A9, 03BB98A356199503B0AD930B886DFB72, 040FFC63536FE9AA602B4CB30465C8D4, 0426FA60258263A073D4C1A6CB3411A0, 042D1AC6D3D9DC7A6DBE80B8273135B4, 043E9B7D95FC98BA5C95CE69D2E80D9A, 04DA49DD66D958E3CF4862F636FBF0EF, 04DC31792968692098651B230B8F066F, 05416019D8D0D4C949B09A725342E275, 05D531352A3DD8E844550E17D90033D6, 06B6A4952B59289E84ACE41B2BDBF5A1, 0742406C9EE9DE56E033E47D1B23BD2B, blahblahblah...


Any clues as to what I am doing wrong?

Thanks!

(Running EXIFTTool version 11.19 on windows 10)

StarGeek

If you run exiftool -g1 -a -s on the file you'll see that there are two DocumentAncestors tags in the file, which it probably why it "reappears".  I tried a variety of things to try and fix it, but nothing would work.  It's going to take someone looking at the actually tags in the file to figure out what's going on.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Phil Harvey

The XMP exists in two raw profiles in this file.  ExifTool is editing the XMP raw profile, but there is more XMP in the photoshop "8bim" profile that ExifTool extracts but doesn't edit.

- 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

Hmm.  So perhaps a better question would be how to remove the Photoshop profile from the PNG zTXt chunk?

I looked through the docs and came up with:

exiftool -zTXt:Photoshop_Profile foo.png
Warning: Sorry, zTXt:Photoshop_Profile doesn't exist or isn't writable
Nothing to do.


Is this due to the fact that (most) Photoshop tags are not writable by EXIFTool?  I was hoping the zTXt approach would get around that. I really just want to strip the whole profile out of the file since I don't see a need for it.  Stripping  all tags will clean it up, I just didn't want to have to go that far.

banisco

Eh, my test example is wrong as usual.  :-[  There is no zTXt tag; and Photoshop_Profile is really a reference to the individual Photoshop tags which for the most part are not writable.

Unless there is a way to remove the 8BIM profile from the zTXt chunk that I haven't thought of, I'll assume this is not possible with EXIFTool.  (TweakPNG can do it but it is not a command-line tool that can be scripted.)

Thanks to all for passing along the wisdom.

StarGeek

Try this:
exiftool -m -all= -tagsfromfile @ -all:all --DocumentAncestors foo.png

That seemed to do it.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

banisco

+1

That works perfectly!  Thanks for digging to find a solution.