Skip Menu |
 

This queue is for tickets about the CGI-Application-PhotoGallery CPAN distribution.

Report information
The Basics
Id: 30317
Status: resolved
Priority: 0/
Queue: CGI-Application-PhotoGallery

People
Owner: Nobody in particular
Requestors: tlhackque [...] yahoo.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.07
Fixed in: 0.08



Subject: IfModified parse problem
Download (untitled) / with headers
text/plain 732b
Logs errors trying to check thumbnail cache modification date. Seems to hit all files; extracted just one below for brevity apache error log: [Sun Oct 28 10:50:54 2007] [error] [client 192.168.148.108] Argument "Thu, 01 Jan 1970 00:00:00 GMT; length=2051" isn't numeric in numeric eq (==) at /usr/lib/perl5/site_perl/5.8.8/CGI/Application/PhotoGallery.pm line 372., referer: https://gallery.foo.baz/gallery.cgi Apache access log 192.168.148.108 - AuthorizedUser [28/Oct/2007:10:50:52 - 0400] "GET /gallery.cgi?mode=thumb&photo=%2FPICT0006.JPG HTTP/1.1" 200 2051 This is perl, v5.8.8 built for i386-linux-thread-multi uname -a Linux xx.foo.baz 2.6.22.2-42.fc6 #1 SMP Wed Aug 15 12:34:26 EDT 2007 i686 i686 i386 GNU/Linux
Subject: FW: [rt.cpan.org #30317] IfModified parse problem - and some other bug fixes
Date: Thu, 31 Jan 2008 10:43:47 -0800 (PST)
To: bug-CGI-Application-PhotoGallery [...] rt.cpan.org
From: tlhackque <tlhackque [...] yahoo.com>
Download (untitled) / with headers
text/plain 3.6k
Should have copied the attached to the list. Hope the attached patches are useful to others. --------------------------------------------------------- This communication may not represent my employer's views, if any, on the matters discussed. Show quoted text
-----Original Message----- From: tlhackque Sent: Saturday, January 05, 2008 18:20 To: Brian Cassidy Subject: RE: [rt.cpan.org #30317] IfModified parse problem - and some other bug fixes I apologize for the VERY late response; I was swamped for a while & then the afflicted system was unavailable & the user went away... Yes, this fixes the problem. Many thanks. In testing this, I also noticed another couple of divots. 1) When there are any directories containing no images in the photo_dir tree, things get very confused. You assume that the gallery stack has an entry for the top level, but fail to push it if it's empty. Things go badly down hill as you pop something else. 2) You return files (and galleries) in the filesystem order. People expect some predictable order. Best to sort. Patches for these are below, applied in the attached .tar file. Also, my previous patch, which allows one to set a maximum size for a displayed image. Hope these are useful. Apologies again for being soo slow. T diff CGI-Application-PhotoGallery-0.08/lib/CGI/Application/PhotoGallery.pm PhotoGallery.pm 159c159 < our $VERSION = '0.08'; ---
> our $VERSION = '0.08t';
306c306,310 < my @dirs = File::Find::Rule->directory->maxdepth( 1 )->in( $directory ); ---
> die( "$directory is not a directory" ) unless -d
$directory;
> > my @dirs = File::Find::Rule->directory ->
mindepth( 1 )
> ->
maxdepth( 1 )->in( $directory );
> @dirs = sort @dirs;
309c313 < for my $dir ( @dirs ) { ---
> for my $dir ( $directory, @dirs ) {
311c315 < $self->get_photos( $dir ); ---
> $self->get_photos( $dir );
313c317,318 < if ( $dir ne $dirs[ 0 ] ) { ---
> @files = sort { $$a{filename} cmp
$$b{filename} } @files;
> if ( $dir ne $directory ) {
319c324 < { ---
> {
324c329 < if @files; ---
> if @files || ($dir eq $directory);
473a479,488
> if( defined $self->param( 'max_width' ) ) { > my $max_width = $self->param( 'max_width' ); > > if( $width > $max_width ) { > my $scale = $max_width / $width; > $width = int($width * $scale); > $height = int($height * $scale); > } > } >
--------------------------------------------------------- This communication may not represent my employer's views, if any, on the matters discussed.
-----Original Message----- From: Brian Cassidy [mailto:brian.cassidy@gmail.com] Sent: Monday, October 29, 2007 22:11 To: tlhackque@yahoo.com Subject: Re: [rt.cpan.org #30317] IfModified parse problem On 10/28/07, via RT <bug-CGI-Application-PhotoGallery@rt.cpan.org> wrote:
> Logs errors trying to check thumbnail cache
modification date. Seems
> to hit all files; extracted just one below for
brevity
> > apache error log: > [Sun Oct 28 10:50:54 2007] [error] [client
192.168.148.108] Argument
> "Thu, 01 Jan 1970 00:00:00 GMT; length=2051" isn't
numeric in numeric
> eq (==) at >
/usr/lib/perl5/site_perl/5.8.8/CGI/Application/PhotoGallery.pm line Ah, it must be my non-parsing of HTTP dates coming back to bite me. Attached is a potential fix that uses HTTP::Date. Can you test it out for me? -Brian
____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
Download PhotoGallery8t.tar.gz
application/x-gzip 4.1k

Message body not shown because it is not plain text.

Done. Version 0.09 should hit CPAN shortly.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.