fileList=`find . -regex '.*\.PNG\|.*\.png\|.*\.TGA\|.*\.tga'`
for file in $fileList
do
echo "$file"
fileW=`identify -format "%w" $file`
fileH=`identify -format "%h" $file`
if [ $fileW == 256 ] || [ $fileH == 256 ]
then
convert -resize 256x256! $file $file
continue
fi
if [ $fileW == 128 ] || [ $fileH == 128 ]
then
convert -resize 128x128! $file $file
continue
fi
if [ $fileW == 64 ] || [ $fileH == 64 ]
then
convert -resize 64x64! $file $file
continue
fi
done
Shell 结合 imagemagick
最新推荐文章于 2024-04-28 09:45:00 发布