(none) imager-devel
/ help / lists / applications / search /

Re: mod_perl env problem?

From: Tony Cook (
Date: Mon 03 Feb 2003 - 23:01:35 GMT

  • Next message: Arthur Bergman: "Re: mod_perl env problem?"

    On Mon, Feb 03, 2003 at 10:03:27AM -0800, 07092@xyz.molar.is wrote:
    > Hi developers,
    > My question is basically, does Imager have any problems working in the
    > mod_perl/apache environment? I'm running:
    > RH 7.3 linux i586
    > apache 1.27 (stable, built from source)
    > mod_perl 1.27 (stable, built from source)
    > libjpeg 6.x (comes with RH 7.3 install)
    > libjpeg-devel 6.x (comes with RH 7.3 linux install)
    > DBI, CGI, etc...
    I believe Artur is running Imager under mod_perl.

    > There's nothing unusual about the configuration. The script below, outputs
    > this error message:
    > (mod_perl environment)
    > "unable to read jpeg file..."

    You might get more information by setting Imager to use a log file. Any
    libjpeg error messages should then be sent to the log file.

       Imager::init_log($name_of_log_file, 1);

    There's a lot of information in the log file, so you will need to wade
    through it.

    > However, when I kick off the script from the command line (perl 5.8.0), I
    > get no errors and it seems that everything is okay. Could it be that I
    > need to tweak something in my http.conf file? BTW, Imager is a pretty
    > nifty module and well documented.
    > #!/usr/bin/perl -w
    > use strict;
    > use CGI;
    > use DBI;
    > ...
    > use Imager;
    > my $img = Imager->new();
    > $img->open(file=>$file,type=>'jpeg') or die $img->errstr();

    I just did a simple local test, and managed to read a jpeg from
    mod_perl, using the following HTML::Mason component:

    Just to see if we can load jpeg images into mod perl.
    <p><% $msg |h %></p>
    use Imager;

    my $im = Imager->new;
    my $msg = "Read jpeg";
    $im->read(file=>'/somepath/barbarian.jpg', type=>'jpeg')
      or $msg = "Error reading jpeg";