Bug 194572

Summary: Rotation of tiff images is bugged
Product: [Applications] okular Reporter: Romain <rlerallut>
Component: TIFF backendAssignee: Okular developers <okular-devel>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: PNG image, rotation works fine
TIFF image, rotation is broken
Screenshot showing distortion and corrupted data

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