I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2009-02-22 19:24:56-08 by igor77 in response to 9830
Re: batch change previews in RAW-files
Hi!
Dear Bogdan!
You helped me clarify many things. Now I understand that many my questions above were stupid.
I suppose I've understood the main thing. If we use DPP as a main RAW-converter, the algorithm of change of embedded preview is more simple than I've thought.
As you've written, DPP uses CanonVRD section of CR2 file to orient image. But when CanonVRD:rotation tag is empty, DPP looks to the EXIF:orientation tag.
If in EXIF we have proper information - we have no need to rotate image and all is Ok. When we do write new recipe to the CR2 file, even if we do not rotate image, DPP writes "0" to CanonVRD:rotation (it is empty before saving recipe).
When we rotate image in DPP, it writes new value to this tag and in future DPP ignores EXIF:orientation.
I do not know about all users, but I think it is normal to rotate RAW correctly while processing in RAW converter. That's why we have properly oriented image in DPP. After converting we have JPEG which is the same oriented as CR2 in DPP (tags are different, of course).

Here is the main idea. If we do not rotate images after converting (I think it is natural - we have not to do it), orientations of JPEG and CR2 are equal. In all cases it is very simple to convert CR2 to JPEG in DPP and to change embedded preview in Exiftool at once.
That's why we do not need to think about JPEG orientation - we only need to do reverse rotation relatively CR2 rotation in DPP. We look to CanonVRD:rotation tag (not EXIF:orientation) in CR2 and rotate JPEG backwards.

I wrote earlier about my problem with GUI when I embed new previews in images, which were rotated in DPP. I solved this problem.
I've just synchronized CanonVRD:rotation tag with EXIF:orientation tag with the comands:
exiftool -s -n -if "$CanonVRD:rotation eq 0" -exif:orientation=1 *.cr2
exiftool -s -n -if "$CanonVRD:rotation eq 1" -exif:orientation=6 *.cr2
exiftool -s -n -if "$CanonVRD:rotation eq 2" -exif:orientation=3 *.cr2
exiftool -s -n -if "$CanonVRD:rotation eq 3" -exif:orientation=8 *.cr2
After this I have no problem to use GUI and different viewers. All of them shows CR2 images properly. When I embed previews in GUI, I use only automatic mode. I do not need to think about how I hold camera - right hand on top or left one. All works in automatic mode.
I might use Exiftool without GUI to whole process, but my knowledges are not enough to write all comands in command file. That's why I have to do two steps: execute .bat file and next use GUI.

Also I find the second problem.
In a CR2 file I find the second preview - very small thumbnail JPEG (160x120 pixel in Canon 400D) and some viewers use this preview while looking images as thumbnails. We can see this thumb in ThumbnailImage tag. This viewers are, for instance FastStone viewer 3.2. and Adobe Lightroom 2.0.
With Lightroom it is more interesting :) First it shows thumbnails, next it changes thumbs to resized JPEG previews (size like thumbs), and finaly it shows CR2 file (it takes more time). So we can see all three images in one CR2 :)
Thus, problem is that if we change preview, it will be correct to change thumbnails also. It is as oriented as embedded JPEG preview. So we can resize rotated JPEGs and embed they as thumbs. I do not know now how to realize this and if there are other tags linked with thumbs, but still.

Sorry for many characters - I'm not good in English. I hope, my ideas can be usefull.
Best wishes,
Igor.
Direct Responses: 10119 | Write a response