6

Since more then ten years I use exiftran to rotate images after getting them from the camera.

Is this step still needed today?

Don't browsers and other image apps rotate the image correctly without running exiftran on the files.

Background on exiftran (from the exiftran man page):

exiftran is a command line utility to transform digital image jpeg images. It can do lossless rotations like jpegtran, but unlike jpegtran it cares about the EXIF data: It can rotate images automatically by checking the exif orientation tag, it updates the exif information if needed (image dimension, orientation), it also rotates the exif thumbnail. It can process multiple images at once.

  • 1
    This will no doubt be a matter of opinion. I personally still experience occasional pain from discovering that the actual orientation of an image wasn't what it appeared to be, so I try to eliminate the discrepancy in my files as much as possible. – junkyardsparkle May 26 '15 at 20:32
  • most camera/software combinations will auto-rotate all the time. It depends on a few factors and there can be errors (e.g. the camera doesn't record the correct orientation on a particular shot.) – A.K. May 26 '15 at 22:44
  • 3
    @AKPhoto As far as I know, all cameras which auto rotate do so by setting a flag in the JPEG header indicating that the image is to be drawn in that rotation, rather than actually changing the pixels. It used to be very typical for viewing software to not know about or respect the rotation flag, so jpegtran and its derivatives can take this flag and actually (losslessly) rewrite the image so that it's oriented differently — making it appear in the correct orientation always. The question here is whether that's still needed, or if significant % of client software is now "smart enough" itself. – mattdm May 27 '15 at 1:15
4

Since more then ten years I use exiftran to rotate images after getting them from the camera. Is this step still needed today?

Yes.

Don't browsers and other image apps rotate the image correctly without running exiftran on the files.

No.


As stated by @junkyardsparkle:

I personally still experience occasional pain from discovering that the actual orientation of an image wasn't what it appeared to be, so I try to eliminate the discrepancy in my files as much as possible.

And noted by @AK:

There can be errors (e.g. the camera doesn't record the correct orientation on a particular shot.)

Also, often, images can become separated from their Exif data. Or images can be saved rotated, but the Exif not updated. Or multiple programs may treat the rotation flag differently resulting in different orientations being displayed.

The best way to minimize surprises and maximize interoperability is to use exiftran to rotate the images. It can be scripted to auto-rotate all files at import.

1

UPDATE: It looks like you don’t need anymore to physically rotate your pictures with Firefox/Opera/Chromium in Linux. For instance it did not work with Chromium Version 73.0 but it does with Chromium Version 83.0. I have reconsidered the scripts I use to put my pictures online and found that the reason why it didn’t work was a call to ImageMagick’s "mogrify -auto-orient" which I used to resize the original image for web usage. Now I call mogrify without this option and I have no problem in recent browsers, as long as the orientation provided by you camera is OK of course, which is usually the case. So normally you don’t need exiftran nor jpegtran nor exifautotran anymore. Period.

OBSOLETE: AFAIK image rotation is still needed in 2020 in browsers but jpegtran does the job quite as well as exiftran. jpegtran keeps all tags as long as the "-copy all" option is used, which is not brand new: it has been possible since version 6b of libjpeg, released 27 March 1998. If you always require tag/marker conservation, you can use an alias:

alias jpegtran='jpegtran -copy all'

You can also keep comments only using "jpegtran -copy comments". In place editing is not supported with jpegtran but of course this is a no-brainer as well. You can also use exifautotran which performs the automatic adjustment.

So IMHO you just don’t need to install exiftran, which is a separate program, and just use jpegtran, which is bundled with libjpeg.

P.S. It is not nice to spread misinformation to deprecate the competitors ;-)

  • 2
    Thank you for your answer. I asked this question some years ago. You said "P.S. It is not nice to spread misinformation to deprecate the competitors ;-)". Which text are you referring to? I will update it. – guettli Nov 30 '20 at 15:21
  • 2
    I don't understand the "misinformation" and "competitors" statement either. – xiota Nov 30 '20 at 16:43
  • Hi, The misinformation is in the provided "Background on exiftran", namely: "It [exiftran] can do lossless rotations like jpegtran, but unlike jpegtran it cares about the EXIF data". As I explained, jpegtran does care about EXIF data (at least since year 1998). – Alexandre Oberlin Nov 30 '20 at 20:43
  • That quoted text comes straight from the man page for exiftran. Example – scottbb Nov 30 '20 at 23:13
0

Not all of my cameras are happy with pictures rotated on the computer and refuse to display them at all or at least using the same way of displaying them that they'd do when presented with a changed rotation flag. So at least on the memory cards, any manipulation of rotation has to be done in-camera for best results, and that only affects the rotation flag rather than the data.

If viewing programs could be taught to do rotation for memory cards from a particular camera in a particular way (and for some cameras, only by meddling with the rotation flags), fixing rotation on the memory cards could be done on the computer rather than on the camera.

Most software I work with, in contrast, has no problems properly interpreting the rotation flags. So my take on using exiftran these days is that its use is downright detrimental, at least on the original media. Admittedly my cameras tend to be a lot older than the software on my computer: that may play into it.

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.