JPEG lossless rotate, crop, flip with jpegtran
The jpegtran command line tool allows lossless transformations on JPEG images, including rotation, cropping, and flipping. This is particularly useful when you want to modify JPEG images without re-encoding them, which can lead to quality loss.
Example: lossless clockwise 90 degree rotation of a JPEG image “input.jpg” and save the result to file “output.jpg”:
jpegtran -rotate 90 input.jpg > output.jpg