I was using gThumb version 3.2.7 for some time and I was particularly happy with option "Rotate Image Physically". Because I don't want to rely on EXIF photo rotation data.

Recently I bought better camera and I have bigger pictures. Now, when I try to use the physical rotation option, I'm getting error: "Error interpreting JPEG image Maximum supported image dimension is 65500 pixels".

Photo is 2150 x 3226 pixels. By the way it looks like mistake, previously I rotated images successfuly and they had 2304x1728=3981312 pixels. However, I don't want to resize it.

Is this corrected in later releases of gThumb?

Recently I installed latest Linux Mint on my laptop and I found I have gThumb 3.4.3 there. I wanted to test the rotation with this version, but I was supprised I can't find such option there.

Can I rotate physically my bigger photos with latest version of gThumb? If not, do you know other Linux software which can do this?

  • 1
    \$\begingroup\$ imagej.nih.gov/ij \$\endgroup\$ Commented Aug 6, 2017 at 15:42
  • 1
    \$\begingroup\$ @CountIblis care to expand? \$\endgroup\$
    – osullic
    Commented Aug 6, 2017 at 21:29
  • 1
    \$\begingroup\$ By "physically", do you mean "losslessly"? Otherwise, turn your monitor sideways. \$\endgroup\$
    – xiota
    Commented Jun 10, 2018 at 1:59

5 Answers 5


In current Linux Mint you should have had Image Magick installed.

Use the -auto-orient option.

convert -auto-orient source.jpg target.jpg

Note: This operation isn't lossless but you can combine it with other conversion options like -resize (if you do them).

  • 3
    \$\begingroup\$ For lossless JPEG rotation, consider jhead, jpegtran, or exiftran. \$\endgroup\$
    – xiota
    Commented Jun 10, 2018 at 2:14
  • \$\begingroup\$ @xiota - even then, lossless rotation depends on which of the jpeg encoding schemes are in use and what the image size is. Not all can be rotated losslessly. \$\endgroup\$ Commented Jun 11, 2018 at 14:47

You can use cross-platform open source software jhead, with the options

jhead -autorot *.jpg

Which losslessly rotates the images based on the embedded rotation flag (and removes that flag, of course.

  • \$\begingroup\$ Thank you for this valuable program. I didn't know it. \$\endgroup\$ Commented Aug 7, 2017 at 22:24
  • \$\begingroup\$ according to doc, jhead can "Up-right images according to rotation tag using jpegtran", so lossless. Seems perfect \$\endgroup\$
    – Setop
    Commented Mar 13 at 10:45
  • \$\begingroup\$ @Setop It really is. Does a few very simple things, and that's it. It's been part of my "copy images from memory cards" script for about 20 years now. :) \$\endgroup\$
    – mattdm
    Commented Mar 13 at 14:07
  1. The command line program jpegtran can losslessly rotate JPEGs on Linux. From the command line:

    jpegtran -rotate 90 MyJpeg.jpg > MyJpegRotated.jpg

    If you don't have jpegtran program installed, you can install it in Ubuntu with:

    sudo aptitude install libjpeg-progs
  2. A similar tool is exiftran, which can determine orientation from the EXIF tags:

    exiftran -a -p -o MyJpegRotated.jpg MyJpeg.jpg

    To install in Ubuntu:

    sudo aptitude install exiftran
  • \$\begingroup\$ So jpegtran doesn't preserve exif metadata and does not automatically recognize the proper orientation from exif? If so, it sounds like exiftran is superior? \$\endgroup\$ Commented Apr 4, 2019 at 23:14

The reason for the error is probably that the photo dimensions (2150, 3226) are not multiples of 8. Then a jpeg photo cannot be rotated totally lossless.

Why it's complaining about the 65500 pixels is probably just a bug.

What camera saves such dimensions, usually they always do 8x8 blocks?

I have gThumb on Ubuntu 17.04, and there is a rotate physically option when in the thumbnail view, and in the image view there are buttons that rotate losslessly (in the toolbar), but they were working a bit flaky when I just tried them on a non 8x8 photo.

  • \$\begingroup\$ Camera is saving photos 4608x3072, but I'm scaling it by 70%. It seems I should give specific dimensions insted of percentage, when I reduce size of photos. Dimensions divisible by 8. \$\endgroup\$ Commented Aug 6, 2017 at 19:39
  • \$\begingroup\$ Yes, or scale by 75 %, it seems to work in this case. Although you would get more magical scaling at 50 %, but is the result then too small... \$\endgroup\$ Commented Aug 6, 2017 at 20:22
  • 2
    \$\begingroup\$ First rotate, then resize. But I still don't understand it: you say that you don't want to resize photos and the it comes out then you do resize them. \$\endgroup\$
    – Zenit
    Commented Aug 7, 2017 at 8:42
  • \$\begingroup\$ I ment I dont want to resize photos once again. "First rotate, then resize" - genius! \$\endgroup\$ Commented Aug 7, 2017 at 22:18

On Linux the (free) options include :

  • GIMP (should be installed by default on most mainstream distros)
  • LightZone
  • DarkTable
  • ImageMagick (command line based but like a swiss army knife for image processing).

On Linux Mint the default image viewer can typically open the image you are viewing in any of the available desktop graphics applications it is aware of.

If you install GIMP add the G'MIC plugin to it as it has a lot of useful tools.

Note that in GIMP to save an image I'd suggest using "Export" as this saves a new file.

  • 1
    \$\begingroup\$ This looks like it doesn't address the original question, but the non-destructive workflow apps like LightZone and Darktable do save the image physically rotated. If you always save from the app, it's lossily saved only once, and is as little lossy as any other option. \$\endgroup\$ Commented Aug 8, 2017 at 7:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.