shell-批量裁剪各个尺寸的图教程一(执行裁剪批量生成对应尺寸图片)

接回上一篇《shell-批量裁剪各个尺寸的图教程一(ImageMagick安装配置)》

我的需求

本地有几百张原图,尺寸大小不清楚,在这些原图基础上进行裁剪,生成一批230x80尺寸的素材图。

目录结构

以下是脚本

#!/bin/bash
#/usr/local/bin/bin/convert image/photos9.jpg -gravity southeast -crop 230x80+50+60 dest/dest2.jpg
image='/data/BAK/image'
out='/data/BAK/dest'
chicun='230x80'
for file in `ls /data/BAK/image/`
do
        echo $file
        /usr/local/bin/bin/convert $image/$file -gravity southeast -crop $chicun+50+60 $out/$file
done

猜你喜欢

转载自blog.csdn.net/sincool1003/article/details/82911902
今日推荐