TransWikia.com

ExifTool does not extract corrupted EXIF metadata from jpeg file. How to repair it?

Photography Asked by ramo on July 7, 2021

The image viewer nomacs offers a quick way to add image notes via Exif.Image.ImageDescription metadata.

After having edited the form for my-image.jpg, I can see this property in nomacs and Thunar (Linux Xfce file explorer).

But exiftool will not show it:

exiftool my-image.jpg

The following has also been tried after having read this post:

exiftool -EXIF:ImageDescription my-image.jpg
exiftool -Exif:ImageDescription my-image.jpg

I need a way to process the image notes via CLI and would like to use exiftool for this purpose. Hence: what have I missed?

2 Answers

Based on the discussion in comments seems like metadata of this image file is corrupted. What you can do is to cleanup the metadata and try again:

exiftool -all= path_to_file

Be aware this will remove all the metadata from the file. If you want to remove only particular metadata you can use command like:

exiftool -EXIF:ImageDescription= path_to_file

To get the exact name you can use command:

exiftool -a path_to_file

Correct answer by Romeo Ninov on July 7, 2021

(In addition to Romeo Ninov's great answer)

There is an Exiftool FAQ alternative, that tries to repair JPEG file-metadata and preserve existing tags:

exiftool -all= -tagsfromfile @ -all:all -unsafe -icc_profile my-image.jpg

ExifTool may be used to fix metadata problems in JPEG images by deleting all metadata and rebuilding it from scratch. [...]

This command deletes all metadata then copies all writable tags that can be extracted from the original image to the same locations in the updated image. The "Unsafe" tag is a shortcut for unsafe EXIF tags in JPEG images which are not normally copied. JPEG images may also contain an ICC color profile which should be preserved. The "ICC_Profile" tag is also marked as unsafe, but is not part of the EXIF so it isn't covered by the "Unsafe" shortcut and must be specified separately.

After repairing an image like this you should be able to write to it without errors, but note that some metadata from the original image may have been lost in the process.

Note: ExifTool will not modify the JPEG image data, so if the image itself is corrupted (eg. if you get a message saying "Not a valid JPEG"), then ExifTool can not be used to repair the image. Also, ExifTool may not be used like this to repair TIFF-based files or RAW files -- the risk of image corruption is too great because the image is stored in the same IFD as the metadata in these files.

Answered by ramo on July 7, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP