【发布时间】:2020-07-13 11:01:00
【问题描述】:
我试图批量降低系统上存储在该位置的某些图像的质量
~/sandboxArea/MainCam
然后我运行了以下命令
for i in $(ls ~/sandboxArea/MainCam); do convert $i -quality 30 ~/sandboxArea/converted/$i; done
上面的命令奏效了,所有文件都先缩小了大小,然后放入“~sandboxArea/converted”文件夹中
然后我再次尝试降低存储在该位置的图像质量
~/sandboxArea/SecondCam
并在进行如下所需更改后运行上述命令
for k in $(ls ~/sandboxArea/SecondCam); do convert $k -quality 30 ~/sandboxArea/convertedB/$k; done
它给了我以下错误:
convert-im6.q16: no images defined `/home/mohit/sandboxArea/convertedB/IMG_5682.JPG' @ error/convert.c/ConvertImageCommand/3258.
convert-im6.q16: unable to open image `IMG_5683.JPG': No such file or directory @ error/blob.c/OpenBlob/2701.
convert-im6.q16: no images defined `/home/mohit/sandboxArea/convertedB/IMG_5683.JPG' @ error/convert.c/ConvertImageCommand/3258.
convert-im6.q16: unable to open image `IMG_5684.JPG': No such file or directory @ error/blob.c/OpenBlob/2701.
convert-im6.q16: no images defined `/home/mohit/sandboxArea/convertedB/IMG_5684.JPG' @ error/convert.c/ConvertImageCommand/3258.
convert-im6.q16: unable to open image `IMG_5685.JPG': No such file or directory @ error/blob.c/OpenBlob/2701.
convert-im6.q16: no images defined `/home/mohit/sandboxArea/convertedB/IMG_5685.JPG' @ error/convert.c/ConvertImageCommand/3258.
我尝试了多种方法来解决这个问题,也检查了 imagemagic.org 的官方网站,但没有提到这个问题。
这是一个错误吗?由于此命令工作过一次但无法再次工作。
另外,我删除了之前保存在“converted”文件夹中的文件,以检查该命令是否会再次起作用。它也在那里失败了。因此,同一命令一次有效,另一次无效。
有人可以帮忙吗?我有大约 8000 多张图片,每张大约 7-9MB,所有这些图片都占用了大量空间。只是想在我的硬盘上节省一些空间
提前致谢。如果有人需要更多说明,请告诉我。 谢谢
【问题讨论】:
标签: linux shell ubuntu terminal imagemagick-convert