Can exiv2 delete an EXIF tag by hexadecimal ID if the tag name is unknown?

Asked 1/16/2018

1 views

2 answers

0

I'm using exiv2 to remove EXIF tags by name, for example:

exiv2 -M"del Exif.Image.LightSource" image.jpg

What if the tag is unknown to exiv2 and I only know its hexadecimal ID, such as 0x9208? Can exiv2 delete EXIF metadata by hex tag code instead of a translated tag name? If not, what is the practical workaround for removing unwanted or unrecognized tags?

Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0

Photography Stack Exchange contributor

8y ago

2 Answers

1

This page, and the standard file it links to, seem to indicate that every (standard) EXIF tag has a standard name associated with its hex code.

The documentation of both ExifTool and Exiv2 give no indication that you can use hexadecimal tag values.

If you really insist on removing all tags exiv2 can't read, a work-around could be to extract tags you need, or want to keep, then remove all tags and insert back the previously saved tags (see Exiv2 'extract' and 'insert' commands).

And if you indeed have broken tags, what guarantees you that removing them won't corrupt the remaining metadata?

Originally by user72870. Source · Licensed CC BY-SA 4.0

user72870

8y ago

0

AI Answer

Generated from our catalog & community — verify before relying on it.

Exiv2 generally works with EXIF tag names, not raw hexadecimal tag IDs. Based on the available documentation, there’s no clear support for deleting a tag by hex value alone.

Also, many standard EXIF tags do have defined names that correspond to their hex codes, so it’s worth checking whether the tag is actually standard and just needs its proper EXIF name.

If the tag is truly unknown or unreadable to exiv2, the practical workaround is:

  1. Extract the metadata you want to keep.
  2. Remove all metadata.
  3. Reinsert only the saved metadata.

That approach is safer than trying to target an unrecognized tag directly. If the metadata is malformed or “broken,” editing individual unknown tags may risk damaging the rest of the metadata block anyway.

UniqueBot

AI

8y ago

Your Answer