in reply to Re: reading image blob w/Image::Magick
in thread reading image blob w/Image::Magick

the objects provided by modules like IO::Scalar are not backed by real file descriptors at the OS level, and so, they can not be passed to C functions requiring open files as arguments (unless those functions have been modified to use PerlIO, but this is quite rare).
  • Comment on Re^2: reading image blob w/Image::Magick

Replies are listed 'Best First'.
Re^3: reading image blob w/Image::Magick
by davidrw (Prior) on Apr 16, 2006 at 22:02 UTC
    Image::Magick can read from perl filehandles though:
    $image = Image::Magick->new; open(IMAGE, 'image.gif'); $image->Read(file=>\*IMAGE); close(IMAGE);
    despite that, IO::Scalar wouldn't work?
      open(IMAGE, 'image.gif') opens a real file using the OS services but IO::Scalar objects exists only inside perl.

      You can see the difference using the fileno() builtin:

      open IMAGE, "image.gif"; printf "fn: %d\n", fileno(IMAGE); my $ios = IO::Scalar->new; printf "fn: %d\n", fileno($ios);