php - 在 Imagemagick for linux 中,如何对目录进行批量转换

标签 php linux bash command imagemagick

我希望能够指定扫描位置和转换文件的位置。

只是有很多转换,我有一个脚本可以帮我排序。 目前我已经尝试过

convert -resize 300x300 >  /media/usbdisk1/development/ephoto/richard/images/gallery/2007/29/normal/*.jpg /media/usbdisk1/development/ephoto/richard/images/gallery/2007/29/tn_med/$1.jpg

for i in $( ls /media/usbdisk1/development/ephoto/richard/images/gallery/2007/29/normal); do  /usr/convert resize 360x360 > /media/usbdisk1/development/ephoto/richard/images/gallery/2007/29/normal/$i  /media/usbdisk1/development/ephoto/richard/images/gallery/2007/29/tn_med/$i done;

最佳答案

for i in $( ls /media/usbdisk1/development/ephoto/richard/images/gallery/2007/29/normal); do
    convert -resize 360x360 /media/usbdisk1/development/ephoto/richard/images/gallery/2007/29/normal/$i  /media/usbdisk1/development/ephoto/richard/images/gallery/2007/29/tn_med/$i;
done

知道了!

关于php - 在 Imagemagick for linux 中,如何对目录进行批量转换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3522820/

相关文章:

linux - tizen 和 Limo 之间的区别

linux - 如何使用 shell 脚本从 5 个数字中获取最大数字

php - 如何查找字符串中字符出现的数组

php - 在 <loc> 标记、站点地图索引文件中包含查询的 URL

php - 意外的T_CATCH,预期为T_FUNCTION

linux - 追加到前几行的开头和结尾

java - 如何从 Tomcat 中的 Web 应用程序在 Linux 中重启 Tomcat?

php - CakePHP:将计算字段从另一个模型连接到模型

java - ProcessBuilder 抛出异常 : Arguement contains =

C |静态数组: why does writing out-of-bounds not result in exception?