# Mine's too big...



## nsmith1957 (Sep 7, 2006)

Use photo editing software to resize the pictures.


----------



## drobbins (Jun 1, 2005)

if you don't have software to do it the gimp is a nice free tool

http://www.gimp.org/

Dave


----------



## kawayanan (Aug 11, 2006)

I'll second the Gimp comment. I use it to crop and resize my pictures, and it will do a lot more. I usually choose it over Photoshop which I also have access too.

If you simply want to resize pictures for the web and have a fast internet connection, many photo hosting services will resize them for you. I use photobucket, and have it set so that it will resize anything I upload to 800x600. If you do it that way, you still have to upload the full size picture (could be a few megs vs a few 100k for a 800x600). For uploading a bunch of photos, that can mean a large difference. I need write a script to batch resize pictures before uploading, that would save some time.


----------



## drobbins (Jun 1, 2005)

kawayanan

I get the impression you're using linux
check out mogrify
great for batch processing pics

Dave


----------



## kawayanan (Aug 11, 2006)

I use both Linux and Windows (my wife is used to Win, and I still play games there too sometimes).

mogrify is part of ImageMagick and once you reminded me of it I realized I have already written a script that does it.  ImageMagick interfaces well with lots of languages. I had used it in a perl script I wrote a long time ago to take a directory of photos, make thumbnails, and write a HTML page displaying them (an automated website update type thing). Now I just have to find it. 

ImageMagick is also available on Windows and so is perl (ActivePerl). If I can find the script, maybe I put it up somewhere so if anyone wants they can use it (just don't laugh at my ugly perl - I'm self taught  )


----------



## drobbins (Jun 1, 2005)

>>just don't laugh at my ugly perl - I'm self taught

I wasn't aware there was any other kind of perl

Dave


----------



## kawayanan (Aug 11, 2006)

Ok, if anyone is interested, I found my old script and edited it so that it just makes a 160x120 thumbnail and 800x600 resized image. It will do this for any jpg in the directory it is run in. If you need to resize a lot of pictures, it will make the job much easier. 

This will run on windows as long as you have two things installed. You need Imagmagick and ActivePerl. I think it should also run an any other platform that has both perl and Imagemagick installed. 

Here is the text of the script. You can just copy this text into a normal text file and name it resize.pl (or whatever you want ending with .pl)


```
#
use Image::Magick ;
@jpgs = <*.JPG> ;
mkdir "thumbs" ;
mkdir "800x600" ;
$pic_num = $#jpgs ;
$pic_count = $pic_num +1 ;
for ($a = 0 ; $a <= $pic_num ; $a++){
    $count = $a +1 ;
    $thumbname = "thumbs/$jpgs[$a]" ;
    $resize = "800x600/$jpgs[$a]" ;
    print "Working on $thumbname ($count of $pic_count)\n" ;
    $x = $thumb = Image::Magick->new ;
    $x = $thumb->Read($jpgs[$a]) ;
    $x = $thumb->Thumbnail('160x160') ;
    $x = $thumb->Write($thumbname) ;
    $y = $image = Image::Magick->new ;
    $y = $image->Read($jpgs[$a]) ;
    $y = $image->Resize('800x800') ;
    $y = $image->Write($resize) ;
}
```
It assumes that your jpeg images are named "xxxxx.*JPG*". If your images use lowercase file extensions (xxxx.*jpg*), you will need to change the line "@jpgs = <*.*JPG*> ;" to "@jpgs = <*.*jpg*> ;" Imagemagick is also smart enough to handle images that are rotated (meaning 800x600 vs 600x800). What it will actually do is make a thumbnail that is 160 pixels on its longest side and a resized image that is 800 pixels on its longest side. The aspect ratio will be conserved. If you want the thumbnails or images to be a different size, just change the "Resize('800x800')" or "Thumbnail('160x160')" to what you want.

Kawayanan


----------



## hummingberd (Aug 26, 2006)

thanks guys!


-K-


----------

