CR2 -> 16bit TIFF problem

Started by JimKarczewski, May 26, 2012, 03:49:20 AM

Previous topic - Next topic

JimKarczewski

System Type: Windows 7x64 Ultimate

Command Line Used: P:\>p:exiftool -TagsFromFile R:\2012\051912\051912-VUChappel\051912_0557.CR2 R:\2012\051912\051912-VUChappel\550.psd

Exiftool output (PSD):  1 image files updated
Exiftool output (TIFF): Warning: [minor] Entries in IFD0 were out of sequence. Fixed. - R:/2012/051912/051912-VUChappel/550.tif
    1 image files updated

I was playing with the new CS6 Lens correction feature and kept coming out with wavy lines instead of straight.  Little did I know, it was missing the lens info.  So, my friend told me about exiftool, I tried it.. the data somewhat showed up now in CS6 but still didn't work correctly.

So with one original test file I tried it with the original TIFF I was trying to use and it wouldn't do anything, not recognizing that the lens was in fact a Canon EF 16-35mm f/2.8L II, rather showing up in Photoshop as a Canon EF 16-35mm f/2.8L.    So I tried a PSD and it worked?   So then I decided I would report it as a bug, but before I did so I wanted to get all the possible exiftool output files I could to help in the debug process.   To my shock (and a little frustration) it didn't work on the new PSD or TIFF file.   Both show up as original 16-35's.  Oddly enough the file it worked  (and I know it worked because when you run the lens correction filter the file coming in looks "distorted" in a very distinct way) on the first PSD file I tried even though it's not showing it as a II, but somehow it recognizes it better.. I can't explain why.  So I'm attaching some data files....

RAW - Original CR2 output from the Canon 5D MkII from Exiftool
GoodPSD- The file that shows the correct "distortion" on running the  lens correction  filter even though it shows an original 16-35 at the bottom, not a II
BadPSD - My attempt to generate data for debugging that on loading into the lens correction filter doesn't distort properly nor am I allowed to correct the file like I am for GoodPSD
HDROutput - Output TIFF file from PhotoMatix which generated the HDR I'm trying to change the exif data on

I am beyond confused because it seems that the PSD files both indicate that the lens type is a II, however there must be some other EXIF field missing that is required by this filter in photoshop that isn't present in these files.  The one thing I do notice running diffchecker.com/diff on between the RAW.TXT and the GoodPSD is that the "Lens Model" is in a completely different location within the file.

Within the original CR2 EXIF the sequence is:
Flash Exposure Lock             : Off
Lens Model                      : EF16-35mm f/2.8L II USM
Internal Serial Number          :

While the output from ExifTool is:
Serial Number                   : 132080xxxx
Lens Model                      : EF16-35mm f/2.8L II USM
GPS Version ID                  : 2.2.0.0

Would that make a difference?  I don't know.. but it's driving me nuts not being able to figure this out (I'm an ex-coder myself, so as last resorts I do things like report bugs. :)

Hopefully something can be found wrong here.. or just tell me I'm insane, make it easy on me. LOL

JimKarczewski

#1
To give you an idea of what I mean about the filter "distortion" I've included what it looks like right from importing the CR2 file, the "Working" PSD file and the Non-Working PSD file.  Notice the lens type in the bottom left corner..  While the working PSD isn't distorted as much, the filter runs with no issues.  Where as if you try to straighten a line with the non-working PSD photoshop is unable to do so.

I did yet more debugging here...

I saved the 16bit PSD as a JPG, opened it and it came up as a 16-35II.. but the PSD only shows it as a V1 lens.
I did the same thing with the TIFF file and there was no change.   Even thought the EXIF in the TIFF shows V2 saving as a JPG did not work the same as it did with the PSD


So I guess for the near future the solution is to work on the PSD file after modifying with ExifTool and then saving as a JPG, reloading then correcting the lens distortion.   Just wish I could do it in the 16 bit world. :(

Phil Harvey

Hi Jim,

I'm not sure if I can help here because I don't know what metadata CS6 uses to determine the lens distortion parameters.

Also, I don't have a clear picture of the exact steps you have taken:

1) Exactly how did you generate the PSD and TIFF files?

2) Then I assume you ran ExifTool as indicated to copy the metadata from the CR2 to the PSD and TIFF?

3) But then what did you do differently between the good and bad PSD file?

If you want to email me the original CR2 (philharvey66 at gmail.com), I can try to reproduce exactly what you have done.

- 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 ($).

JimKarczewski

Phil-

   1. The original TIFF came from PhotoMatix Pro 4.1.4
   2. Correct.  I used ExifTool to copy the info over (and all I did to generate the PSD was open the TIFF and save as PSD)
   3. I have NO CLUE why one seems to work but one doesn't
   4. While mailing you the CR2 is fine, I don't think it would help, would it?  Because I'm using a TIFF from PhotoMatix.

Like I said, for now.. I found a work around, which is work on the PSD file and then save it as a JPG and then correct for lens distortion.   I will try a few other 16 bit formats later to see if any others work (like .HDR, .PSB) and see if  I can find one that makes it into the lens correction right.

In fact, I think, as a debugging measure (maybe tonight after I get back from shooting) I'll try this...   Process a RAW CR2 file, save as PSD then copy over the data with ExifTool and see what, if anything changes.... or doesn't change.

I know it's a weird problem, so I doubt many people will have the problem.  At least there is an eventual way around it.


Phil Harvey

Yes, having the original CR2 alone won't help.

These automated things are a real pain when they go wrong.  Can't you just select a lens profile manually in CS6?  It really should let you do this.  That could be another possible work-around.

- 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 ($).

JimKarczewski

Yeah.  I wish.  They don't let you select anything.  Maybe if Exif was completely empty it would?  Like no camera/No lens data.  Not sure.. I'll have to play with that and see.