Author Topic: How to fix a file giving "JPEG EOI marker not found" error  (Read 229 times)

ubacher

  • Newbie
  • *
  • Posts: 5
How to fix a file giving "JPEG EOI marker not found" error
« 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?

StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 2365
Re: How to fix a file giving "JPEG EOI marker not found" error
« Reply #1 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.
Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14405
    • ExifTool Home Page
Re: How to fix a file giving "JPEG EOI marker not found" error
« Reply #2 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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

ubacher

  • Newbie
  • *
  • Posts: 5
Re: How to fix a file giving "JPEG EOI marker not found" error
« Reply #3 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.

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14405
    • ExifTool Home Page
Re: How to fix a file giving "JPEG EOI marker not found" error
« Reply #4 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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).