Hi
@Nixversteher
I agree that it would be simpler if the orientation was given as an integer between 1 & 8
However, I used the file's extended properties to do this and the EXIF data for orientation is changed to a text value....
NOTE: I use extended properties as my app is designed to work with a variety of images...not just JPG/JPEG
Here are some test photos I created using the letter F:
The original photo is the one named WIN_....
I used a modified version of your code to change the EXIF orientation (but didn't rotate or flip the images as well).
So F1 has orientation 1, F2 is orientation 2 etc
This is how the orientation of the 8 images were reported in my app:
I believe
@arnelgp is probably correct when he stated that whilst the code changes the EXIF value, it doesn't physically alter the image rotation.
For that reason, the images aren't 'helpfully' rotated by File Explorer.
If the files were physically rotated by just modifying the EXIF value, all would appear as
F in Explorer.
To complete the process would require using WIA to rotate/flip in addition to changing the EXIF orientation.
Does that make sense?
I'm fully aware that there is no need to save the images. It was done purely for the OP...
Version 3.2 just rotates the images...and I used WIA for that purpose.
However the OP stated he wanted the images SAVED with the EXIF set to 1 (Normal)
That was why I added that feature as an option in version 3.3 though the OP didn't refer to what I'd done!
Hope that clarifies things for you
Anyway, now I know all the orientation descriptions from 1-8, I'm going to do one further update to include handling all flipped images then upload it as an update to my sample databases thread
Folder Image Viewer | Access World Forums (access-programmers.co.uk).
I will post an update here when its ready.
@arnelgp
For info
When modifying images e.g. cropping in Snip & Sketch etc, EXIF data for the camera IS removed
However, changing the EXIF orientation using this code does NOT strip out any of the other EXIF values