On Sun, Jul 17, 2005 at 06:55:49PM +0200, Benjamin Mesing wrote:
> Hello,
>
> when using jpgtran from gqview to rotate my photos, it sometimes happens that
> some lines from the top of the image are inserted at the bottom (wrapped
> around).
>
> This happens only sometimes but reproducable - I suspect it has to do with
> the aspect ratio and the orientation.
> E.g. it happens for x > y rotating ccw.
>
> The same thing happens somtimes with a left to right shift.
Hello Benjamin,
I think you have hit a documented feature, from jpegtran manpage:
The transpose transformation has no restrictions regarding image dimen-
sions. The other transformations operate rather oddly if the image
dimensions are not a multiple of the iMCU size (usually 8 or 16 pix-
els), because they can only transform complete blocks of DCT coeffi-
cient data in the desired way.
jpegtran's default behavior when transforming an odd-size image is
designed to preserve exact reversibility and mathematical consistency
of the transformation set. As stated, transpose is able to flip the
entire image area. Horizontal mirroring leaves any partial iMCU column
at the right edge untouched, but is able to flip all rows of the image.
Similarly, vertical mirroring leaves any partial iMCU row at the bottom
edge untouched, but is able to flip all columns. The other transforms
can be built up as sequences of transpose and flip operations; for con-
sistency, their actions on edge pixels are defined to be the same as
the end result of the corresponding transpose-and-flip sequence.
For practical use, you may prefer to discard any untransformable edge
pixels rather than having a strange-looking strip along the right
and/or bottom edges of a transformed image. To do this, add the -trim
switch:
-trim Drop non-transformable edge blocks.
If you are only interested by perfect transformation, add the -perfect
switch:
-perfect
Fails with an error if the transformation is not perfect. For
example you may want to do
(jpegtran -rot 90 -perfect foo.jpg || djpeg foo.jpg| pnmflip -r90 |
cjpeg)
to do a perfect rotation if available or an approximated one if
not.
Cheers,
--
Bill. <[EMAIL PROTECTED]>
Imagine a large red swirl here.
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]