This script create a thumbnail with width 100 of each png file in the actual directory.
#!/bin/sh
for i in *.png
do
echo "convert -thumbnail 100 $i $i"
convert -thumbnail 100 $i $i
done
This script create a thumbnail with width 100 of each png file in the actual directory.
#!/bin/sh
for i in *.png
do
echo "convert -thumbnail 100 $i $i"
convert -thumbnail 100 $i $i
done
Para fazer isto em uma única linha:
convert -quality 70 -resize 10% *.jpg images.jpg
Para fazer uma montagem
montage *.jpg -shadow -geometry +10+10 montagem.jpg
Para mais detalhes:
* http://linuxdicas.wikispaces.com/imagemagick
Sérgio, valeu, era isso mesmo que eu estava procurando quando fiz esse script.
A little hint: if you are using wp_get_attachment_image_src() ftuncion with size and want to get exact thumbnail size: use thumbnail name given in definition (function add_image_size()). If you use array with dimensions WP will use first image size that have proper width or height. So you may get wrong image. Example: instead of 156×98 you might have got 120×98 if you have 2 images defined: 156×98 & 120×98 (height is the same). I fell for it once 😉 Oct 16 ’11 at 15:15