This is caused by the lossless rotation algorithm used in libjpeg.
Rotating in the reverse direction will make the margin go away.

From libjpeg (man 1 jpegtran), which is used for the rotation:
> 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.
>
> jpegtran's  default behavior when transforming an odd-size image is designed
> to preserve exact reversibility and mathematical consistency of the trans‐
> formation 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 consistency, their actions  on  edge
> pixels are defined to be the same as the end result of the corresponding
> transpose-and-flip sequence.

Attachment: signature.asc
Description: Digital signature

Reply via email to