1

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
    imagej.nih.gov/ij – Count Iblis Aug 6 '17 at 15:42
  • 1
    @CountIblis care to expand? – osullic Aug 6 '17 at 21:29
  • 1
    By "physically", do you mean "losslessly"? Otherwise, turn your monitor sideways. – xiota Jun 10 '18 at 1:59
1

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).

  • 1
    For lossless JPEG rotation, consider jhead, jpegtran, or exiftran. – xiota Jun 10 '18 at 2:14
  • @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. – James Snell Jun 11 '18 at 14:47
8

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.

3
  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
    
  • 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? – Daniel Himmelstein Apr 4 at 23:14
2

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 3.4.4.1 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.

  • 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. – Przyczajona_Dzika_Świnia Aug 6 '17 at 19:39
  • 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... – Jere Kupari Aug 6 '17 at 20:22
  • 2
    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. – Zenit Aug 7 '17 at 8:42
  • I ment I dont want to resize photos once again. "First rotate, then resize" - genius! – Przyczajona_Dzika_Świnia Aug 7 '17 at 22:18
0

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.

  • 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. – Jere Kupari Aug 8 '17 at 7:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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