coronatuss Posted June 23, 2020 Posted June 23, 2020 Hello everyone, Im developing an script to check the size of all .jpg stored in windows folder. The problem is that it doesn´t work properly with rotated images. With _GDIPlus_ImageGetWidth() and _GDIPlus_ImageGetHeight() I get the Width and Height of images as if they had not been rotated, and I need to know how they are rotated (orientation and grades). Any help is welcome! If more info is needed, please tell. 😁
Sidley Posted June 23, 2020 Posted June 23, 2020 This may be of some help:https://www.autoitscript.com/forum/topic/108578-getting-image-size/ Is this on Windows 7 or 8/10?
coronatuss Posted June 23, 2020 Author Posted June 23, 2020 Thanks Sidley, Is on Windows 10. I have tried what you have told me and the script does not return the orientation, although it does return other interesting properties. I'm still looking for the solution.
Sidley Posted June 24, 2020 Posted June 24, 2020 Apparently Windows 8/10 handles image rotation differently than previous versions, it makes use of the Exif orientation flag. It may be the case that the image dimensions are landscape, but the exif rotation is at say, 90 degrees. Therefore the image appears to be portrait, but the actual dimensions are still landscape. Then again, I could be talking out of my arse, maybe someone can confirm this? https://jdhao.github.io/2019/07/31/image_rotation_exif_info/ coronatuss 1
KaFu Posted June 24, 2020 Posted June 24, 2020 Here's some code I've ripped from my SMF program. Image_Get_Orientation.zip coronatuss 1 OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2025-May-18) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
coronatuss Posted June 24, 2020 Author Posted June 24, 2020 1 hour ago, Sidley said: Apparently Windows 8/10 handles image rotation differently than previous versions, it makes use of the Exif orientation flag. It may be the case that the image dimensions are landscape, but the exif rotation is at say, 90 degrees. Therefore the image appears to be portrait, but the actual dimensions are still landscape. Then again, I could be talking out of my arse, maybe someone can confirm this? https://jdhao.github.io/2019/07/31/image_rotation_exif_info/ Hi @Sidley, I think you are right. It is exactly what is happening to me. Even though the image is rotated, I always get the original dimensions, ignoring the current orientation. 29 minutes ago, KaFu said: Here's some code I've ripped from my SMF program. Image_Get_Orientation.zip 9.5 kB · 2 downloads Excellent @KaFu. With this we can obtain the current orientation of the images. I see that it doesn't work with all ".jpg". Much information is obtained from some images, but in other images the information is reduced, and the orientation may be missing. It should be a thing of every image. Thanks to both of you!! 😁
KaFu Posted June 24, 2020 Posted June 24, 2020 11 minutes ago, coronatuss said: I see that it doesn't work with all ".jpg". Much information is obtained from some images, but in other images the information is reduced, and the orientation may be missing. It should be a thing of every image. Are you sure that those images have EXIF information at all? No EXIF info will result in a blank return. OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2025-May-18) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
coronatuss Posted June 25, 2020 Author Posted June 25, 2020 On 6/24/2020 at 12:48 PM, KaFu said: Are you sure that those images have EXIF information at all? No EXIF info will result in a blank return. They have EXIF info, but "Orientation" is missing in some of the images.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now