Rotated images are corrupted by having a strip a few pixels wide transferred from one edge of the graphic to the other edge. Reproducible: Sometimes Steps to Reproduce: 1. Use "jpegtran -rotate 90 infile.jpg > outfile.jpg" Actual Results: outfile.jpg is properly rotated, but a strip along one edge is likely to be misplaced (transferred from the opposite edge). I've used both XV and the GIMP to view the rotated images, and both show the problem. Expected Results: The image should be rotated without corruption. I've placed a sample input file at http://www.rodsbooks.com/sample.jpg. This file definitely shows the problem, as do others I've tested. Not all rotations produce this problem, but I haven't tracked down the precise conditions that create it.
Created attachment 61000 [details] Sample graphic that demonstrates the problem after rotation
try jpeg-6b-r6 please
This is regular behaviour on the part of jpegtran. From the man page: 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. So, add -trim if you want to use jpegtran and don't want your images to look weird :)