cgsecurity / testdisk

TestDisk & PhotoRec
https://www.cgsecurity.org/
GNU General Public License v2.0
1.58k stars 195 forks source link

NEF file support (RAW format) #55

Closed OutsourcedGuru closed 5 years ago

OutsourcedGuru commented 5 years ago

The Nikon SLR cameras have an NEF format file type. Is there any chance that you could add support for these files?

Thanks in advance

cgsecurity commented 5 years ago

Have you tried PhotoRec 7.1-WIP ? NEF is part of the TIFF file family. It should already be recovered.

OutsourcedGuru commented 5 years ago

Actually, yes. I downloaded and ran this exact version against a 32GB SD my girlfriend had formatted after uploading to her MacBook... and within the week her MacBook crashed. So I'm now trying to recover perhaps 600 NEF files from our Yosemite trip. The MacBook is at Apple getting a new motherboard.

PhotoRec ran through the scan, taking perhaps forty minutes. It successfully resurrected four .MOV files and a few hundred .tif files which appear to be the thumbnails (only). What's odd is that the file sizes for these "thumbnails" is around 30MB each which makes me think that all the data is there.

Renaming one of the files with an .nef extension doesn't seem to work: Gimp will bring it in, complain about an unexpected field and show it as a thumbnail graphic.


I tried perhaps four of the "free" software programs out there which turned out to be teaser-ware. They wanted to be upgraded before offering any actual files from the restoral. And yet, one of them indicated that there was a subdirectory which included .jpg files on the card, something that yours didn't find. In that case, their preview indicated that those were the thumbnails and the NEF files in another subfolder were the big ones.

Any thoughts?

OutsourcedGuru commented 5 years ago

screen shot 2018-09-24 at 8 35 39 am

I did this before... screen shot 2018-09-24 at 8 36 23 am

But I'll try this one this time... screen shot 2018-09-24 at 8 37 01 am

Then this... screen shot 2018-09-24 at 8 37 29 am

And this... screen shot 2018-09-24 at 8 38 14 am

...and I'll let it run.


So far, it appears to be doing the same as last time. It's bringing back the four movies, a couple of unusable .gz files and a few hundred large .tif files that show up as thumbnail-sized photos. I anticipate the same result but I'll let it run.

screen shot 2018-09-24 at 8 41 10 am

OutsourcedGuru commented 5 years ago

Here's an example of one of the .tif files that was resurrected, noting that she shoots in the raw (NEF) format on her Nikon D750.

Link to Google Drive

Strangely enough, when I attempt to preview it in Google Drive, the size is much larger. It's likely that there are more than one resolution of the image embedded in the file and that the default version isn't set right.

Are you sure that this version of PhotoRec does NEF? I've reviewed the code and it doesn't appear to be there.

OutsourcedGuru commented 5 years ago

I'm now bringing the .tif file into Adobe Photoshop Elements using the "Open in Camera Raw" feature but at Zoom = 100% it definitely thinks this is a thumbnail.

OutsourcedGuru commented 5 years ago

Alright, I think I have a solution here.

screen shot 2018-09-24 at 9 12 42 am

screen shot 2018-09-24 at 9 15 32 am

This is probably the best that she could hope for. As a photographer, she's like the control that raw would have given her but this is a working compromise. I guess I'm good here. Thanks.

cgsecurity commented 5 years ago

Do you get better results if you rename the recovered .tif as .nef ? Can you share an unmodified nef file (not a recovered one) taken with this camera ?

OutsourcedGuru commented 5 years ago

Actually, I renamed all of the .tif files in place and Nikon's ViewNX-I program had no problems whatsoever with them. All the EXIF data is there, it has the full 6Kx4K resolution and has the embedded thumbnails available.

My guess is that Nikon is repurposing the TIF standard, renaming it NEF for their own use.

Try this link, it should include two new files. Her D750 was in NEF mode; my D3200 was in JPG.

153957 commented 5 years ago

@cgsecurity If you still required NEF samples, or RAW samples from other cameras, check out this site for a nice collection: https://raw.pixls.us/#repo