Bug 336094 - Images are sometimes not correctly displayed after rotation
Summary: Images are sometimes not correctly displayed after rotation
Status: RESOLVED FIXED
Alias: None
Product: kphotoalbum
Classification: Applications
Component: Annotation Dialog (show other bugs)
Version: GIT master
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: KPhotoAlbum Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-11 19:22 UTC by Johannes Zarl-Zierl
Modified: 2014-06-25 20:59 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Zarl-Zierl 2014-06-11 19:22:25 UTC
As reported by Tobias Leupold:

Here's how to reproduce the problem:

 -   Select an image and open it in the annotation dialog
 -   Rotate the image and click "Done"
 -   Open the same image again in the annotation dialog, without saving and without restarting KPA

Result: The image is displayed un-rotated.

Interestingly, when the image is rotated and the XML database is saved, without re-opening the annotation dialog, KPA is closed and re-opened again, the image is displayed with the correct angle. Only saving the database does not do the trick, KPA has actually to be restarted for this to work.
Comment 1 Tobias Leupold 2014-06-11 21:48:48 UTC
In AnnotationDialog/ImagePreview.cpp, in ImagePreview::reload(), if one comments out the

if (_preloader.has(_info.fileName())) and the
else if (_lastImage.has(_info.fileName())) block and always uses the
else { } block, the error does not occur.

With the default code, when the image isn't rotated correctly, the _lastImage.has block is executed. So perhaps, it's only _lastImage's QImage that is not rotated correctly?
Comment 2 Tobias Leupold 2014-06-12 10:58:24 UTC
I think I could fix it.

The problem is that PreviewImage::has() only checks if the filename matches and there _is_ an image. It does not take the angle into account. When adding the correct angle information to the class and also checking against that, the error does not occur anymore.

I pushed the fix to the "positionable tags" branch of my fork of KPA, see https://github.com/l3u/kphotoalbum/commit/436efbf8d394f5f5657380520255236b8527ddb6 – the changes of this commit should also work 1:1 on the current master.
Comment 3 Johannes Zarl-Zierl 2014-06-21 17:59:23 UTC
Git commit 8869495c53f3ac43243a1e0474c4395bd81d209f by Johannes Zarl.
Committed on 21/06/2014 at 17:16.
Pushed by johanneszarl into branch 'positionable_tags-cleanedup2'.

GUI-Changes for implementing positionable tags.

Original patchset by Tobias Leupold.
This patchset also reimplements handling of image rotation in the
AnnotationDialog, fixing bug #336094.
Related: bug 292900

M  +248  -8    AnnotationDialog/Dialog.cpp
M  +19   -2    AnnotationDialog/Dialog.h
M  +281  -26   AnnotationDialog/ImagePreview.cpp
M  +45   -4    AnnotationDialog/ImagePreview.h
M  +37   -0    AnnotationDialog/ImagePreviewWidget.cpp
M  +6    -0    AnnotationDialog/ImagePreviewWidget.h
M  +53   -5    AnnotationDialog/ListSelect.cpp
M  +14   -2    AnnotationDialog/ListSelect.h
A  +420  -0    AnnotationDialog/ResizableFrame.cpp     [License: UNKNOWN]  *
A  +60   -0    AnnotationDialog/ResizableFrame.h     [License: UNKNOWN]  *
M  +3    -1    CMakeLists.txt
M  +14   -6    MainWindow/Window.cpp
M  +1    -0    MainWindow/Window.h
M  +3    -2    Viewer/ImageDisplay.cpp
M  +1    -0    Viewer/ImageDisplay.h
M  +6    -0    Viewer/InfoBox.cpp
M  +4    -0    Viewer/InfoBox.h
A  +54   -0    Viewer/TaggedArea.cpp     [License: UNKNOWN]  *
A  +33   -0    Viewer/TaggedArea.h     [License: UNKNOWN]  *
M  +117  -0    Viewer/ViewerWidget.cpp
M  +5    -0    Viewer/ViewerWidget.h

The files marked with a * at the end have a non valid license. Please read: http://techbase.kde.org/Policies/Licensing_Policy and use the headers which are listed at that page.


http://commits.kde.org/kphotoalbum/8869495c53f3ac43243a1e0474c4395bd81d209f
Comment 4 Johannes Zarl-Zierl 2014-06-23 21:46:58 UTC
Git commit ed792aec09c1df9c4f700e87c356f0a454f5cde6 by Johannes Zarl.
Committed on 22/06/2014 at 23:10.
Pushed by johanneszarl into branch 'master'.

GUI-Changes for implementing positionable tags.

Original patchset by Tobias Leupold.
This patchset also reimplements handling of image rotation in the
AnnotationDialog, fixing bug #336094.
Related: bug 292900

M  +248  -8    AnnotationDialog/Dialog.cpp
M  +19   -2    AnnotationDialog/Dialog.h
M  +283  -26   AnnotationDialog/ImagePreview.cpp
M  +40   -3    AnnotationDialog/ImagePreview.h
M  +37   -0    AnnotationDialog/ImagePreviewWidget.cpp
M  +6    -0    AnnotationDialog/ImagePreviewWidget.h
M  +53   -5    AnnotationDialog/ListSelect.cpp
M  +14   -2    AnnotationDialog/ListSelect.h
A  +420  -0    AnnotationDialog/ResizableFrame.cpp     [License: UNKNOWN]  *
A  +60   -0    AnnotationDialog/ResizableFrame.h     [License: UNKNOWN]  *
M  +4    -2    CMakeLists.txt
M  +14   -6    MainWindow/Window.cpp
M  +1    -0    MainWindow/Window.h
M  +3    -2    Viewer/ImageDisplay.cpp
M  +1    -0    Viewer/ImageDisplay.h
M  +6    -0    Viewer/InfoBox.cpp
M  +4    -0    Viewer/InfoBox.h
A  +54   -0    Viewer/TaggedArea.cpp     [License: UNKNOWN]  *
A  +33   -0    Viewer/TaggedArea.h     [License: UNKNOWN]  *
M  +117  -0    Viewer/ViewerWidget.cpp
M  +5    -0    Viewer/ViewerWidget.h

The files marked with a * at the end have a non valid license. Please read: http://techbase.kde.org/Policies/Licensing_Policy and use the headers which are listed at that page.


http://commits.kde.org/kphotoalbum/ed792aec09c1df9c4f700e87c356f0a454f5cde6