jpegtran optimize without changing filename

后端 未结 6 2050
囚心锁ツ
囚心锁ツ 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:28

    how about:

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

    I'm not a shell expert by any means, but I think that with your original command, as soon as it is executed, the redirect is set up which overwrites your image.jpg. Then when jpegtran tries to read it in it finds an empty file.

提交回复
热议问题