LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   Images shown rotated correctly in Gimp but not Chromium or Firefox (https://www.linuxquestions.org/questions/linux-desktop-74/images-shown-rotated-correctly-in-gimp-but-not-chromium-or-firefox-4175681529/)

Turbocapitalist 09-04-2020 04:54 AM

Images shown rotated correctly in Gimp but not Chromium or Firefox
 
I have a bunch of thumbnail images created from images taken with a digital camera, most are in landscape orientation but some are in portrait orientation. Since this spring, both Firefox and Chromium fail to show the portrait mode images correctly and instead smushes them into landscape mode thus with severe distortions.

Each thumbnail was created by convert from ImageMagick. The portrait mode images get rotated clockwise or counterclockwise:

Code:

convert "$jpeg" -rotate -90 -resize x256 "t_$jpeg";
Maybe that is where the error lies, but Gimp shows these generated, portait mode thumbnails in correct orientation so I am at a loss as to what to modify so that Chromium and Firefox will show them correctly. Is there a way to do that without having to regenerate each and every thumbnail?

Guttorm 09-04-2020 07:43 AM

Hi

Pictures with rotation from the gravity sensors are confusing. Some respect the rotation, others ignore it.

Jhead is a good tool for fixing it. Usually this fixes everything:

jhead -autorot *.jpg

From "man jhead":

Quote:

-autorot
Using the 'Orientation' tag of the Exif header, rotate the image so that it is upright. The program jpegtran is used to perform the rotation. This program is present in most Linux distributions. For windows, you
need to get a copy of it. After rotation, the orientation tag of the Exif header is set to '1' (normal orientation). The thumbnail is also rotated. Other fields of the Exif header, including dimensions are un‐
touched, but the JPEG height/width are adjusted. This feature is especially useful with newer Canon cameras, that set the orientation tag automatically using a gravity sensor.

-norot Clears the rotation field in the Exif header without altering the image. Useful if the images were previously rotated without clearing the Exif rotation tag, as some image browsers will auto rotate images when the
rotation tag is set. Sometimes, thumbnails and rotation tags can get very out of sync from manipulation with various tools. To reset it all use -norot with -rgt to clear this out.

ondoho 09-05-2020 06:49 AM

There seems to be some confusion between physical rotation of the image (i.e. changing the jpg data) and exif rotation (just add a tag that says "rotated").
I suspect GIMP is more interested in the physical rotation.
What I'd do:
- remove exif info
- see how images are rotated now. It should be identical between GIMP/browser.
- if need be, physically rotate images


All times are GMT -5. The time now is 10:36 PM.