I suspect the problem is that the includes a mandatory rotation in the Exif data and that jpegoptim strips it out:
$ file before.jpg before.jpg: JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, Exif Standard: [TIFF image data, little-endian, direntries=11, manufacturer=Panasonic, model=DMC-SZ10, orientation=upper-right, xresolution=166, yresolution=174, resolutionunit=2, software=Shotwell 0.22.0], baseline, precision 8, 2302x2121, frames 3
$ cp before.jpg after.jpg $ jpegoptim --strip-all after.jpg after.jpg 2302x2121 24bit N Exif XMP JFIF [OK] 740417 --> 728927 bytes (1.55%), optimized.
$ file after.jpg after.jpg: JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, baseline, precision 8, 2302x2121, frames 3
I suspect the problem is that the includes a mandatory rotation in the Exif data and that jpegoptim strips it out:
$ file before.jpg Panasonic, model=DMC-SZ10, orientation= upper-right, xresolution=166, yresolution=174, resolutionunit=2, software=Shotwell 0.22.0], baseline, precision 8, 2302x2121, frames 3
before.jpg: JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, Exif Standard: [TIFF image data, little-endian, direntries=11, manufacturer=
$ cp before.jpg after.jpg
$ jpegoptim --strip-all after.jpg
after.jpg 2302x2121 24bit N Exif XMP JFIF [OK] 740417 --> 728927 bytes (1.55%), optimized.
$ file after.jpg
after.jpg: JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, baseline, precision 8, 2302x2121, frames 3