Bug 194572 - Rotation of tiff images is bugged
Summary: Rotation of tiff images is bugged
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: TIFF backend (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-29 18:05 UTC by Romain
Modified: 2009-06-09 13:47 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
PNG image, rotation works fine (148.87 KB, image/png)
2009-05-29 18:05 UTC, Romain
Details
TIFF image, rotation is broken (20.95 KB, image/tiff)
2009-05-29 18:07 UTC, Romain
Details
Screenshot showing distortion and corrupted data (116.45 KB, image/png)
2009-05-29 18:08 UTC, Romain
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Romain 2009-05-29 18:05:03 UTC
Version:            (using KDE 4.2.2)
OS:                Linux
Installed from:    Debian testing/unstable Packages

If I open a tiff image in Okular and rotate it (menu: View->Orientation->Rotate Right), the rotated image appears distorted. The problem does not appear with the same image as a PNG file.

I'm attaching both images (PNG and TIFF) as well as a screenshot showing ugly corruption on the side.

Best guess: someone forgets to switch x and y dimensions.


HTH,
Romain
Comment 1 Romain 2009-05-29 18:05:42 UTC
Created attachment 34110 [details]
PNG image, rotation works fine
Comment 2 Romain 2009-05-29 18:07:32 UTC
Created attachment 34112 [details]
TIFF image, rotation is broken

The TIFF image was obtained from the PNG one by using ImageMagick's convert tool.
Comment 3 Romain 2009-05-29 18:08:26 UTC
Created attachment 34113 [details]
Screenshot showing distortion and corrupted data
Comment 4 Pino Toscano 2009-06-09 13:16:27 UTC
SVN commit 979245 by pino:

swapping was needed... 3 years ago, but it is not anymore
BUG: 194572


 M  +0 -2      generator_tiff.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=979245
Comment 5 Romain 2009-06-09 13:47:22 UTC
Hi,

looking at the code in 4.2.4 (I don't have a KDE svn checkout), I see there's another similar qSwap a few lines below: 

  qSwap(reqwidth, reqheight)

If I comment the first one only (your commit), then the image is still stretched => bug not fixed :(.

If I comment the second one only, then the image is correctly rotated but black areas appear on the side. Almost there.

If I comment *both*, then it all works fine.  

Again, this is on the 4.2.4 branch, so maybe things are different in svn.


Anyway thanks for the fix.
Regards,
Romain