#!/usr/bin/perl -w use strict; use Imager; my $file = shift; my $img = Imager->new(file=>$file) or die Imager->errstr(); my $n = 1; my $sn = ''; my $name = ''; my $sc = 1; my $step = 0.1; for (my $x = 500; $x >=0; $x-=10) { $sc+=$step; if ($sc >= 3.0 || $sc <= 1.0) { $step = -($step); } $sn = sprintf('%02d', $n); $name = 'dest/newfile_' . $sn . '.jpeg'; $n++; print $name . " sc = " . $sc . "\n"; my $thumbc = $img->crop(left=>$x, width=>1200); my $thumbs = $thumbc->scale(scalefactor=>$sc); $thumbs->write(file=>$name); }