Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > best way to store binary image data in a variable using image magick

Reply
Thread Tools

best way to store binary image data in a variable using image magick

 
 
Jack
Guest
Posts: n/a
 
      01-25-2008
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');
 
Reply With Quote
 
 
 
 
Jack
Guest
Posts: n/a
 
      01-25-2008
On Jan 24, 10:17*pm, Jack <jack_posem...@yahoo.com> 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 ? *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');


Hi forgot to say when I print $img or $x I get ---
Image::Magick=ARRAY(0x2260a4)
 
Reply With Quote
 
 
 
 
John W. Krahn
Guest
Posts: n/a
 
      01-25-2008
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Store and retrieve binary data (pdf doc etc) in sqlserver2005 using asp.net 2.0 Karl ASP .Net 3 10-07-2009 08:11 AM
store Images (or any Binary Data) to a SQL Server database using VC++ Universal C++ 1 04-08-2005 10:23 AM
store Images (or any Binary Data) to a SQL Server database using VC++ Universal C++ 0 04-08-2005 10:01 AM
snippet using Image::Magick Sharpen() ? dan baker Perl Misc 0 06-21-2004 10:42 PM
Image::Magick and Tk::Photo Eric McDaniel Perl 2 09-20-2003 08:01 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57