Hello. I have several thousand scanned images of historical value. I try to change the EXIF but all I get is this:
Error: Format error in file - bad.jpg
0 image files updated
1 files weren't updated due to errors
What is wrong and how to fix it?
This sounds like a problem with the JPEG image itself, rather than a problem with the metadata. If you send a sample to me (philharvey66 at gmail.com) I can give you a more informed answer.
- Phil
Thanks for the sample. This is very interesting. The problem is that the file is not a JPEG image. Change the extension from JPG to TIF and all is well.
But I am surprised because exiftool should have recognized this as a TIF. I'll look into this in more detail and figure out what is happening and post back here.
- Phil
I checked the code. When reading, ExifTool will properly detect the file type, but when writing ExifTool currently uses the file extension as a sanity check to provide a tighter validation of the file format. I don't want to relax this because it is safer this way, but I will change the error message to make this more obvious. The next version will give this error when you try to rewrite your image:
Error: Not a JPEG file (looks more like a TIFF) - image.jpg
- Phil
Thank you, that will help.
Dear Mr Phil,
I have a same CR2 error. I deleted my file, and after that I recoveried this file. Howerver, when I recoveried, my file can't be read. When I use Exiftool, this program report: File format error. Please tell me some tips, my files are very important to me!
File download: https://drive.google.com/file/d/0B5ipW1w36t93VXctMmlJbW96dGc/view?usp=sharing (https://drive.google.com/file/d/0B5ipW1w36t93VXctMmlJbW96dGc/view?usp=sharing)
Many thanks,
I'll be able to download the file on monday, so I'll take a look at it then.
- Phil
Thanks Phil very much!
This file contains valid data from a Canon CR2 image starting at offset 0x558000 in the file. Unfortunately, the raw image data is truncated, but the 5760x3840 JPG preview is intact. You can use my extract_preview script (see this post (https://exiftool.org/forum/index.php/topic,4172.msg19805.html#msg19805)) to extract this preview image.
- Phil