Ano-Tech Computers
Enter keyword:

Perl, Image::Magick::Write and eval() don't go along under mod_perl
Problem:
An Image::Magick object created inside an eval() block works fine, but later using the Write() method outside the eval() only works outside of mod_perl. When used in a mod_perl environment it yields NULL.
 
Solution:
We have not yet succeeded in figuring out WHY this happens, but use the ImageToBlob() workaround instead of Write()

So, instead of

$canvas->Write(filename=>"-");

use

my $blob = $canvas->ImageToBlob();
print STDOUT $blob;

 
Discuss this solution
Did this article solve your problem? Yes No Did not apply

We welcome anyone who is willing to contribute to this public knowledge base, contact siteadmin@atc.no if you have information you would like to share. The idea is not to replace the commercial support sites, but to publish those hard-to-find solutions you've found yourself looking for over and over again.

Show all articles