best way to store binary image data in a variable using image magick
am 25.01.2008 07:17:29 von jack
Hi all,
Just wanted to know the code for doin this, such that I can use the
variable for doing other kinds of methods against it..
I tried this, and I can printout the binary data, but I am finding you
can assign the image data to a variable for further processing.. any
ideas ? I noticed that this line: $img->Write('jpg:-'); actually
displayed the image data, but how do I assign that binary data to a
variable ??
use Image::Magick;
my $img = new Image::Magick;
$x= $img->Read("c:\\tmp\\ean81.bmp");
## doesnt work: $img->Write('$temp');
Re: best way to store binary image data in a variable using image
am 25.01.2008 07:19:35 von jack
On Jan 24, 10:17=A0pm, Jack wrote:
> Hi all,
>
> Just wanted to know the code for doin this, such that I can use the
> variable for doing other kinds of methods against it..
>
> I tried this, and I can printout the binary data, but I am finding you
> can assign the image data to a variable for further processing.. any
> ideas ? =A0I noticed that this line: =A0 =A0$img->Write('jpg:-'); =A0 actu=
ally
> displayed the image data, but how do I assign that binary data to a
> variable ??
>
> use Image::Magick;
> my $img =3D new Image::Magick;
> $x=3D $img->Read("c:\\tmp\\ean81.bmp");
>
> ## doesnt work: =A0 =A0$img->Write('$temp');
Hi forgot to say when I print $img or $x I get ---
Image::Magick=3DARRAY(0x2260a4)
Re: best way to store binary image data in a variable using imagemagick
am 25.01.2008 11:59:07 von someone
Jack wrote:
>
> Just wanted to know the code for doin this, such that I can use the
> variable for doing other kinds of methods against it..
>
> I tried this, and I can printout the binary data, but I am finding you
> can assign the image data to a variable for further processing.. any
> ideas ? I noticed that this line: $img->Write('jpg:-'); actually
> displayed the image data, but how do I assign that binary data to a
> variable ??
>
> use Image::Magick;
> my $img = new Image::Magick;
> $x= $img->Read("c:\\tmp\\ean81.bmp");
>
> ## doesnt work: $img->Write('$temp');
Did you read their web page at:
http://www.imagemagick.org/script/perl-magick.php
Hint: ImageToBlob
John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall