PhotoRec truncates JPGs from Olympus camera

Using PhotoRec to recover lost data
Post Reply
Message
Author
RfMw
Posts: 1
Joined: 14 Sep 2014, 19:49

PhotoRec truncates JPGs from Olympus camera

#1 Post by RfMw » 14 Sep 2014, 21:07

About a month ago over 100 pictures disappeared from a SD card. I tried to get them back using selfmade scripts and such. It took me several evenings, but in the end I had my pictures back and I learned a lot on the way.

A few days ago I heard about PhotoRec. To see whether it might be helpful in future cases of data loss, I tried it on the SD card image (dd-format) of previous month.
PhotoRec could recover the JPGs and ORFs, however the JPGs recovered by PhotoRec are shorter than the originals (by about 1/2 MBytes). They can be displayed without errors, though.

What seems to happen is as follows:
Some cameras append a preview image (larger than the EXIF thumbnail) at the end of the JPG file (behind the EOI).
Some cameras use the multi picture file format for this, e.g. the Panasonic GH1. PhotoRec knows this file format and recovers such JPGs as .mpo including the preview image.
Some other cameras, e.g. Olympus OM-D E-M1, use a non-standard way and record the presence and position of the preview image only in the maker notes (within the EXIF header). PhotoRec doesn't seem to know about this and thus truncates the JPG file after the first EOI, cutting off the preview image.

It's debatable whether this truncation is harmful (probably only Olympus cameras can make use of the preview image anyway). But if you would like to amend PhotoRec such that it can handle these JPGs correctly:
  • I could provide you with some sample JPGs, if you tell me how I can transfer a few files of 5 MB+ to you.
  • Exiftool can extract PreviewImageStart and PreviewImageLength, so it might be helpful to have a look at Exiftool and how it finds out these values.
Unfortunately I'm not a C programmer, so I can't provide code.
I don't know whether other cameras (Canon, Nikon, Pentax, Sony, ...) also append preview images and, if so, how they make its presence known.

Cheers
Rf Mw

Sponsored links

User avatar
cgrenier
Site Admin
Posts: 3561
Joined: 18 Feb 2012, 15:08
Location: Le Perreux Sur Marne, France
Contact:

Re: PhotoRec truncates JPGs from Olympus camera

#2 Post by cgrenier » 15 Sep 2014, 20:43

Can you email me some unmodified jpg from your Olympus camera ?

User avatar
cgrenier
Site Admin
Posts: 3561
Joined: 18 Feb 2012, 15:08
Location: Le Perreux Sur Marne, France
Contact:

Re: PhotoRec truncates JPGs from Olympus camera

#3 Post by cgrenier » 17 Sep 2014, 07:28

I confirm the problem: PhotoRec actually discards the PreviewImage at the end of the file. I will try to work on it.

User avatar
cgrenier
Site Admin
Posts: 3561
Joined: 18 Feb 2012, 15:08
Location: Le Perreux Sur Marne, France
Contact:

Re: PhotoRec truncates JPGs from Olympus camera

#4 Post by cgrenier » 04 Oct 2014, 20:24

For information, latest PhotoRec 7.0-WIP should recover the PreviewImage as a separated jpg instead of discarding it completely.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest