#!/usr/bin/perl -w use strict; use Image::Magick; use File::Glob qw(:globally :nocase); use File::Basename; use CGI; my $realdir = qw( /var/www/html/thumbnailer/images/ ); # The dir that holds the origional images my @ext = qw( jpg png gif); # Image extentions to look for my $savedir = qw( /var/www/html/thumbnailer/thumbs/ ); # Dir to save thumbnails my $serverdir = qw( /thumbnailer/ ); # Relative server-path my $thumbdir = qw( thumbs/ ); # Holds the thumbnails for the webpage my $imagedir = qw( images/ ); # Holds the real images for the webpage my $x_size = 150; # Size in pixels. my $y_size = 150; # Size in pixels. my $resize = 1; # Resize before crop. my $aspect_S = 0.5; # Only reseze if aspect-ratio is above this value, else thumbnail becomes to blurred. my $aspect_H = 2; # Only resize if aspect-ratio is below this value, else thumbnaik becomes to blurred. my $overwrite = 0; # Allways remake (overwrite) the thumbnails. my $cols = 5; # Max horizontal thumbs. my $rows = 10; # Max vertical thumbs. my $cgi = new CGI; main(); cleanUp(); sub main { my $content = "