[Okular-devel] Review Request 111793: kimgio generator: Apply transformations dictated by Exif metadata

Fabio D'Urso fabiodurso at hotmail.it
Tue Oct 8 16:23:17 UTC 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/111793/
-----------------------------------------------------------

(Updated Oct. 8, 2013, 4:23 p.m.)


Review request for Okular.


Changes
-------

- Fixed libkexiv2 detection (previously it didn't compile at all if missing, now it just skips the kimgio generator)

- Added autotest with images for all possible Exif Orientation values.
   All images actually produce the same output (a white 3x2 rectangle, with a single black pixel in the top-left corner).
   For each image, the test checks that the image gets rotated/mirrored correctly and correct pixmaps are generated.
   In order to obtain pixmaps, I had to compile PagePainter from ui/ along with the test, like okular active currently does.
   (If I find some time, I can try to move PagePainter into okularcore [in a separate patch, of course]. What do you think?)


Bugs: 322920
    http://bugs.kde.org/show_bug.cgi?id=322920


Repository: okular


Description
-------

This patch fixes bug 322920 (JPG images don't open rotated correctly).
It adds a dependency on libKExiv2, which is a wrapper around Exiv2.

I've put the code that applies the transformation in loadDocument(), which means that it will block the UI.
Of course, with a little more effort, it can be moved to image(), but I've decided to keep it in loadDocument() because:
 - it's a one-time only operation;
 - loadDocument() already blocks while loading the file, so I guess a little more time won't hurt much.
Of course, if you don't agree, I can change it.

The dependency on libKExiv2 *not* optional because I want to avoid having orientation depend on compilation flags. If I made it optional and you shared a .okular archive with annotations, their (normalized) coordinates would no longer be consistent among clients.


Diffs (updated)
-----

  generators/CMakeLists.txt 531cc6e 
  generators/kimgio/CMakeLists.txt b0a61eb 
  generators/kimgio/generator_kimgio.cpp 1badab3 
  generators/kimgio/tests/data/testExifOrientation-0.jpg PRE-CREATION 
  generators/kimgio/tests/data/testExifOrientation-0mirror.jpg PRE-CREATION 
  generators/kimgio/tests/data/testExifOrientation-180.jpg PRE-CREATION 
  generators/kimgio/tests/data/testExifOrientation-180mirror.jpg PRE-CREATION 
  generators/kimgio/tests/data/testExifOrientation-270.jpg PRE-CREATION 
  generators/kimgio/tests/data/testExifOrientation-270mirror.jpg PRE-CREATION 
  generators/kimgio/tests/data/testExifOrientation-90.jpg PRE-CREATION 
  generators/kimgio/tests/data/testExifOrientation-90mirror.jpg PRE-CREATION 
  generators/kimgio/tests/data/testExifOrientation-noexif.jpg PRE-CREATION 
  generators/kimgio/tests/data/testExifOrientation-unspecified.jpg PRE-CREATION 
  generators/kimgio/tests/kimgiotest.cpp PRE-CREATION 

Diff: http://git.reviewboard.kde.org/r/111793/diff/


Testing
-------

- Image from bug 322920
- Images taken with my phone (Galaxy S2)
- Images without Exif metadata at all, to verify that they still work


Thanks,

Fabio D'Urso

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/okular-devel/attachments/20131008/9653b13d/attachment.html>


More information about the Okular-devel mailing list