Exiftool orientation doesn't works on a file and works on another file

Hi, on my leap 15.4 running KDE I would like to delete the orientation EXIF tag on some files,
to do this I’m using EXIFTOOL.
if I run the command to delete the orientation EXIF tag on a file it works,
if I run the same command on another file it doesn’t works.
where am I wrong?

reading the manual I found that the command to delete the orientation EXIF tag should be this:

exiftool -orientation= "filename"

and the command to show the orientation EXIF tag should be this:

exiftool -orientation "filename"

if I run it on the file “orient180.jpg” it works:
show the orientation EXIF tag of “orient180.jpg” it result “Rotate 180”:

pla@pla4-TW:~> exiftool -orientation "orient180.jpg"
Orientation                     : Rotate 180
pla@pla4-TW:~>

delete the orientation EXIF tag of “orient180.jpg”:

la@pla4-TW:~> exiftool -orientation= "orient180.jpg"
    1 image files updated
pla@pla4-TW:~> 

check the orientation EXIF tag of the modified file “orient180.jpg” it result null:

pla@pla4-TW:~> exiftool -orientation "orient180.jpg"
pla@pla4-TW:~> 

as the manual says exiftool create a copy of the original file “orient180.jpg_original”
check the orientation EXIF tag of the copy of original file “orient180.jpg_original” it result “Rotate 180”:

pla@pla4-TW:~> exiftool -orientation "orient180.jpg_original"
Orientation                     : Rotate 180
pla@pla4-TW:~> 

if I run the same commands on the file “orient-no.jpg” it doesn’t works:
show the orientation EXIF tag of “orient-no.jpg” it result “Rotate 90 CW”:

pla@pla4-TW:~> exiftool -orientation "orient-no.jpg" 
Orientation                     : Rotate 90 CW
pla@pla4-TW:~> 

delete the orientation EXIF tag of “orient-no.jpg”:

pla@pla4-TW:~> exiftool -orientation= "orient-no.jpg" 
    0 image files updated
    1 image files unchanged
pla@pla4-TW:~> 

check the orientation EXIF tag of the just modified (should be) file “orient-no.jpg” it result “Rotate 90 CW”:

pla@pla4-TW:~> exiftool -orientation "orient-no.jpg" 
Orientation                     : Rotate 90 CW
pla@pla4-TW:~> 

and also exiftool does not create a copy of the original file “orient-no.jpg_original”, I suppose becouse it is not changed,
am I doing something wrong?
how can I delete the orientation tag on the file “orient-no.jpg”?

I don’t know why the carriage return isn’t shown with [/code] tag

@pier_andreit:

Please check the validity of the JPEG file where “exiftool” errors:

> file «misbehaving JPEG file name»

You could also check the meta information in the JPEG file which is misbehaving:

> exiftool -a -u -g1 -ee3 -api RequestAll=3 ???.jpg

Hi and manythanks, here is:

[quote]pla@pla4-TW:~> file “orient-no.jpg”
orient-no.jpg: JPEG image data, Exif standard: [TIFF image data, little-endian, direntries=12, height=1836, manufacturer=SAMSUNG, model=GT-I9195, xresolution=176, yresolution=184, resolutionunit=2, software=I9195XXUBML4, datetime=2014:08:18 21:31:27, GPS-Data, width=3264], comment: “JHEADfile=2014-08-08ago(cena ariccia lorenza nadia ciro e majals)20140818_213127(pla).jpg”, baseline, precision 8, 3264x1836, frames 3
pla@pla4-TW:~> [/quote]
I’m not able to see any of strange
and here:

[quote]pla@pla4-TW:~> exiftool -a -u -g1 -ee3 -api RequestAll=3 orient-no.jpg
---- ExifTool ----
ExifTool Version Number : 12.30
Now : 2023:03:06 20:18:52+01:00
New GUID : 20230306-2018-5200-5885-80219CF9EBBC
File Sequence : 0
Processing Time : 0.063 s
---- System ----
File Name : orient-no.jpg
Base Name : orient-no
Directory : .
File Path : /home/pla/orient-no.jpg
File Size : 2.1 MiB
File Modification Date/Time : 2023:03:02 13:30:02+01:00
File Access Date/Time : 2023:03:06 13:28:01+01:00
File Inode Change Date/Time : 2023:03:06 13:24:45+01:00
File Permissions : -rwxrwxrwx
File Attributes : Regular; (none)
File Device Number : 2058
File Inode Number : 791714
File Hard Links : 1
File User ID : pla
File Group ID : users
File Device ID : 0.0
File Block Size : 4096
File Block Count : 4368
---- File ----
File Type : JPEG
File Type Extension : jpg
MIME Type : image/jpeg
Exif Byte Order : Little-endian (Intel, II)
Current IPTC Digest : f081241364dd67a1234f2953f195abdd
Comment : JHEADfile=2014-08-08ago(cena ariccia lorenza nadia ciro e majals)20140818_213127(pla).jpg. -autore=Pierluigi Andreoli -descrizione=2014-08-08ago Ariccia, Roma, fraschetta ECCHECCAZZO Via dell’ucceliera-cena con amici e majals- cibo
Image Width : 3264
Image Height : 1836
Encoding Process : Baseline DCT, Huffman coding
Bits Per Sample : 8
Color Components : 3
Y Cb Cr Sub Sampling : YCbCr4:2:0 (2 2)
JPEG Image Length : 2218526
JPEG Quality Estimate : 96
JPEG Digest : Unknown (35686967efa5fb333fb8f4844efc33a3:221111)
---- IFD0 ----
Image Width : 3264
Image Height : 1836
Make : SAMSUNG
Camera Model Name : GT-I9195
X Resolution : 72
Y Resolution : 72
Resolution Unit : inches
Software : I9195XXUBML4
Modify Date : 2014:08:18 21:31:27
Y Cb Cr Positioning : Centered
---- ExifIFD ----
Exposure Time : 1/30
F Number : 2.6
Exposure Program : Aperture-priority AE
ISO : 100
Exif Version : 0220
Date/Time Original : 2014:08:18 21:31:27
Create Date : 2014:08:18 21:31:27
Components Configuration : Y, Cb, Cr, -
Shutter Speed Value : 1
Aperture Value : 2.6
Brightness Value : 30
Exposure Compensation : 0
Max Aperture Value : 2.6
Metering Mode : Center-weighted average
Light Source : Unknown
Flash : Fired
Focal Length : 3.7 mm
User Comment : EXIFfile=2014-08-08ago(cena ariccia lorenza nadia ciro e majals)20140818_213127(pla).jpg. -autore=Pierluigi Andreoli -descrizione=2014-08-08ago Ariccia, Roma, fraschetta ECCHECCAZZO Via dell’ucceliera-cena con amici e majals- cibo
Flashpix Version : 0100
Color Space : sRGB
Exif Image Width : 3264
Exif Image Height : 1836
Sensing Method : One-chip color area
Scene Type : Directly photographed
Exposure Mode : Auto
White Balance : Auto
Digital Zoom Ratio : 1
Scene Capture Type : Standard
Saturation : Normal
Sharpness : Normal
Image Unique ID : S08Q0LEGC01
---- Samsung ----
Maker Note Version : 0100
Device Type : Cell Phone
Samsung Type 2 0x000c : 0
Samsung Type 2 0x0010 : undef
Raw Data Byte Order : Little-endian (Intel, II)
Raw Data CFA Pattern : Swap
Face Detect : Off
---- InteropIFD ----
Interoperability Index : R98 - DCF basic file (sRGB)
Interoperability Version : 0100
---- GPS ----
GPS Version ID : 2.2.0.0
---- IFD1 ----
Image Width : 256
Image Height : 144
Compression : JPEG (old-style)
Orientation : Rotate 90 CW
X Resolution : 72
Y Resolution : 72
Resolution Unit : inches
Thumbnail Offset : 1278
Thumbnail Length : 10573
Thumbnail Image : (Binary data 10573 bytes, use -b option to extract)
---- XMP-x ----
XMP Toolkit : XMP Core 4.4.0-Exiv2
---- XMP-exif ----
User Comment : XMPfile=2014-08-08ago(cena ariccia lorenza nadia ciro e majals)20140818_213127(pla).jpg. -autore=Pierluigi Andreoli -descrizione=2014-08-08ago Ariccia, Roma, fraschetta ECCHECCAZZO Via dell’ucceliera-cena con amici e majals- cibo
---- IPTC ----
Caption-Abstract : IPTCfile=2014-08-08ago(cena ariccia lorenza nadia ciro e majals)20140818_213127(pla).jpg. -autore=Pierluigi Andreoli -descrizione=2014-08-08ago Ariccia, Roma, fraschetta ECCHECCAZZO Via dell’ucceliera-cena con amici e majals- cibo
---- Composite ----
Aperture : 2.6
Image Size : 3264x1836
Megapixels : 6.0
Shutter Speed : 1/30
Focal Length : 3.7 mm
Light Value : 7.7
pla@pla4-TW:~>
[/quote]

You can use Markdown as well. For me it works fine.

You need to put tags on a line of their own:

[quote]Hello!
[/quote]
vs.


The former is:

[quote]Hello!
[/quote]

The latter is:

[quote]
Hello!
[/quote]

Possibly due to the Orientation EXIF Tag inserted by the Cell Phone.

  • When I examine a JPEG file produced by a camera here, the EXIF Orientation Tags look like this:
 > exiftool -a -u -g1 -ee3 -api RequestAll=3 _DQ_4846.JPG | grep -i 'orient'
Orientation                     : Horizontal (normal)
Orientation                     : Horizontal (normal)
Orientation                     : Horizontal (normal)
 > 
 > identify -format %[EXIF:*] _DQ_4846.JPG | grep -i 'orient'
exif:Orientation=1
exif:thumbnail:Orientation=1
 > 
 > identify -verbose _DQ_4846.JPG | grep -i 'orient'
  Orientation: TopLeft
    exif:thumbnail:Orientation: 1
 > 

I changed your first post above by adding CRs.

the original file where orientation tag delete works before delete gives me this:

pla@pla4-TW:~> exiftool -a -u -g1 -ee3 -api RequestAll=3 orient180.jpg_original | grep -i 'orient'
File Name                       : orient180.jpg_original
Base Name                       : orient180
File Path                       : /home/pla/orient180.jpg_original
Orientation                     : Rotate 180
pla@pla4-TW:~> 
pla@pla4-TW:~> identify -format %[EXIF:*] orient180.jpg_original | grep -i 'orient'
exif:Orientation=3
pla@pla4-TW:~> 
pla@pla4-TW:~> identify -verbose orient180.jpg_original | grep -i 'orient'
  Filename: orient180.jpg_original
  Orientation: BottomRight
pla@pla4-TW:~> 

in the first command this file gives orientation tag = Rotate 180
and in the third command Orientation: BottomRight
that seems right and coherent

after the orientation tag delete gives me this:

pla@pla4-TW:~> exiftool -a -u -g1 -ee3 -api RequestAll=3 orient180.jpg | grep -i 'orient'
File Name                       : orient180.jpg
Base Name                       : orient180
File Path                       : /home/pla/orient180.jpg
pla@pla4-TW:~> 
pla@pla4-TW:~> identify -format %[EXIF:*] orient180.jpg | grep -i 'orient'
pla@pla4-TW:~> 
pla@pla4-TW:~> identify -verbose orient180.jpg | grep -i 'orient'
  Filename: orient180.jpg
  Orientation: Undefined
pla@pla4-TW:~> 

in the first command this file gives orientation tag = null
and in the third command Orientation: Undefined
so it seems right and coherent

the file where the delete doesn’t works gives me this:

pla@pla4-TW:~> exiftool -a -u -g1 -ee3 -api RequestAll=3 orient-no.jpg | grep -i 'orient'
File Name                       : orient-no.jpg
Base Name                       : orient-no
File Path                       : /home/pla/orient-no.jpg
Orientation                     : Rotate 90 CW
pla@pla4-TW:~> 
pla@pla4-TW:~> identify -format %[EXIF:*] orient-no.jpg | grep -i 'orient'
exif:thumbnail:Orientation=6
pla@pla4-TW:~> 
pla@pla4-TW:~> identify -verbose orient-no.jpg | grep -i 'orient'
  Filename: orient-no.jpg
  Orientation: Undefined
    exif:thumbnail:Orientation: 6
pla@pla4-TW:~> 

in the first command this file gives orientation tag = Rotate 90 CW
and in the third command Orientation: Undefined
that seems not right and not coherent

how can I delete orientation tag = Rotate 90 CW??

manythanks to the suggestion on how to place [/code] tags and to hccv for adding the CRs

The first command shows you thumbnail orientation. It does not print missing “main image” orientation tag. The second command shows you both and quite correctly tells you that “main image” orientation is undefined.

so, if the orientation is undefined cannot be deleted??

How can you delete something that does not exist?

The EXIF Tag as such isn’t deleted – only the content …

  • If a Tag’s content is deleted then, the Tag’s content is empty → «mathematically a “null” value» → the Tag’s value is “Undefined” …

A “Tag” is a named Placeholder entry in a data structure – exactly how the Tag’s name is managed, depends on language being used to defined the data structure.

may be I have to delete the thumbnail orientation too??
it seems to be the only difference from where deleting works and where doesn’t works

how can I delete it?

How should we know what you have to do? There is orientation of the image and the orientation of the thumbnail and they are two totally independent things. You do not explain what you want (or why) so it is impossible to say what you have to do to achieve it.

exiftool -ifd1:orientation=  ...

I said at the beginning, I would like to delete the orientation EXIF tag on some files,

I didn’t know that there was also orientation of the thumbnail,

but it seems that are not totally independent, I’ll explain it later

I want see my pictures with gwenview (or other picture viewers) as they are, not rotated by gwenview that follow the orientation tag, I want to rotate my picture if I want becouse the picture are done in that way.
I tried to delete orientation tag but it worked only in some files and not on others, so I asked help here.

and manythanks, the deleting of the orientation of the thumbnail worked,
deleting only the orientation tag and not the orientation of the thumbnail make that gwenview respect anyway the orientation tag and rotate the picture
(for this I say that they are not totally independent, and also I don’t know if this is a bug or a feature of gwenview) deleting both orientation tags the picture is not rotated by gwenview, and this is what I want