Jamyy's Weblog

ImageMagick : Convert 批次調整圖片大小

by Jamyy on 十二月.13, 2011, under Linux

yum install ImageMagick

#寬度若超過 1024px 則縮小寬度為 1024px
find /path/to/photos -type f -exec convert {} -resize "1024>" {} \;

#高度若超過 1024px 則縮小高度為 1024px
find /path/to/photos -type f -exec convert {} -resize "x1024>" {} \;

#最長邊只允許 1024px
find /path/to/photos -type f -exec convert {} -resize "1024>x1024>" {} \;

find /path/to/photos -type f -exec convert {} -resize 1024x1024\> {} \;

更多範例: ImageMagick v6 Examples -- Resize or Scaling



:,

1 Trackback or Pingback for this entry