Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I can't seem to have the autorotate feature to work. I added the autorotate effect to my image style but still the vertical images I upload are still showing in a wrong orientation. is there something else I should do.
I'm using version 7.x-1.x-dev
Comment | File | Size | Author |
---|---|---|---|
#2 | image_metadata.txt | 13.11 KB | chalee |
Comments
Comment #1
dman CreditAttribution: dman commentedIFF you have a camera that contains a positioning sensor (something internal that makes it know when it's being held sideways) THEN there is some metadata attached to the image that says "I took the picture like this but you are supposed to look at it like that"
It basically encodes the image upside-down (if that's how the camera was held) but also tells us that it was upside-down at the time.
imagecache_autorotate looks for that data and rotates the image to sit on the screen. If that data is there.
If you have a camera that didn't recode that data - then nothing is done.
Sorry, it doesn't do magic or image recognition for you.
If you have an image that you think DOES record that data but it's not being used - post a sample up here or run exiftool (or similar) over it to see what the metadata looks like.
Comment #2
chalee CreditAttribution: chalee commentedThanks for the quick response. Find attached output from exiftool I ran on one of the photos. Check and see if there isn't enough info for your module? I see some info on orientation in the output i.e (Orientation : Rotate 270 CW)
Comment #3
chalee CreditAttribution: chalee commentedApparently the autorotate feature is not working on my development server running Windows. When I upload the website to my hosting server which is linux based the autorotate works. The only problem on the hosting server is that the rotated images seem to have lost the aspect ratio. They appear stretched sideways.
FYI I'm applying the following effects in that order.
1. Autorotate
2. Scale width to 548px (allowing upscaling)
3. Overlay (watermark image)
Comment #4
fietserwinIs the exif extension enabled?
Currently, the code checks on image generation and writes to the watchdog. I think it should also check for the extension on effect creation, thus in the admin screen and log a proper message on the screen.
Regarding the stretched image, that is a bit strange, but must have to do with the dimensions callback of the autorotate effect not functioning properly.
Changing into a bug report for these 2 parts:
- warning on admin screen if exif extension is not enabled
- dimensions callback not working properly?
Comment #5
fietserwinComment #6
dman CreditAttribution: dman commentedInteresting and thanks for the troubleshooting you did for yourself. It's helpful - and of course hard for us to replicate. When it comes to available libraries/versions on the server etc.
It does sound like the dimensions are not updated (d7 has an annoying new callback for this that doesn't always fit too well in real-life cases) when the image finds itself needing to switch. So the system thinks it's the old dimensions even though we are clever enough to see that it should change.
Certainly needs looking at.
Comment #7
fietserwinAppears to already be fixed long time ago (I guess shortly after this issue was created). Marking it as fixed.