Gossamer Forum
Home : General : Perl Programming :

[plz HELP me]imagemagick problem, $image->Read($var);

Quote Reply
[plz HELP me]imagemagick problem, $image->Read($var);
#i cannot read or write a image with any variable, how to fix this up? THX!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

$image = new Image::Magick;
$path = "C:\ImageMagick\$file";
$image->Read('$path');

$path = "C:\ImageMagick\$name\_thumb.$ext";
binmode STDOUT;
$image->Write('$path');

Last edited by:

Ginkan: Oct 4, 2007, 10:52 AM
Quote Reply
Re: [Ginkan] [plz HELP me]imagemagick problem, $image->Read($var); In reply to
Well I would guess it has something to do with the fact that you are using single quotes around $path which prevents interpolation. Remove them or use "$path"
Quote Reply
Re: [Wychwood] [plz HELP me]imagemagick problem, $image->Read($var); In reply to
i tried...
but wth i find is :

$image->Read("$path"); #not working
$image->Read('$path'); #not working
$image->Read("F:\abc\image.jpg"); #not working
$image->Read('F:\abc\image.jpg'); #WORK!!

Last edited by:

Ginkan: Oct 5, 2007, 7:06 AM
Quote Reply
Re: [Wychwood] [plz HELP me]imagemagick problem, $image->Read($var); In reply to
#i find the solve, the problem caused by the path,
#the path should be... :
$path = "F:\\\\abc\\image.jpg"