in reply to CGI::upload and Image::Magick

$fh is a filehandle and that is what Read requires. Not a reference to it.

Try
$thumb->Read( file => $fh ) or die "No read to Image::Magick obj: $! +\n";

Replies are listed 'Best First'.
Re: Re: CGI::upload and Image::Magick
by geektron (Curate) on Aug 18, 2003 at 16:35 UTC
    right, $fh is already a filehandle. in fact, that wasn't the problem.

    Image::Magick::Read has no return value, so any code like:

           $th->Read( file => $fh ) or die ....

    will fail, because the LHS will never get set to 1.

    this stumped me for a couple days, until i started thinking about why $! wasn't set. that was the clue as to why things didn't work.

Re: Re: CGI::upload and Image::Magick
by geektron (Curate) on Aug 18, 2003 at 15:53 UTC
    well, i'd already tried that as well, but tried it again. it doesn't work ...

    from the error-log:

    Creating /webcontent/server_home/rentsavers/images/4/map.jpg opening --> map.jpg [Mon Aug 18 10:48:39 2003] [error] No read to Image::Magick obj *:

    need to go back through Image::Magick docs to see why  $! isn't being set.