VSIDO Community

VSIDO Support => Scripts and How To's => How To's => Topic started by: lwfitz on June 20, 2013, 08:31:58 AM

Title: How To - Mass Resize Images
Post by: lwfitz on June 20, 2013, 08:31:58 AM
While creating a gallery on a website I had to find a way to mass resize my images to create thumbnails and this is what I came up with.

First, if you dont have imagemagick installed then you will need to run

sudo apt-get install imagemagick

First we need to create a directory for our thumbnails

mkdir ~/thumbs

Then create a copy of the images we want to resize and place them in ~/thumbs

cp ~/gallery_images/* ~/gallery_images/thumbs/

Then cd to our thumbs folder

cd ~/thumbs

Now we can resize all the images in our thumbs folder using the mogrify command
As far as I know this will work with all image types (png, gif, jpg, jpeg... etc)

This will keep the aspect ratio

mogrify -resize 250 *.jpg

If you want to force resizing without maintaining the aspect ratio you can run
the command using a specific size such as

mogrify -resize 640×480! *.jpg

Thats it. Hope this helps someone.
Title: Re: How To - Mass Resize Images
Post by: VastOne on June 20, 2013, 11:33:35 AM
Very nice How To lwfitz, useful!

imagemagick is a stock install on VSIDO and/or it can be pulled in from vsido-welcome
Title: Re: How To - Mass Resize Images
Post by: lwfitz on June 20, 2013, 11:33:36 PM
Thanks!

Yeah I know its stock on VSIDO but Im hoping someone else (not using VSIDO) may read it someday  ;D
Title: Re: How To - Mass Resize Images
Post by: VastOne on June 24, 2013, 03:32:00 AM
^ Good idea...

Thanks lwfitz!
Title: Re: How To - Mass Resize Images
Post by: Digit on October 01, 2013, 09:29:20 PM
good tip there.

also may want to check out the convert command from imagemagick too.

would be nice if one day we have so many imagemagick tips here that we end up needing a whole forum section dedicated to it.   ... a guy can dream.  :)