#! /usr/bin/perl -w use strict; use Image::Magick; my $img = Image::Magick->new; my $filename=""; my $num_frames=0; my (@pfad,$pfad); foreach (@ARGV) { @pfad = split("/",$_); $filename = pop(@pfad); $pfad = join("/",@pfad); $img->Read($pfad."/".$filename); $num_frames = scalar @$img; print "Number of frames: $num_frames\n"; $#$img = 0; my ($w,$h) = $img->Get("width","height"); print "Width: $w\nHeight: $h\n"; my $x=$w/80; if(($h/$x) > 80) { $x = $h/80;} print "New size:\nWidth: ".($w/$x)."\nHeight: ".($h/$x)."\n"; $img->Resize(width=>($w/$x),height=>($h/$x)); $img->Write($pfad."/thm_".$filename); }