Centos7快速安装ImageMagick

一、安装依赖

yum install libjpeg
yum install libjpeg-devel
yum install libpng
yum install libpng-devel
yum install libtiff
yum install libtiff-devel
yum install libungif
yum install libungif-devel
yum install freetype
yum install zlib

二、安装ImageMagick

yum install ImageMagick -y

# 测试是否安装完成--查看是否有结果输出
convert -v

三、查找目录下大于10k的图片文件,压缩50%,图片质量压缩50%

find ./ -regex '.*(jpg|JPG|png|jpeg)' -size +10k -exec convert -resize 50%x50% -quality 70 {} {} \;

标签

发表评论