Hi there,
I have a few hundred corrupt wedding images (Canon CR2) that I am desparatly trying to salvage .jpgs from.
I have ZERO experience with code. I'm looking for a super simple, step by step instruction list detailing how to extract a preview. Is there a way to do this for an entire folder of images? My images are stuck on an external Hard Drive ( they won't even be copied off of it to my desktop).
I will continue to search the forum for this and I apologize if this has been answered already.
many thanks...
Rob
PS, I am using the most recent version of Exiftool on a iMac with Lion ( I also have Snow Leopard on anther machine )
OK, Here's what I've tried so far:
With an un-corrupt Raw file on my HD:
I Opened Terminal and "Copy/Pasted" this directly:
"exiftool -PreviewImage -b /Users/robc/Pictures/Selects/IMG_2073.CR2 > /Users/robc/Pictures/jj/IMG_2073bb.jpg"
this worked! - I see a 2MB Preview where it should be.
Then ( from the folder of corrupted Raws on my external HD ) I try:
"exiftool -PreviewImage -b /Volumes/250\ G/jennyjosh/raw/IMG_0887.CR2 > /Users/robc/Pictures/jj/IMG_0887b.jpg"
An image does show up in the destination folder - but it is zero kb and I get this error msg in Terminal:
"Warning: [minor] Error reading PreviewImage from file - /Volumes/250 G/jennyjosh/raw/IMG_0882.CR2
Robs-MacBook-Pro:~ robc$"
any suggestions??
thx again
Hi Rob,
Attached is a script I have recently written to extract JPG preview images from corrupted files. It takes one or more file and/or directory names as arguments, and creates "FILE_preview.jpg" images in the same directory as the original files if successful.
This is a Perl script that relies on ExifTool being installed.
There are no guarantees, but maybe this will help you out.
Your command line may look like this (if you "cd" to the directory containing the extract_preview script):
./extract_preview /Volumes/250\ G/jennyjosh/raw/IMG_0887.CR2
or
./extract_preview /Volumes/250\ G/jennyjosh/raw
OPTIONS:
-r - recursively process sub-directories
-a - extract all embedded JPEG images (not just largest preview)
-o DIR - write output images to specified directory
Step-by-step intructions for running in Windows (https://exiftool.org/forum/index.php/topic,4611.msg21910.html#msg21910)
- Phil
Edit: 2013-10-16 Updated attachment to current version of extract_preview script
Edit: 2017-10-31 Set default Mac library directory to /usr/local/bin/lib
Edit: 2018-05-04 Documented script options
thanks you so much for replying so quickly.
not fully understanding what you mean by "(if you "cd" to the directory containing the extract_preview script)" ,
I pasted both lines of your code into Terminal and got this:
Robs-MacBook-Pro:~ robc$ ./extract_preview /Volumes/250\ G/jennyjosh/raw/IMG_0887.CR2
-bash: ./extract_preview: No such file or directory
Robs-MacBook-Pro:~ robc$
and
Robs-MacBook-Pro:~ robc$ ./extract_preview /Volumes/250\ G/jennyjosh/raw
-bash: ./extract_preview: No such file or directory
Robs-MacBook-Pro:~ robc$
does this mean my files are a lost cause - or did i do something wrong.
I assume that running the script on the whole folder should come up with at least one or two previews...
I'm also unsure where the preview file will be placed...
thx
Hi Rob,
Did you extract the "extract_preview" file from the .tar.gz archive? Assuming you did, and that it exists on your desktop, type these commands in a Terminal window:
cd ~/Desktop
./extract_preview /Volumes/250\ G/jennyjosh/raw/IMG_0887.CR2
- Phil
Hmmm. I just tested this and it doesn't work for some Canon models, although I can probably fix it so it does. What model is your camera?
Hey again,
I did not extract the "extract preview" - I have no idea how to do that actually : )
All have is the "ExifTool-8.93.dmg" which I installed - but I don't even know where on my machine it is installed.
Could you tell me how to to do that in layman's terms?
thanks again!
Hi Rob,
I have just fixed the script to work with all Canon models, and updated the attachment in my previous post to version 1.01. Please re-download the "extract.tar.gz" attachment in my previous post, then:
1) place "extract_preview.tar.gz" on your Desktop
2) double-click on "extract_preview.tar.gz" on your Desktop to unzip the "extract_preview" script.
3) Open a Terminal window and type these 2 commands (press the "return" key after each command):
cd ~/Desktop
./extract_preview /Volumes/250\ G/jennyjosh/raw/IMG_0887.CR2
- Phil
thx again for helping,
I ran the script for one image - and I got a 12KB preview (unusable - too bad). Any other ideas on how to get a bigger .jpg?
I tried running the script for the whole folder and nothing has come up, here is what terminal looks like:
Robs-MacBook-Pro:~ robc$ cd ~/Desktop
Robs-MacBook-Pro:Desktop robc$ ./extract_preview /Volumes/250\ G/jennyjosh/raw
[extract_preview version 1.01]
===== /Volumes/250 G/jennyjosh/raw/IMG_0882.CR2
Does that mean that it is hung up on one image "IMG_0882" is the first image in the folder.
anything else I can try?
thx again
I was wrong, it is doing a batch extract on all those files - but it is taking a looooooong time. It's done 12 previews in 4 hours.
The previews, unfortunately, are too small to be used - all around 12 kb.
Are they normally this small?
thx
Wow, that's slow. On my (really old) mac here, the script takes only about one second per file. Odd.
I can't tell you if the size is normal without knowing what model of camera you are using.
- Phil
hi again,
I shot met of these with Canon's 5D Mark II and Some with the Original 5D.
I'm on a brand new macbook Pro - my guess is that the files are so messed that it is causing things to go slow.
thx!
I'm not doing anything you couldn't do yourself, but I tried the script on a folder of good 5DmkII CR2 images and it extracted the 5616x3744 preview from each in about 0.7 seconds per file (1.83 GHz Intel Core Duo Mac Mini). It could be that a messed up file would slow down things, but it would have to contain a lot of things that looked like JPEG headers to do this.
- Phil
OK, good to know.
At this point I think the files are beyond repair.
many thanks for all your help!
Hola. I recently shot a baseball game and 300 of my pictures are corrupted. Since I was shooting in continuous I believe the camera was unable to properly save the images. I've tried extracting thumbnails with exiftool to no avail. Stating: unrecognized film format, or something like that. I've also had my school try, and they unsuccessful, something not finding the beginning or the end of the file. Anyways, this I beileve is the last stop before I say "screw it."
Send me an image and I'll take a look (my email is philharvey66 at gmail.com)
- Phil
what's that string:
/Volumes/250\
for?
do I change it based on how my iMac is setup?
Quote from: ralf11 on October 27, 2017, 05:45:48 PM
what's that string:
/Volumes/250\
for?
do I change it based on how my iMac is setup?
Short answer is yes.
/Volumes/250\ G/jennyjosh/raw is a path to a directory or file called raw.
The directory "250 G" has a space in it so to tell the operating system that there is a space in the name, you have to either surround it in inverted commas or escape the space with \. Otherwise the operating system will think the space is a delimiter between different elements of the command line.
You need your own path to whatever it is you want to access.