News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

Trying to help a friend... help! :/

Started by stefanomen, December 11, 2015, 12:40:02 AM

Previous topic - Next topic

stefanomen

Hi Phil,

A friend of mine is having a problem with some corrupt cr2 files... I've search everywhere I could to find a way to fix the problem but I'm running out of ressources and wondering if the files could even be repaired or if it is possible to extract a decent jpeg file form it.

The files can't be viewed in any imaging software, there is no visible previews but the size of the files are comparable to any other good files (22 mo).  So is there a way?

I tried dcraw to extract a jpg but it doesn't seam to work.

These are important images for my friend and I hope you'll be able to provide some help.

Thanks!

p.s.: You can download an image following this link since the size is to big for the attachment: http://www.stephane-lariviere.com/XMG_1521.zip

Phil Harvey

The file you posted contains a 5472x3648 preview that may be extracted with this script:  https://exiftool.org/forum/index.php/topic,4172.msg19805.html#msg19805

The file contains a CR2 image starting at offset 0x410000, so all of the metadata is there, and most of the raw image too probably.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

stefanomen

That is very good news! 

Thank you for the fast reply.

I read the thread about "exiftool for dummies".

I tried to install exiftool to run the script but it causes my computer to crash badly... :/  I'm on windows 10 so I'm wondering if it could be a compatible problem?

I've install the .extract preview (but it seems to be for MAC)

All the files (exiftool and .extractpreview) are in the folder containing the raw images.

Do I need to download active Pearl in order to use exiftool or can I use the windows cmd or Powershell?

From everything I tried so far I only received error messages or that the command line isn't valid.  etc...

Sorry to be a pain... this is all new to me and must admit a little overwhelming.  lol 

This is a lot of new informatiosn to absorbe to help a friend that isn't very much on the technical side. 

Phil Harvey

Right.  On Windows you need to install ActivePerl and download the full ExifTool distribution (the .tar.gz version).  With the ExifTool "lib" directory from the full distribution in the same place as the "extract_preview" script, you would use this command:

perl c:\path\to\extract_preview\extract_preview c:\path\to\corrupted\images\

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

stefanomen

All right... we're moving forward.  ;-)

I've installed both exiftool and ActivePer and everything seems to work ok.

Now, when I tried to write the code you showed I got a message telling me that the path could not be found.

Here is my code line:

C:\Users\Stéphane Larivière\exiftool>perl\extract_preview\extract_preview c:\User\Stéphane Larivière\poz\corrupted

Note that I can't take away this part: C:\Users\Stéphane Larivière\exiftool>

My corrupted  images  are in a folder and the application files in a other.

Suggestions?


Thanks so much.

Hayo Baan

Looks like you forgot a space after perl on the command. Also because your path contains spaces, you need to put quotes around it. The C:\Users\Stéphane Larivière\exiftool> part is Windows showing you your current directory.

In short, I think if you change your text to the following, it should work:
perl \extract_preview\extract_preview "c:\User\Stéphane Larivière\poz\corrupted"
Hayo Baan – Photography
Web: www.hayobaan.nl

stefanomen

Thanks Hayo! 

It actually worked better... at least I'm getting a new error message.  lol

It now tells me this: Can't open perl script "\extract_preview\extract_preview": No such file or directory

Hum... I did install Activeperl and I can open the software.

I do have the extract_preview folder (with the files) in my folder as well as perl files.

There is for sure something I'm not doing right, but what? 

Thanks again


Hayo Baan

Where did you put extract_preview? If in the same directory as exiftool, simply remove the \ in front of it.
Hayo Baan – Photography
Web: www.hayobaan.nl

stefanomen

Hi Hayo,

Yes extract_preview is in the exiftool folder.  Removing the \ worked!  :)

Now it processed but I received that message:

C:\Users\Stéphane Larivière\exiftool>perl extract_preview\extract_preview "c:\User\Stéphane Larivière\poz\corrupted\"
[extract_preview version 1.03]
===== c:\User\StÚphane LariviÞre\poz\corrupted\
Error opening file
----- Summary
    1 files not processed due to errors
    1 files processed
    0 previews created:
Done.


Does it means I could not retreive anything from any file or is there still something to expect?


Thanks,


Hayo Baan

How many files did you have in the folder? And actually when I look at the output of the command, it looks like it actually didn't like your directory name as it contains accented letters (Windows and international characters are not a nice combination as Windows doesn't follow the standard of UTF8 encoding, but uses its own). Instead of C:\... try this ..\poz..\corrupted\

Also, to test if it works for you at all, run it on the test file you gave here earlier. Phil got a preview from that one so that should work for you too.
Hayo Baan – Photography
Web: www.hayobaan.nl

stefanomen

The folder contains 201 files.  I will try to relocate the folder in order to link it to one without accents.  I did try to run  with a file but not the one a provided at first.  I will try that too.

Thanks

stefanomen

YYYYYYYYYYeeeeeeeSSS!  :)))

It seems to have worked! 

Now... I have this at the end en the srting: ===== c:\poz\corrupted/XMG_1642.CR2
===== c:\poz\corrupted/_MG_2950.CR2
Found JPEG (160x120 pixels, 11388 bytes at offset 44460)
Found JPEG (5616x3744 pixels, 1251176 bytes at offset 55848)
  --> saved 5616x3744 preview as c:\poz\corrupted/_MG_2950_preview.jpg
----- Summary
  202 files processed
  192 previews created:
       11 160x120
      180 5472x3648
        1 5616x3744
Done.

But I can't see any previews... they seems to have been saved in the same folder but I don't see them?!?

Any clue?


Thanks soooo much!

Phil Harvey

What is the output of the command in cmd.exe window?:

dir c:\poz\corrupted\*.jpg

It should list all .jpg images in that directory.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

stefanomen

I created a folder called "rescued" to receive the extract previews.

In my last attemp I tried this line:

C:\exiftool>perl extract_preview\extract_preview "c:\poz\corrupted\" dir "c:\poz\rescued\*.jpg"

[extract_preview version 1.03]
===== c:\poz\corrupted" dir c:\poz\rescued\*.jpg
Error opening file
----- Summary
    1 files not processed due to errors
    1 files processed
    0 previews created:

It does'nt process anything now.  What would be my mistake here?

Thanks

stefanomen

I also tried this line that looked to work but again it failed...

perl extract_preview\extract_preview "c:\poz\corrupted" dir>c:\poz\rescued\*.jpg

It processed the images and told me previews already exists.... but where???