Bug 134970

Summary: 'jpegtran -rotate 90' can cause image to 'slip'
Product: [Fedora] Fedora Reporter: Tim Waugh <twaugh>
Component: libjpegAssignee: Matthias Clasen <mclasen>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-11-03 16:26:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
catmug1.jpg none

Description Tim Waugh 2004-10-07 16:25:19 UTC
Description of problem:
With some images, 'jpegtran -rotate 90' causes the resulting image to
be 'slipped' left by a few pixels, so that what should have been on
the left edge is now in the right edge, and flipped.

For example, like this:
xample, like this:e roF

Version-Release number of selected component (if applicable):
libjpeg-6b-32

Comment 1 Matthias Clasen 2004-10-12 14:32:51 UTC
You would not happen to have an example image do demonstrate that,
would you ?

Comment 2 Tim Waugh 2004-10-12 14:51:26 UTC
Created attachment 105064 [details]
catmug1.jpg

Sure, here's one.  It's already been rotated once, so you can see the effect
already.  Rotating it again produces another artifact, again on the right-hand
side.

jpegtran -rotate 90 catmug1.jpg > rotated.jpg

Comment 3 Matthias Clasen 2004-11-03 16:26:11 UTC
This is documented in the jpegtran man page:

The transpose transformation has no restrictions regarding image
dimensions.  The other transformations operate rather  oddly  if
the  image dimensions  are  not  a multiple of the iMCU size 
(usually 8 or 16 pixels), because they can only transform complete 
blocks  of  DCT  coefficient data in the desired way.

I don't think this is easily fixable short of rewriting the jpeg
transformation support completely, which I'm not up to.