News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

Remove duplicate tags

Started by kkilgor, June 27, 2018, 09:08:22 AM

Previous topic - Next topic

kkilgor

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.

Phil Harvey

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

kkilgor

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?

Phil Harvey

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

kkilgor

yes, they are. Just tried it and worked like a charm. Thank you so much.