Bug 343044 - Some images rotated via EXIF are not rotated and appear in the wrong size
Summary: Some images rotated via EXIF are not rotated and appear in the wrong size
Status: RESOLVED UPSTREAM
Alias: None
Product: gwenview
Classification: Applications
Component: general (show other bugs)
Version: Other (add details in bug description)
Platform: Arch Linux Linux
: NOR major
Target Milestone: ---
Assignee: Gwenview Bugs
URL:
Keywords:
: 343304 344987 346384 347652 348797 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-01-19 17:47 UTC by Chris Warrick
Modified: 2015-09-27 14:44 UTC (History)
26 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
screenshot of the issue (49.24 KB, image/png)
2015-01-19 17:50 UTC, Chris Warrick
Details
Screenshot of correct portrait thumbnails (453.13 KB, image/jpeg)
2015-03-03 21:48 UTC, Jamie Kitson
Details
Screenshot of incorrect portrait image (114.94 KB, image/jpeg)
2015-03-03 21:48 UTC, Jamie Kitson
Details
testcase 1 (3.28 MB, image/jpeg)
2015-06-27 06:06 UTC, Holger
Details
testcase 2 (correctly in landscape) (3.12 MB, image/jpeg)
2015-06-27 06:08 UTC, Holger
Details
testcase 3 (3.22 MB, image/jpeg)
2015-06-27 06:10 UTC, Holger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Warrick 2015-01-19 17:47:43 UTC
I have some images from a digital camera (that I don’t own).  They feature the standard EXIF tags for rotation, with the value of 6.  For some reason, 

(Version 5.0.0 pre, from arch linux [testing].  This may be caused by)

Reproducible: Always

Steps to Reproduce:
1. Take a portrait photo with an orientation-sensitive camera, for example a Sony NEX-F3.
2. Open it in Gwenview.

Actual Results:  
The image appears in landscape, BUT the width is what it would be in portrait.  Gwenview clearly TRIES to do it right, but fails.

Expected Results:  
The image appears properly in portrait.

The most basic files are not affected, there is a specific set of broken settings that results in the error
Comment 1 Chris Warrick 2015-01-19 17:50:32 UTC
Created attachment 90519 [details]
screenshot of the issue

(I can offer the sample file, in private.)
Comment 2 Jamie Kitson 2015-03-03 21:43:19 UTC
I'm seeing this too. Thumbnails look ok, but when clicking on a portrait image it is shown in landscape with the width of a portrait image.

I am seeing errors like this:

Could not generate thumbnail for file "file:///home/jamie/Pictures/2014-10/DSC_9566.NEF"
Could not create a temporary file.
KServiceTypeTrader: serviceType "ThumbCreator" not found

I have installed kio-extra etc so that thumbnails could be generated, but this did not fix the issue, however the above messages were reduced to just "Could not create a temporary file."
Comment 3 Jamie Kitson 2015-03-03 21:46:55 UTC
(In reply to Jamie Kitson from comment #2)

This issue is is present in the Arch package gwenview 14.12.2-2, but not the previous, non KDE/Plasma 5 version kdegraphics-gwenview-4.14.3-1-x86_64.

I am not using KDE/Plasma.
Comment 4 Jamie Kitson 2015-03-03 21:48:03 UTC
Created attachment 91400 [details]
Screenshot of correct portrait thumbnails
Comment 5 Jamie Kitson 2015-03-03 21:48:30 UTC
Created attachment 91401 [details]
Screenshot of incorrect portrait image
Comment 6 Pierre 2015-03-26 16:47:33 UTC
Exactly the same problem here. 
gwenview 5.0.0 pre
Comment 7 LuHe 2015-04-02 05:41:26 UTC
The exact same issue is also present in Version 5.0.0 pre, included in Kubuntu 15.04 Beta 2
Comment 8 Petr Kopecký 2015-04-13 18:58:06 UTC
The same issue with photos from LG G3 phone camera.
This bug seems to be the same as Bug 344987
Comment 9 Dan 2015-04-22 17:02:04 UTC
Issue is still present in 15.04. Please set the status of this bug to "Confirmed" so the KDE QA can make sure that it gets fixed in 15.04.1.
Comment 10 Michal Svoboda 2015-04-26 08:04:57 UTC
*** This bug has been confirmed by popular vote. ***
Comment 11 Michal Svoboda 2015-04-26 08:07:11 UTC
This issue happens for both my cameras (Nikon and Canon), and it is a regression. Downgrade to 4.14.0 solves the issue.
Comment 12 Christoph Feck 2015-05-02 22:08:19 UTC
*** Bug 346384 has been marked as a duplicate of this bug. ***
Comment 13 Christoph Feck 2015-05-02 22:08:45 UTC
*** Bug 344987 has been marked as a duplicate of this bug. ***
Comment 14 Michal Svoboda 2015-05-09 08:38:53 UTC
Any news on this?
Comment 15 Edward Viesel 2015-05-20 19:25:53 UTC
Kubuntu 15.04, Gwenview 5.0.0pre.

Yes, identical problem here too. Fully reproducible. This is still happening today with a completely updated Kubuntu system.
Comment 16 LuHe 2015-05-26 03:32:57 UTC
I tracked down this bug and made the following observations:

It was caused by QTBUG-37946 ( https://bugreports.qt.io/browse/QTBUG-37946 ):

Starting with Qt 5.4 (which Ubuntu and Arch are shipping), QImage automatically checks if there is an Exif header present and rotates the images accordingly. - see this change: https://codereview.qt-project.org/#/c/98013/

But this behavior will be reverted in the soon released Qt 5.4.2, because it is backwards incompatible and breaks existing applications (like this one here ;) ) - see this change: https://codereview.qt-project.org/#/c/111398/

So there are two possibilities:
 - Upgrade to Qt 5.4.2 as soon as possible and mark Qt 5.4.0 and 5.4.1 as broken.
 - Check the Qt Version in ./lib/document/loadingdocumentimpl.cpp / loadImageData() - should i create a merge request?
Comment 17 LuHe 2015-05-26 03:56:26 UTC
Review Request: https://git.reviewboard.kde.org/r/123906/

---

I also noticed that the pictures in the bottom thumbnail bar are *NOT* correctly rotated (whereas the top thumbnail bar in the fullscreen mode works *scratches head*).. has this already worked once before (e.g. on KDE4/Qt4)?
Comment 18 Edward Viesel 2015-05-26 14:18:24 UTC
I would like to add to Comment 17: If I go to "full-screen mode" on a portrait-style foto (I'm using the German-language version, where it's calld "Vollbildmodus"), and then "fall back" to the Gwenview file manager screen with the ESC key, the very tiny thumbnail images are rotated in the right way.

If I then use the bottom right button to increase the size of the thumbnails, the thumbnails will stay rotated correctly until I reach the maximum resolution (256 x 256). Then, suddenly, the thumbnails will rotate by 90° clockwise. Decreasing the resolution doesn't, however, change their position back. The (incorrectly) stay in "landscape mode".

I can then choose the minimum resolution again and completely close Gwenview. Upon restarting Gwenview and "falling back" to the Gwenview file manager from "full-screen mode" they will be in the right position again, until I choose the maximum resolution (256 x 256) again, when they will be rotated again. Etc.
Comment 19 Edward Viesel 2015-05-26 14:27:49 UTC
(In reply to Edward Viesel from comment #18)
> I would like to add to Comment 17: If I go to "full-screen mode" on a
> portrait-style foto (I'm using the German-language version, where it's calld
> "Vollbildmodus"), and then "fall back" to the Gwenview file manager screen
> with the ESC key, the very tiny thumbnail images are rotated in the right
> way.
> 
> If I then use the bottom right button to increase the size of the
> thumbnails, the thumbnails will stay rotated correctly until I reach the
> maximum resolution (256 x 256). Then, suddenly, the thumbnails will rotate
> by 90° clockwise. Decreasing the resolution doesn't, however, change their
> position back. The (incorrectly) stay in "landscape mode".
> 
> I can then choose the minimum resolution again and completely close
> Gwenview. Upon restarting Gwenview and "falling back" to the Gwenview file
> manager from "full-screen mode" they will be in the right position again,
> until I choose the maximum resolution (256 x 256) again, when they will be
> rotated again. Etc.

A further addition: You can increase the resolution in the Gwenview file manager by 1 pixel at a time with the Right Arrow Key. The changeover actually happens at value 240, with 240 still in the correct position and 241 x 241 being flipped by 90° clockwise.

I can fully reproduce this each time: 240 x 240 is correct, then the image rotates to "landscape".
Comment 20 Jan Kundrát 2015-05-28 21:42:15 UTC
*** Bug 347652 has been marked as a duplicate of this bug. ***
Comment 21 Jan Kundrát 2015-06-03 15:21:44 UTC
*** Bug 343304 has been marked as a duplicate of this bug. ***
Comment 22 Jan Kundrát 2015-06-08 09:02:41 UTC
*** Bug 348797 has been marked as a duplicate of this bug. ***
Comment 23 Holger 2015-06-27 06:06:22 UTC
Created attachment 93356 [details]
testcase 1

I'll attach a few images to test the bug on. The filesize-limit of 4000KB made me look for the tiniest.

The camera is a Lumix FS10 from Panasonic.
Comment 24 Holger 2015-06-27 06:08:01 UTC
Created attachment 93357 [details]
testcase 2 (correctly in landscape)
Comment 25 Holger 2015-06-27 06:10:06 UTC
Created attachment 93358 [details]
testcase 3

The fotos feature the church windows of the dome of Braunschweig.
Comment 26 ttrovo 2015-07-18 18:51:38 UTC
Confirm this BUG in the last (up-to-date) Kubuntu 15.04.

This bug exists for more that 6 month + there are a lot of duplicates of this bug.
In the last KDE4 everything worked fine with gwenview, and in KDE5 it doesn't.
Comment 27 Lukasz 2015-07-28 21:42:08 UTC
Does anyone work on that? How can I help?
Comment 28 Aleko 2015-07-29 02:05:40 UTC
This is really irritating! Yesterday I had to use gThumb to review my vacation pictures and it sucked. Gwenview is a much better application but this bug is a real showstopper.
Comment 29 M. Kugler 2015-08-03 09:07:53 UTC
(In reply to LuHe from comment #16)
> I tracked down this bug and made the following observations:
> 
> It was caused by QTBUG-37946 ( https://bugreports.qt.io/browse/QTBUG-37946 ):
> 
> Starting with Qt 5.4 (which Ubuntu and Arch are shipping), QImage
> automatically checks if there is an Exif header present and rotates the
> images accordingly. - see this change:
> https://codereview.qt-project.org/#/c/98013/
> 
> But this behavior will be reverted in the soon released Qt 5.4.2, because it
> is backwards incompatible and breaks existing applications (like this one
> here ;) ) - see this change: https://codereview.qt-project.org/#/c/111398/
> 
> So there are two possibilities:
>  - Upgrade to Qt 5.4.2 as soon as possible and mark Qt 5.4.0 and 5.4.1 as
> broken.
>  - Check the Qt Version in ./lib/document/loadingdocumentimpl.cpp /
> loadImageData() - should i create a merge request?

In Ubuntu vivid 15.04., installing qt5-default (v5.4.2) from the "debian testing" repository fixes this bug.
Comment 30 Aleko 2015-08-07 04:21:15 UTC
(In reply to M. Kugler from comment #29)
> In Ubuntu vivid 15.04., installing qt5-default (v5.4.2) from the "debian
> testing" repository fixes this bug.

It did indeed fix gwenview but, unforgunately, broke other things. KDE didn't load after such update so I had to reinstall my Kubuntu.
Comment 31 Julian Kalinowski 2015-08-25 18:25:46 UTC
So is there a workaround that doesn't break anything?
Because this is a real show stopper. I love gwenview, but rotating is one of the most common tasks for me when working with photos...
Comment 32 Jamie Kitson 2015-08-30 10:36:39 UTC
Confirmed fixed with  Qt 5.4.2. However I don't use KDE so can't comment on side effects.
Comment 33 Christoph Feck 2015-09-27 14:44:41 UTC
If this is still reproducible with Qt 5.5.0 or newer, please add a comment.