0

This question is an exact duplicate of:

I am trying to have some stability in image orientations but they differ in Debian image viewer/LaTeX and with image viewers. I do but it does not have an effect on the orientation of wrongly positioned images; manually adjusting it with -Orientation=[1234] does not help

exiftool -Orientation=1 -n *.jpg

Fig. 1 Output where the same image is opened in image viewer (Shotwell, ...) and Debian Space review (same output in LaTeX)

enter image description here

I thought first that the image orientation was the mistake but it is not because doing convert masi.jpg -rotate 90 masi-rotated.jpg keeps also the relative difference the same.

Exif info

Wrongly positioned image, having the 90 degree or its multiples in orientation

$ exiftool 28.jpg 
ExifTool Version Number         : 9.74
File Name                       : 28.jpg
Directory                       : .
File Size                       : 69 kB
File Modification Date/Time     : 2016:11:29 11:59:08+02:00
File Access Date/Time           : 2016:11:29 12:07:17+02:00
File Inode Change Date/Time     : 2016:11:29 12:06:29+02:00
File Permissions                : rw-r--r--
File Type                       : JPEG
MIME Type                       : image/jpeg
JFIF Version                    : 1.01
Resolution Unit                 : None
X Resolution                    : 1
Y Resolution                    : 1
Exif Byte Order                 : Little-endian (Intel, II)
Orientation                     : Rotate 270 CW
Software                        : Shotwell 0.20.1
Color Space                     : sRGB
Exif Image Width                : 425
Exif Image Height               : 707
XMP Toolkit                     : XMP Core 4.4.0-Exiv2
Image Width                     : 425
Image Height                    : 707
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)
Image Size                      : 425x707

Correctly (as expected) positioned image in both views

$ exiftool 27.jpg 
ExifTool Version Number         : 9.74
File Name                       : 27.jpg
Directory                       : .
File Size                       : 66 kB
File Modification Date/Time     : 2016:11:29 11:58:53+02:00
File Access Date/Time           : 2016:11:29 12:13:36+02:00
File Inode Change Date/Time     : 2016:11:29 12:07:46+02:00
File Permissions                : rw-r--r--
File Type                       : JPEG
MIME Type                       : image/jpeg
JFIF Version                    : 1.01
Resolution Unit                 : None
X Resolution                    : 1
Y Resolution                    : 1
Exif Byte Order                 : Little-endian (Intel, II)
Orientation                     : Horizontal (normal)
Software                        : Shotwell 0.20.1
Color Space                     : sRGB
Exif Image Width                : 842
Exif Image Height               : 504
XMP Toolkit                     : XMP Core 4.4.0-Exiv2
Image Width                     : 842
Image Height                    : 504
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)
Image Size                      : 842x504

Debian: 8.5
Gnome: 3.14

marked as duplicate by Léo Léopold Hertz 준영, Community Dec 23 '16 at 9:09

This question was marked as an exact duplicate of an existing question.

  • What does "relative difference" mean? Does the image contain EXIF information about rotation and some of the viewers do not recognize that (maybe configuration dependent)? – ridgy Nov 29 '16 at 14:27
  • @ridgy the views are at 90 degree angle to each other, see the screenshot. How can you see relevant parts of exif data about orientation? I see nothing relevant in info of images. – Léo Léopold Hertz 준영 Nov 29 '16 at 14:30
  • 1
    Some image viewers show EXIF information, I don't know if shotwell does. exiftool will show complete information, something like "Orientation" and "Auto Rotate" will help. exiftoolshould be available in the debian repositories as libimage-exiftool-perl. – ridgy Nov 29 '16 at 14:44
  • @ridgy Please, see the body for example of exifdata for wrongly positioned image and right positioned image. Do you see anything which can explain the case? Note that there is the orientation difference. How can you change it? – Léo Léopold Hertz 준영 Nov 29 '16 at 17:32
1

28.jpg has an EXIF tag "Orientation : Rotate 270 CW"; on the contrary 29.jpg has "Horizontal (normal)". Rotating the image with convert does not change the EXIF information, so viewers respecting the EXIF information will nevertheless display different than viewers which don't.

You may change the tag using exiftool. To do that it is best to call exiftool first with some options, which will give you something like:

$ exiftool -g -n -arg 28.jpg
.
.
-EXIF:Orientation=2
.
.

(The value may be different). This says:

-g: group by and show the tag group

-n: show numeric value instead of text

-arg: show the tag in argument form

Now you can modify that tag to "Orientation: Horizontal (normal)" with

exiftool -n -EXIF:Orientation=1

You have to define -n, so exiftool knows the parameter is numeric, and the group name so exiftool knows where to find the tag.

For additional information, see e.g. Exif Orientation Tag

0

I did not manage to solve the problem by ridgy's answer. I managed to solve it in the end by LaTeX in the thread How to rotate image 90 if height overful? The case where both picture dimensions are bigger than page size is unsolved in the thread.

exiftool is about one file. To have pictures relationally nice on the page, you need LaTeX. The tools discussed here are not sufficient but the handling of the page orientation of all pictures is needed. So the question is flawed itself, I think, and cannot be handled only by exif data.

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