How to fix a file giving "JPEG EOI marker not found" error

Started by ubacher, March 17, 2019, 04:10:12 PM

Previous topic - Next topic

ubacher

My Samsung S8 phone produces jpg files (in panorama mode) which are (often) missing the EOI marker and thus
get rejected by Exiftool for writing.

I can open the files in Irfanview (or photoshop) and write them out again to fix the problem.

My question: would there be a way to get exiftool to fix the files for me?

StarGeek

Phil will have to answer definitively, but my guess would be that since this is part of the image data, exiftool wouldn't be able to fix this.

I would suggest rather than re-writing the image (loading/saving), download the irfanview plugins and use the lossless jpeg rotation.  You can set it to Transformation: None, Perfect Transformation, and Optimize.  You should get a fixed image that is exactly the same graphically (no introduction of compression artifacts) and may even have slightly smaller file size.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Phil Harvey

I think StarGeek is right, but send me a sample and I'll take a look (philharvey66 at gmail.com)

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

ubacher

I mailed Phil a sample file.

I can fix the file by opening it with Irfanview and the saving it again.
Since I use Exiftool within the Imatch db it would be easier fixing it via exiftool.

Phil Harvey

I just wanted to make sure there was in fact something wrong with the image data, and there is.

ExifTool doesn't mess around with the image data, so unfortunately it can't help in this situation.

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