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

Discussion in 'Perl Misc' started by Jack, Jan 25, 2008.

  1. Jack

    Jack Guest

    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');
     
    Jack, Jan 25, 2008
    #1
    1. Advertising

  2. Jack

    Jack Guest

    Re: best way to store binary image data in a variable using imagemagick

    On Jan 24, 10:17 pm, 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 ?  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)
     
    Jack, Jan 25, 2008
    #2
    1. Advertising

  3. Re: best way to store binary image data in a variable using imagemagick

    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
     
    John W. Krahn, Jan 25, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Eric McDaniel

    Image::Magick and Tk::Photo

    Eric McDaniel, Aug 30, 2003, in forum: Perl
    Replies:
    2
    Views:
    1,649
    Joseph Brenner
    Sep 20, 2003
  2. Weapons of Mass Destruction

    Trying to get Image::Magick to work on a remote server

    Weapons of Mass Destruction, Nov 15, 2003, in forum: Perl
    Replies:
    3
    Views:
    555
    Gunnar Hjalmarsson
    Nov 15, 2003
  3. achalk
    Replies:
    13
    Views:
    1,045
    Nick Keighley
    Dec 30, 2010
  4. Luis Esteban Valencia

    Best Way to store simple data with web service?

    Luis Esteban Valencia, Jan 17, 2005, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    149
    Luis Esteban Valencia
    Jan 17, 2005
  5. dan baker

    snippet using Image::Magick Sharpen() ?

    dan baker, Jun 21, 2004, in forum: Perl Misc
    Replies:
    0
    Views:
    153
    dan baker
    Jun 21, 2004
Loading...

Share This Page