ExifTool Forum

ExifTool => Newbies => Topic started by: stefanomen on December 11, 2015, 12:40:02 AM

Title: Trying to help a friend... help! :/
Post by: stefanomen on December 11, 2015, 12:40:02 AM
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
Title: Re: Trying to help a friend... help! :/
Post by: Phil Harvey on December 11, 2015, 07:45:40 AM
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
Title: Re: Trying to help a friend... help! :/
Post by: stefanomen on December 11, 2015, 01:27:06 PM
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. 
Title: Re: Trying to help a friend... help! :/
Post by: Phil Harvey on December 11, 2015, 01:32:47 PM
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
Title: Re: Trying to help a friend... help! :/
Post by: stefanomen on December 11, 2015, 04:34:46 PM
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.
Title: Re: Trying to help a friend... help! :/
Post by: Hayo Baan on December 12, 2015, 02:37:11 PM
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"
Title: Re: Trying to help a friend... help! :/
Post by: stefanomen on December 12, 2015, 03:23:41 PM
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

Title: Re: Trying to help a friend... help! :/
Post by: Hayo Baan on December 12, 2015, 04:55:43 PM
Where did you put extract_preview? If in the same directory as exiftool, simply remove the \ in front of it.
Title: Re: Trying to help a friend... help! :/
Post by: stefanomen on December 13, 2015, 12:13:21 AM
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,

Title: Re: Trying to help a friend... help! :/
Post by: Hayo Baan on December 13, 2015, 03:36:05 AM
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.
Title: Re: Trying to help a friend... help! :/
Post by: stefanomen on December 13, 2015, 09:06:54 AM
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
Title: Re: Trying to help a friend... help! :/
Post by: stefanomen on December 13, 2015, 09:19:20 AM
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!
Title: Re: Trying to help a friend... help! :/
Post by: Phil Harvey on December 13, 2015, 11:36:46 AM
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
Title: Re: Trying to help a friend... help! :/
Post by: stefanomen on December 13, 2015, 12:07:58 PM
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
Title: Re: Trying to help a friend... help! :/
Post by: stefanomen on December 13, 2015, 05:45:36 PM
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???


Title: Re: Trying to help a friend... help! :/
Post by: Hayo Baan on December 14, 2015, 01:16:48 AM
What is the exact output you get from Phil's dir command?
Title: Re: Trying to help a friend... help! :/
Post by: stefanomen on December 14, 2015, 07:30:55 AM
It actually tells me this:


C:\exiftool>dir c:\poz\corrupted\*.jpg
Le volume dans le lecteur C s'appelle OS
Le numéro de série du volume est 2484-EBDD

Répertoire de c:\poz\corrupted

Fichier introuvable

C:\exiftool>dir c:\poz\corrupted\XMG_1521.jpg
Le volume dans le lecteur C s'appelle OS
Le numéro de série du volume est 2484-EBDD

Répertoire de c:\poz\corrupted

Fichier introuvable

So I don't really know what else to answer. 

Thanks
Title: Re: Trying to help a friend... help! :/
Post by: Phil Harvey on December 14, 2015, 08:03:01 AM
OK, so there are no "jpg" images in c:\poz\corrupted.  This is odd.  Could they be hidden somehow?  I'm a bit at a loss.  I don't think the "dir" command lists hidden files, but exiftool would find them.  Here are a few things to try:

This command should list all recognized files in the directory, even if they are hidden:  exiftool -filename c:\poz\corrupted

Or, there is a -o option for the extract_preview script that allows you to specify a directory for the output preview images:

exiftool -o OUTDIR c:\poz\corrupted

But make sure that the output directory (OUTDIR) exists before you run the command.

- Phil
Title: Re: Trying to help a friend... help! :/
Post by: stefanomen on December 14, 2015, 08:39:37 AM
Good... at last I wasn't turning crazy... lol

I tried the new line.  Here is the result.  Did I forgot something?



C:\exiftool>perl extract_preview\extract_preview "c:\poz\corrupted" exiftool -o OUTDIR c:\poz\rescued
[extract_preview version 1.03]
===== c:\poz\corrupted/XMG_1442.CR2
Found JPEG (160x120 pixels, 10614 bytes at offset 18102444)
Error renaming to OUTDIR/XMG_1442_preview.jpg

The folder rescued does exist.

I will try to aim to one folder outside the poz folder to see...

Any clue?


Thanks
Title: Re: Trying to help a friend... help! :/
Post by: Phil Harvey on December 14, 2015, 08:44:07 AM
Change "OUTDIR" to the name of your output directory.  (ie. "c:\pos\previews")  But make sure the directory exists before running the command.

- Phil
Title: Re: Trying to help a friend... help! :/
Post by: stefanomen on December 14, 2015, 08:53:50 AM
Good good good... it seems thought. 

It ran the batch with that line: C:\exiftool>perl extract_preview\extract_preview "c:\poz\corrupted" exiftool -o  c:\poz\rescued



at the end it tells:
===== c:\poz\corrupted/XMG_1641.CR2
Found JPEG (160x120 pixels, 12821 bytes at offset 17676460)
Found JPEG (5472x3648 pixels, 2220105 bytes at offset 17689284)
  --> saved 5472x3648 preview as c:\poz\rescued/XMG_1641_preview.jpg
===== c:\poz\corrupted/XMG_1642.CR2
===== c:\poz\corrupted/XMG_1442.CR2.ep_tmp.jpg
Error opening file
===== exiftool
----- Summary
    1 files not processed due to errors
  202 files processed
  190 previews created:
       11 160x120
      179 5472x3648
Done.

But when I check into the folder... nothing appears.  Hum... ???  Magic?  lol
Title: Re: Trying to help a friend... help! :/
Post by: Phil Harvey on December 14, 2015, 09:07:06 AM
OK.  Same problem. :(

Also a new problem... there was a ".ep_tmp.jpg" file left around in the corrupted directory.  You should delete this.

How do you check the folder?  Try running "exiftool -filename c:\poz\rescued" and paste the output here.

Also, try re-running this command and paste its output too:  perl extract_preview\extract_preview -o c:\poz\rescued "c:\poz\corrupted"

And one more thing to try.  There is a very small chance that the backslashes are causing a problem, so try this:

perl extract_preview\extract_preview -o c:/poz/rescued "c:/poz/corrupted"

- Phil
Title: Re: Trying to help a friend... help! :/
Post by: stefanomen on December 14, 2015, 09:13:57 AM
Oooohh ok...

The first line didn't gave any output...

The second one ended with:

Found JPEG (160x120 pixels, 12821 bytes at offset 17676460)
Found JPEG (5472x3648 pixels, 2220105 bytes at offset 17689284)
===== c:\poz\corrupted/XMG_1642.CR2
===== exiftool
----- Summary
  201 files processed
  190 previews already existed
    0 previews created:
Done.


And the last one:

Found JPEG (160x120 pixels, 12821 bytes at offset 17676460)
Found JPEG (5472x3648 pixels, 2220105 bytes at offset 17689284)
===== c:/poz/corrupted/XMG_1642.CR2
----- Summary
  200 files processed
  190 previews already existed
    0 previews created:
Done.

Are we in the 5th dimension? 

thanks
Title: Re: Trying to help a friend... help! :/
Post by: Phil Harvey on December 14, 2015, 09:23:53 AM
Very very weird.

Can you search your system for one of the files, say "XMG_1641_preview.jpg"?

Also, why do some files start with "X" and some with "_" ?

- Phil
Title: Re: Trying to help a friend... help! :/
Post by: stefanomen on December 14, 2015, 11:50:53 AM
I did a search it found nothing... :-\

The X in XMG_ comes from the original files rescued from the SD card. 

Maybe I could try to rename the files to take away the X so it comes back to the normal spelling of the Canon files wich is MG_ ???



Title: Re: Trying to help a friend... help! :/
Post by: stefanomen on December 14, 2015, 11:57:12 AM
Oups sorry... it did found a file

It was placed in a folder called: VTRoot/Harddiskvolume2/poz/rescued



Title: Re: Trying to help a friend... help! :/
Post by: Phil Harvey on December 14, 2015, 11:58:49 AM
Quote from: stefanomen on December 14, 2015, 11:57:12 AM
It was placed in a folder called: Harddiskvolume2/poz/rescued

Odd.  But at least you now know where they went!  I'm guessing that this could be due to some funny way in which this hard disk partition is mounted.

- Phil
Title: Re: Trying to help a friend... help! :/
Post by: stefanomen on December 14, 2015, 04:53:57 PM
Thank you very much for your time and help both of you!   :D

I know a little better now.

Happy Holidays!