jpegtran优化而不更改文件名 [英] jpegtran optimize without changing filename

查看:90
本文介绍了jpegtran优化而不更改文件名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要优化一些图片,但不要更改名称。

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

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

然而,这似乎创建了一个0的文件大小。当我这样做时文件名,大小仍然完全相同。

However, this seems to create an filesize of 0. When i do it to a different filename, the size is still exactly the same.

推荐答案

怎么样:

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

我不是shell专家无论如何,但我认为使用你的原始命令,一旦执行,重定向就会被覆盖你的image.jpg。然后,当jpegtran尝试读取它时,它会找到一个空文件。

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.

这篇关于jpegtran优化而不更改文件名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆