I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2010-06-23 08:41:32.811133-07 by dfr
Pasting svg into imager
Hi, many thanks for so nice piece of software. I recently tried to accomplish subject task with Imager and rsvg, but with no luck. Here is snippet of code:
my $rsvg = new Image::LibRSVG(); $rsvg->loadFromFile('pic.svg'); my $svgimage = Imager->new(data => $rsvg->getImageBitmap('png'), type => 'png'); $image->paste(img => $svgimage);
Last line leads to following error: Error applying effect: im is not of type Imager::ImgRaw at /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/Imager.pm line 701. I checked what kind of data getImageBitmap('png') returns and it appeared to be valid png stream, ready to save to disk as .png image. Any clue ?
Direct Responses: 12798 | Write a response
Posted on 2010-06-23 22:37:51.410755-07 by tonyc in response to 12794
Re: Pasting svg into imager

It's a bug in Imager, the new() method doesn't allow for reading from data.


As a workaround, create an empty Imager object and use the read() method:

# untested my $svgimage = Imager->new; $svgimage->read(data => $rsvg->getImageBitmap('png'), type => 'png') or die "Cannot read converted SVG image: ", $svgimage->errstr;
Direct Responses: Write a response