ExifTool Forum

General => Other Discussion => Topic started by: ubacher on March 17, 2019, 04:10:12 PM

Title: How to fix a file giving "JPEG EOI marker not found" error
Post by: ubacher on March 17, 2019, 04:10:12 PM
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?
Title: Re: How to fix a file giving "JPEG EOI marker not found" error
Post by: StarGeek on March 17, 2019, 05:23:19 PM
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.
Title: Re: How to fix a file giving "JPEG EOI marker not found" error
Post by: Phil Harvey on March 17, 2019, 08:43:21 PM
I think StarGeek is right, but send me a sample and I'll take a look (phil at owl.phy.queensu.ca)

- Phil
Title: Re: How to fix a file giving "JPEG EOI marker not found" error
Post by: ubacher on March 18, 2019, 07:01:53 AM
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.
Title: Re: How to fix a file giving "JPEG EOI marker not found" error
Post by: Phil Harvey on March 18, 2019, 07:35:01 AM
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