Of course I didn't give up :-) I try to keep only CR2 files on PC and to refuse keeping JPEGs. It will be like DNG file. Because I mostly use DPP to convert CR2, and I use different programs for viewing, cataloging etc., I try to look on CR2 and JPEGs like DPP looks, and I try to make other applications to do the same. That's why I use CanonVRD tags as paramount, and even copy them to the exif. I've allready sent message to Canon with the offer to introduce this function to DPP.
About slow processing - I think it is not a problem, because this option is not a part of quick workflow. By the way, converting CR2 to JPG is not fast too. As for me after processing in DPP I can start converting and do other work. The same way after receiving JPEGs I can start embedding and drink some coffee ;-)
About thumbnails: Abobe Lightroom can see thumbnails. I've allready written, that at first LR 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. I'll have look on IrfanView. Nevertheless I suppose if we change preview it must be universal CR2 file.
I didn't think about metadata incide JPEGs I wish to embed. To be honest, I didn't know that Exiftool embed JPEGs with whole metadata. I'll think about it. May be it is not so bad. Otherwise in future we must copy exif to extracted from CR2 JPEGs. On the other hand, it is superfluous data...
I have not possibility to check your variant with batch file now - I'll do it at weekends. I see only one place where endless loop may take place. It is "for" operation. In other places cycles are generated by Exiftool. And the cause may be only in syntax or logic. I'll have a look.
But still... Lets look by steps your example.
A) We have two images:
- 1.CR2 - horizontal - EXIF:rotation=1
- 2.CR2 - vertical - EXIF:rotation=8 or 6, or 1 (if camera do not write orientation to EXIF)
B) We rotate them in DPP 90 degree CW. We have:
- 1.CR2 - now vertical in DPP - EXIF:orientation=1, CanonVRD:rotation=1
- 2.CR2 - now horizontal in DPP - EXIF:orientation=8 or 6, or 1, CanonVRD:rotation=0, or 2, or 1 accordingly.
C) After converting we have:
- 1.jpg - vertical
- 2.jpg - gorizontal
D) Now what will you do next? I try to understand your logic to check and correct mine.
IMO the goal is to embed JPEG acordingly to RAW-data. Not only to see in a viewer the same look as in the DPP. If we do not change EXIF in compliance with CanonVRD, Faststone does not have to show the same picture. It must show the same aligned picture as it was before change preview.
I understand that we can have a bit different approaches - that's why your logic is important for me.