jpegtran optimize without changing filename

后端 未结 6 1982
囚心锁ツ
囚心锁ツ 2021-02-05 06:42

I need to optimize some images, but not change their name.

jpegtran -copy none -optimize image.jpg > image.jpg 

However, this seems to crea

6条回答
  •  一生所求
    2021-02-05 07:31

    I did it in three lines:

    jpegtran -optimize image.jpg > image.jpg-opt
    cp image.jpg-opt image.jpg
    rm image.jpg-opt
    

    Works well.

    [edit:] This works only for one file at a time.

提交回复
热议问题