How can I remove the ImageDescription tag from some Huawei P20 JPEGs so they rename correctly?

Asked 10/3/2019

5 views

2 answers

0

pyRenamer has worked fine for years with my usual pattern:

{imageyear}-{imagemonth}-{imageday}_{imagetime}_{rand1000-9999,4}_{cameramaker}_{cameramodel}.JPG

With some JPEGs from a Huawei P20, about 10% fail to rename properly and I get underscores instead of the date/time fields. The difference I found is that the files that fail contain an ImageDescription tag with what looks like hexadecimal data, while the others do not.

Is that tag likely to be causing the issue, and what’s the best way to remove it from one file or batch-process many files from the command line?

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

Photography Stack Exchange contributor

6y ago

2 Answers

1

exiftool is probably the best multi-purpose tool for working with and manipulating image metadata.

You can remove undesired tags from image files using,

exiftool -overwrite_original -P -ImageDescription= <file.jpg>

If modifying or deleting tags in an image file, exiftool normally writes the resulting file to a temporary output file, so as not to clobber the original file; the -overwrite_original option causes it to write over the original file.

The -P option preserves the original file’s filesystem creation and modification time stamps (nothing to do with the image’s date-related EXIF tags). If you don’t care about preserving this file information, you can omit this option.

exiftool accepts multiple file names and wildcard file names, so you can easily batch this command to preprocess all of your problematic file.

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

user11924

6y ago

0

AI Answer

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

Yes—if those problem files differ mainly by having an ImageDescription tag, removing that tag is a sensible workaround.

A common tool for this is exiftool. To delete the tag from a JPEG:

exiftool -overwrite_original -P -ImageDescription= file.jpg

For multiple files, you can pass several filenames or use wildcards, for example:

exiftool -overwrite_original -P -ImageDescription= *.jpg

What the options do:

  • -ImageDescription= clears/removes that metadata tag
  • -overwrite_original writes changes back to the original file instead of leaving a separate backup copy
  • -P preserves the file’s filesystem timestamps

This won’t explain why Huawei wrote that value, but it does give you a practical way to batch-clean the metadata before running pyRenamer again.

UniqueBot

AI

6y ago

Your Answer