Hi all
Can anyone tell my why the following doesn't work?

Code:
#!/usr/bin/perl

use CGI::Carp qw(fatalsToBrowser);
use CGI;
use Image::Magick;

$cgi=new CGI;

$filename = "myimage.jpg";
$thumbfilename = "t_image.jpg";

$image = Image::Magick->new;
open(IMAGE,"$filename");
$image->Read(file=>\*IMAGE);
close(IMAGE);

$image->Resize(width=>'130', height=>'130', filter=>'Bessel');

open(IMAGE,">$thumbfilename");
$image->Write(file=>\*IMAGE, filename=>$thumbfilename);
close(IMAGE);

print $cgi->header();
print "done!<BR><BR>";
print "<IMG SRC=\"$thumbfilename\" BORDER=1>";
But when I put the 'print $cgi->header();' line above the Image::Magick routines it works?

I will be extremely grateful for any help whatsoever

Cheers in advance