maj 12 2009

ImageMagick, mogrify -resize

LinuxSzybko potrzebowałem zmienić rozmiar wielu plików na serwerze, ale tylko tych większych niż 700px. Po chwili poszukiwań znalazłem problem udało się rozwiązać:

# apt-get install imagemagick

# mogrify -resize 700> *.jpg

Tutaj mały wyciąg z dokumentacji ImageMagick:

Only Shrink Larger Images (‘>‘ flag)
Another commonly used option is to restrict IM so that it will only shrink images to fit into the size given.   Never enlarge.   This is the ‘>‘ resize option. Think of it only applying the resize to images ‘greater than’ the size given (its a little counter intuitive).