Bug 178616 - enable/disable auto rotate image
Summary: enable/disable auto rotate image
Status: RESOLVED FIXED
Alias: None
Product: gwenview
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Unspecified
: NOR wishlist
Target Milestone: ---
Assignee: Gwenview Bugs
URL:
Keywords:
: 238648 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-12-23 23:39 UTC by Christian Fontana
Modified: 2023-10-30 04:47 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.11.0


Attachments
patch file (6.94 KB, patch)
2008-12-23 23:45 UTC, Christian Fontana
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Fontana 2008-12-23 23:39:31 UTC
Version:            (using Devel)
Installed from:    Compiled sources

I'm testing KDE 4.2 beta 2. I downloaded svn repository and I played above all with gwenview. I found that also in this release there isn't any option to disable the auto-rotate image (according with EXIF metadata) behavior.

Christian Fontana
Comment 1 Christian Fontana 2008-12-23 23:45:42 UTC
Created attachment 29592 [details]
patch file
Comment 2 Christian Fontana 2008-12-23 23:47:08 UTC
I looked at the code, I'm not so familiar with KDE/QT application and I tried to produce a patch.

The patch touched these files:

gwenview/app/imageviewconfigpage.ui
gwenview/lib/thumbnailloadjob.cpp
gwenview/lib/jpegcontent.cpp
gwenview/lib/document/loadingdocumentimpl.cpp
gwenview/lib/gwenviewconfig.kcfg

a) I added a new config parameter called AutoRotateImages
b) I modified the Config Dialog window in order to manage this flag
c) I found three points in the code where the "auto-rotation" is involved. Before each block of code I test the AutoRotateImages flag and execute, if needed, the rotation.

I've tested the patch with some jpeg images I've downloaded from my camera.

I hope this patch can help to improve the application.

Regards
Christian Fontana
Comment 3 Aurelien Gateau 2009-01-03 01:08:05 UTC
Thanks for the patch. I will review it for inclusion in KDE4.3.
Comment 4 erkin 2010-04-21 13:20:19 UTC
I think there should be a warning concerning autorotated image to save as rotated. I review images but when i upload I see they are not rotated on the web site. 
It would much easier I bar like manual rotation warns to save in that state
Comment 5 Christian Fontana 2011-08-19 22:38:25 UTC
Any news? I saw that there is nothing about rotation also in the last kde 4.7.0

The end user experience is not the best with the autorotation enabled without the opportunity to disable it.

thanks
Comment 6 Jekyll Wu 2012-01-05 11:00:25 UTC
*** Bug 238648 has been marked as a duplicate of this bug. ***
Comment 7 Tanja Schulte 2012-04-01 13:38:18 UTC
This alas is still valid for the current gwenview version (KDE SC 4.8). As Janet mentioned in Bug 238648 there is a solution for dolphin and according to Peter Penz "it works for all applications, that use the default thumbnail mechanism from kdelibs" (Bug 238618). So it should be possible to implement that choice in gwenview too.
Comment 8 Janet 2012-09-25 21:29:16 UTC
I don't have any clue how the patch works. Does it make use of the dolphin solution? Maybe there's no need to reinvent the wheel. 

I hope this feature will be implemented soon because this automatic rotating totally screws up all my files, I cannot distinguish rotated and not-rotated files, I often rotate them though they are already rotated but gwenview does not see that. So the files get wrong rotation. And I only see it after I have burned it to dvd and look at it on another computer - not so nice.
Comment 9 Sergey Zhelnin 2013-02-03 15:23:44 UTC
*** This bug has been confirmed by popular vote. ***
Comment 10 Benni Hill 2013-02-04 20:21:29 UTC
(In reply to comment #8)
> I hope this feature will be implemented soon because this automatic rotating
> totally screws up all my files, I cannot distinguish rotated and not-rotated
> files, I often rotate them though they are already rotated but gwenview does
> not see that. So the files get wrong rotation. And I only see it after I
> have burned it to dvd and look at it on another computer - not so nice.

Did you try "Autorotate/Flip using EXIF information" (Plugins -> Images)? This should rotate the image correctly so that any image viewer should be able to show it properly without using the EXIF information.


Furthermore I think the patch is problematic:
1) If you change the AutoRotateImages option after gwenview has created thumbnails for some images, these thumbnails won't get updated (thumbnails are rotated BEFORE being stored).
2) If you have AutoRotateImages enabled and want to rotate an image using kipi-plugins (in gwenview) the resulting image would be rotated wrongly because kipi-plugins respects the EXIF information when rotating.
3) I think (but I am not sure) that the exif thumbnail can have a different rotation than the image itself. So ignoring both rotations could also cause problems.
Comment 11 Janet 2013-02-04 21:18:57 UTC
(In reply to comment #10)

> Did you try "Autorotate/Flip using EXIF information" (Plugins -> Images)?
> This should rotate the image correctly so that any image viewer should be
> able to show it properly without using the EXIF information.

No, simply because I don't want any app to autorotate anything according to exif information. BTW I have pictures with and without rotation stored in the EXIF information side by side and I use a dolphin servicemenu to rotate my pictures or konsole/imagemagick. I don't rotate my pictures with gwenview. Maybe I'll give that a try, nonetheless I don't want the files to be shown in any other way than they really are. IMHO a picture viewer should (be able to) show the pictures as they are and not beautified, rotated or whatever else.
 
> Furthermore I think the patch is problematic:
> 1) If you change the AutoRotateImages option after gwenview has created
> thumbnails for some images, these thumbnails won't get updated (thumbnails
> are rotated BEFORE being stored).
> 2) If you have AutoRotateImages enabled and want to rotate an image using
> kipi-plugins (in gwenview) the resulting image would be rotated wrongly
> because kipi-plugins respects the EXIF information when rotating.
> 3) I think (but I am not sure) that the exif thumbnail can have a different
> rotation than the image itself. So ignoring both rotations could also cause
> problems.

1. I guess you only change autorotation once - you love it and enable it or you hate it and disable it everywhere. Yes, some of the older thumbnails will show a wrong picture. They do it now too. Isn't there an option to refresh the thumbnails? Yes - at least you can delete the folder where the thumbnails are stored so that they get recreated the next time the picture is accessed. 
2. Sorry, I don't get why this should speak against turning visible autorotation off, contrary it strongly speaks pro turning it off... 
3. Yes, definitely possible. A lot of my pictures had (!) a differently rotated thumbnail until dolphin finally allowed to disable autorotation and I gave up evaluating my pictures' rotation via gwenview.

All those three points just tell me that it sounds good to allow the user to disable autorotation...
Comment 12 Benni Hill 2013-02-04 21:46:16 UTC
(In reply to comment #11)
> 2. Sorry, I don't get why this should speak against turning visible
> autorotation off, contrary it strongly speaks pro turning it off... 
Sorry, I meant:
If you have AutoRotateImages DISABLED and want to rotate an image using kipi-plugins (in gwenview) the resulting image would be rotated wrongly because kipi-plugins respects the EXIF information when rotating.
Comment 13 Janet 2013-02-04 22:29:12 UTC
(In reply to comment #12)

> Sorry, I meant:
> If you have AutoRotateImages DISABLED and want to rotate an image using
> kipi-plugins (in gwenview) the resulting image would be rotated wrongly
> because kipi-plugins respects the EXIF information when rotating.

Ok :). You are talking about an extra plugin that only looks at the exif info and doesn't ask the user to choose the rotation angle? I wouldn't use a plugin that autorotates from exif if I explicitely have disabled exif autorotation for viewing... Apart from that there also is a tool for rotating 90 degrees left/right., with that there should be no wrong rotation when autorotation for viewing is turned off,  (if, then it needs a bug report).
Comment 14 Janet 2013-02-04 22:35:27 UTC
Autorotation could still be default - but at least the users who know what they are doing and why they don't want that feature should be allowed to change that behaviour at least through some configuration file, it doesn't necessarily have to be in the options.
Comment 15 Benni Hill 2013-02-07 21:06:19 UTC
Patch updated:
https://git.reviewboard.kde.org/r/108841/
Comment 16 Peter Paulsen 2013-05-04 17:04:00 UTC
Any news on this? The Bug is available since 2008 and it's still annoying in KDE 4.10... I'd like to switch back to gwenview as main image viewer, it has a nice gui, but with autorotation it's not mine...
Comment 17 Benni Hill 2013-05-16 21:40:02 UTC
Git commit 6edd0aef06b0c2c868e7cd300ce7374840167f69 by Benjamin Löwe.
Committed on 05/02/2013 at 01:45.
Pushed by bennihill into branch 'master'.

Add hidden config option to ignore exif orientation.
This is a modified version of a patch originally submitted by
Christian Fontana.

REVIEW: 108841
FIXED-IN: 4.11.0

M  +2    -1    lib/document/loadingdocumentimpl.cpp
M  +4    -0    lib/gwenviewconfig.kcfg
M  +5    -0    lib/jpegcontent.cpp
M  +7    -3    lib/thumbnailprovider/thumbnailgenerator.cpp

http://commits.kde.org/gwenview/6edd0aef06b0c2c868e7cd300ce7374840167f69
Comment 18 Janet 2013-08-18 17:36:41 UTC
Thanks. How do I enable it?
Comment 19 Christoph Feck 2013-12-29 15:18:14 UTC
Janet, the hidden config option is named "ApplyExifOrientation", and takes a bool parameter (true or false).
Comment 20 Janet 2013-12-29 16:18:31 UTC
Thanks, but where? Do I have to write "ApplyExifOrientation=false" at the end of ~/.kde/share/config/gwenviewrc?
Comment 21 Christoph Feck 2013-12-29 17:21:10 UTC
Sorry, did not check the full file, just the diff. "ApplyExifOrientation" is in group "ImageView", so that should work in gwenviewrc, but did not test:

[ImageView]
ApplyExifOrientation=false

See https://projects.kde.org/projects/kde/kdegraphics/gwenview/repository/entry/lib/gwenviewconfig.kcfg
Comment 22 Janet 2013-12-29 22:45:18 UTC
Great! :) Works!
Comment 23 Jose Gómez 2015-07-12 16:13:20 UTC
This issue seems to still be present in Gwenview 5.0.0 pre. Gwenview does not show images rotated even though the rotation flag is set in the EXIF info (eog shows all images in the right orientation).
Comment 24 Andrei Ivnitskii 2023-10-30 04:47:03 UTC
[ImageView]
ApplyExifOrientation=false 

works for modern gwenview