[Solved] Rotated Images
# help-with-umbraco
c
Umb 10.7 + Slimsy 4.1.0 Client reported a couple of images rotated. I didn't believe them, but I do now! Images in question are .jpg's that appear correctly in the Media section. When rendered out, one is rotated 90º ACW, another is rotated 180º while others aren't rotated at all. Further investigation appears to show that if you remove the "format" part of the URL then the images are not rotated. So, an image with a url of: media/owxhwaag/img_2090.jpg?rxy=0.5018751218320042,0.21335940197299258&width=800&height=600&format=webp&quality=70&rnd=133433141853500000 might be rotated, whereas media/owxhwaag/img_2090.jpg?rxy=0.5018751218320042,0.21335940197299258&width=800&height=600&quality=70&rnd=133433141853500000 is not. It's also the same if the format parameter is png as well, same result. For now, I'm going to have to let less performant images through 😦 I have requested the client send me the original images so I can check the EXIF data in case that, or the stripping of it, is the culprit. My question is, where is this happening, is it Slimsy or is it ImageSharp? Happy to put an issue in to either once I'm more confident of the likely area of responsibility.
d
This is most likely an ImageSharp thing. Afaik, slimsy only generates media URLs, ImageSharp responsible for the actual image manipulation
m
I had this issue a while back.. for me the issue was EXIF data was to blame, the core crop processor ignores EXIF data, where as rendering in the backoffice the browser accepts EXIF data. 😦 Also causes issues with crops and bounds as imagesharp gets confused re is this a landscape or portrait image I'm cropping.
d
@Mike Chambers is correct, the exif data can contradict the data in the back office. We show clients how to rotate images correctly but I think @aultako has also found some workarounds with imagesharp
c
Had similar EXIF issues in the past going back to V7. A very "dirty but simple" workaround I've had in the past is to load the images in something simple like GIMP/Paint/Paint3d, resave them and upload them again. Thinking back, always used to be with old Iphone pictures (from like Iphone 7 and backwards)
c
Wierd that after having produced many web sites over 2 decades I've never come across this before. Reading the linked issues, it appears to me that we need to give editors what they expect, i.e. if they see an image on a phone or some desktop viewer of a certain orientation, then that orientation must be maintained right through the process of getting the image to the user of the web site. Even if the CMS has to jump through some hoops on the way.
d
There is config in Imagesharp called something like honour exif. Sorry, one you will have to look for.
c
I just fixed it with the last bit of code on this issue:- https://github.com/umbraco/Umbraco-CMS/issues/2974
Really, this should be in the CMS I think. I'm going to have to consider adding it to all my projects if odd rotations can appear, seemingly at random.
10 Views