perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Dyer-Bennet <d...@dd-b.net>
Subject Flakey behavior
Date Sat, 13 Nov 2004 04:36:22 GMT
I'm running into flakoid behavior in a script that uses Image::EXIF to
read file information under mod_perl (via Apache::Registry).
Sometimes, without throwing any error or setting the internal error
variable, Image::EXIF reads nothing from the file.  I can't correlate
it with anything; a random string of reloads will start producing
different results at a random point. 

I've got other scripts running under mod_perl with Apache::Registry;
in fact this started out being an extension to a piece of my photo
gallery, and the other half, that reads IPTC information via
Image::IPTCInfo, works fine.  

Any clues?  Limitations under mod_perl or Apache::Registry I'm
forgetting?  Known problems with Image::EXIF (which I notice is built
over a command-line utility; is the attempt to run the sub-process
where the error is occurring?)?  Suggested alternate ways to get EXIF
information from an image file in mod_perl?

Here's the current test script, very much reduced from the application
that initially turned up this behavior:

#! /usr/bin/perl

# Testing Testing Testing

use strict;
use warnings;

use Apache::Util;
use Image::EXIF;
use CGI;
use Data::Dumper;

use CGI::Carp 'fatalsToBrowser';
$CGI::POST_MAX = 5000;
$CGI::DISABLE_UPLOADS = 1;
my $q = new CGI;

my $dir = "/web/dd-b/SnapshotAlbum/data/2004/09180-Birthday";

chdir ($dir) || die "Can't chdir to $dir";

my $fn = $q->param('fn');
die "No such file as $fn" unless -r $fn;

my @res = ();

my $exif = new Image::EXIF ($fn);
push @res, "File: ", $fn;
push @res, "Exif error: $exif->error errstr: ", $exif->errstr;
push @res, "Exif dump: ", Dumper ($exif);
push @res, "Exif data dump: ", Dumper ($exif->get_all_info());
push @res, "Exif error: $exif->error errstr: ", $exif->errstr;

print $q->header,
    $q->start_html('test');
print $q->pre(join ("\n", @res));
print $q->end_html;

$exif = undef;
$q = undef;

-- 
David Dyer-Bennet, <mailto:dd-b@dd-b.net>, <http://www.dd-b.net/dd-b/>
RKBA: <http://noguns-nomoney.com/> <http://www.dd-b.net/carry/>
Pics: <http://dd-b.lighthunters.net/> <http://www.dd-b.net/dd-b/SnapshotAlbum/>
Dragaera/Steven Brust: <http://dragaera.info/>

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Mime
View raw message