Bug 1207150 - jhead autorot broken
jhead autorot broken
Status: RESOLVED FIXED
: 1207371 (view as bug list)
Classification: openSUSE
Product: openSUSE Distribution
Classification: openSUSE
Component: Other
Leap 15.4
Other openSUSE Leap 15.4
: P5 - None : Normal (vote)
: ---
Assigned To: Petr Gajdos
E-mail List
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2023-01-14 18:38 UTC by Reimar Imhof
Modified: 2023-02-20 20:18 UTC (History)
4 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
example file for jhead autorot bug (3.99 MB, image/jpeg)
2023-01-14 18:38 UTC, Reimar Imhof
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Reimar Imhof 2023-01-14 18:38:15 UTC
Created attachment 864125 [details]
example file for jhead autorot bug

OS: openSUSE Leap 15.4, all updates installed
Kernel: 5.14.21-150400.38-default

Problem: jhead -autorot breaks exif info
The bug occurs with the patched version 3.06.0.1-bp154.2.3.1 and the latest version ...-bp154.261. There is no problem with the original version ...-bp154.1.20

Put the attached photo into a new directory and run 
jhead -autorot *

This will rotate the photo as expected but will kill every exif info such as camera, exposure gps,...
There is also an error message "Nonfatal Error : 'DSC08058.JPG' Command has invalid characters."
Comment 1 Petr Gajdos 2023-01-16 07:08:23 UTC
Will try to look at it. Togan: if you have some free cycles, let me know ;).
Comment 2 hui 2023-01-22 07:04:35 UTC
Isn't this a duplicate of bug 1207371 or at least related?
Comment 3 Geoff Kuenning 2023-01-22 08:44:50 UTC
Bug 1207371 is a partial duplicate.  The EXIF damage is done by jpegtran; the invocation "jpegtran -rotate 270 -outfile foo.jpg IMG_2131.JPG" will create foo.jpg without the EXIF from IMG_2131.JPG.  The "invalid characters" message doesn't come from jpegtran; it may be related to bug 1207150.
Comment 4 Petr Gajdos 2023-02-10 12:09:06 UTC
*** Bug 1207371 has been marked as a duplicate of this bug. ***
Comment 5 Petr Gajdos 2023-02-10 12:11:32 UTC
Sooner or later, new jhead rpm will appear at:
https://download.opensuse.org/repositories/home:/pgajdos:/maintenance:/jhead/

I would be glad whether you guys could test it.
Comment 6 Petr Gajdos 2023-02-10 12:16:53 UTC
(In reply to Geoff Kuenning from comment #3)
> Bug 1207371 is a partial duplicate.  The EXIF damage is done by jpegtran;
> the invocation "jpegtran -rotate 270 -outfile foo.jpg IMG_2131.JPG" will
> create foo.jpg without the EXIF from IMG_2131.JPG.  The "invalid characters"
> message doesn't come from jpegtran; it may be related to bug 1207150.

              Copy no extra markers from source file.  This setting suppresses all comments and other metadata in the source file.

       -copy comments
              Copy only comment markers.  This setting copies comments from the source file but discards any other metadata.

       -copy icc
              Copy only ICC profile markers.  This setting copies the ICC profile from the source file but discards any other metadata.

       -copy all
              Copy all extra markers.  This setting preserves miscellaneous markers found in the source file, such as  JFIF  thumbnails,
              Exif  data,  and  Photoshop settings.  In some files, these extra markers can be sizable.  Note that this option will copy
              thumbnails as-is; they will not be transformed.

       The default behavior is -copy comments.  (Note: in IJG releases v6 and v6a, jpegtran always did the equivalent of -copy none.)


As far as I understand from jpegtran manual page, jpegtran does not preserve exif data per default. 

The fix I propose is based on jhead upstream's 
https://github.com/Matthias-Wandel/jhead/commit/2a237d866581b3774ebe63d6c312e76459bd0866
Comment 7 Petr Gajdos 2023-02-13 09:56:46 UTC
(In reply to Petr Gajdos from comment #5)
> Sooner or later, new jhead rpm will appear at:
> https://download.opensuse.org/repositories/home:/pgajdos:/maintenance:/jhead/
> 
> I would be glad whether you guys could test it.

I am sorry, publishing was disabled, now fixed.
Comment 8 Petr Gajdos 2023-02-14 11:24:41 UTC
Packages submitted: TW,b15sp4/jhead.

I believe all fixed.
Comment 9 OBSbugzilla Bot 2023-02-14 11:55:02 UTC
This is an autogenerated message for OBS integration:
This bug (1207150) was mentioned in
https://build.opensuse.org/request/show/1065728 Factory / jhead
https://build.opensuse.org/request/show/1065729 Backports:SLE-15-SP4 / jhead
Comment 10 Swamp Workflow Management 2023-02-20 20:18:38 UTC
openSUSE-SU-2023:0054-1: An update that fixes one vulnerability is now available.

Category: security (moderate)
Bug References: 1207150
CVE References: CVE-2022-41751
JIRA References: 
Sources used:
openSUSE Backports SLE-15-SP4 (src):    jhead-3.06.0.1-bp154.2.9.1