Cleanup JPG using jpegtran

Package

Gentoo
media-libs/jpeg

Singe file

$ jpegtran -copy none -optimize -perfect -outfile output.jpg input.jpg
-copy none
Copy no extra markers from source file.
-optimize
Perform optimization of entropy encoding parameters.
-perfect
Fails with an error if the transformation is not perfect.

Batch

#!/bin/bash

TIME=/tmp/TMP_DATETIME

for F in *
do
    echo $F
    touch "$TIME" -r "$F"
    #jpegtran -grayscale -copy none -optimize -perfect -outfile "$F" "$F"
    jpegtran            -copy none -optimize -perfect -outfile "$F" "$F"
    touch "$F" -r "$TIME"
done
jpg
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.