ExifTool Forum

ExifTool => Newbies => Topic started by: kkilgor on June 27, 2018, 09:08:22 AM

Title: Remove duplicate tags
Post by: kkilgor on June 27, 2018, 09:08:22 AM
I have a bunch of Duplicate UserComment tag in IFD1. When I used -G to go deeper, I see the following entries.

[EXIF]          User Comment                    : .
[EXIF]          User Comment                    : H.
[EXIF]          User Comment                    : H.
[EXIF]          User Comment                    : .
[EXIF]          User Comment                    : Ñ.
[EXIF]          User Comment                    : m.

Is there a way to delete all of these tags or keep one or merge or do what is possible to resolve this issue?

Thank you so much in adv.
Title: Re: Remove duplicate tags
Post by: Phil Harvey on June 27, 2018, 09:26:30 AM
You should be able to delete them all with:

exiftool -usercomment= FILE

But if you try to write them, ExifTool will just update them all.  So you could save the value(s) to a file then restore them afterward if you want to keep them:

1. exiftool -usercomment -b FILE > out.txt
2. exiftool -usercomment= FILE
3. exiftool "-usercomment<=out.txt" FILE

- Phil
Title: Re: Remove duplicate tags
Post by: kkilgor on June 27, 2018, 09:31:15 AM
I tried this before but it doesn't seem to work.

exiftool -usercomment= C:/Exif_POC/FILE.jpg
Warning: Duplicate UserComment tag in IFD1 - C:/Exif_POC/FILE.jpg
    0 image files updated
    1 image files unchanged

Not sure what IFD1 is (perhaps Thumbnail?).  Do I need to do something different because it says in IFD1?
Title: Re: Remove duplicate tags
Post by: Phil Harvey on June 27, 2018, 09:42:02 AM
UserComment should be in the ExifIFD.  Since it is in IFD1, you need to specify it explicitly:

exiftool -ifd1:usercomment= FILE

Are all the other UserComment's also in IFD1?

- phil
Title: Re: Remove duplicate tags
Post by: kkilgor on June 27, 2018, 09:56:14 AM
yes, they are. Just tried it and worked like a charm. Thank you so much.