Hello. El Sábado 19 Enero 2002 15:06, Johannes Liedtke escribió:
Hi,
can anybody here point me in a direction where to start looking for commandline tools to manipulate jpg-images on the commandline?
You need to have installed the convert commandfrom the imagemagick package. put this into a file called jpgresize.sh and make a subdirectory named sized on the directory where the images lies #!/bin/sh # Script to resize jpg images # it converts all files into the directory # the new files will be in a directory called sized list=`ls *jpg` for i in $list do file=${i##*/} base=${file%%.*} convert -geometry x150 $base.jpg sized/$base.jpg done echo Done
What I want to do is this: I need to resize large numbers of jpg-files using a script or sth. It should take the longest side of an image and resize it to a given (pixel) length while resizing the other side accordingly at the same rate...
this script resizes based on the height it makes the new images 150 pixels height and resize the width mantaining the image aspect, if you want another size change the x150 by the number you want, if you want to base on the width xhange the x150 by only the new width (ie 120) this script is also valid for changing the image format, you only need to change the destination name to $base.gif to obtain the images in .gif format. sell also man convert to obtains more information
thanx in advance for any suggestions, Johannes
-- Greetings Carlos Lorenzo Mates