# Now make a thumbnail the size of the selected SIZE my $thumbnail = new GD::Image($W,$H); # Read in jpg $image = GD::Image->newFromJpeg($IMAGE{'Pathfile'}); # GD $image->copyResized($sourceImage,$dstX,$dstY,$srcX,$srcY,$destW,$destH,$srcW,$srcH) $thumbnail->copyResized($image, 0, 0, 0, 0, $W, $H, $IMAGE{'Width'}, $IMAGE{'Height'}); # Get the resized image as a jpg $thumbdata = $thumbnail->jpeg();