Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Journal of LTjake (4001)

Tuesday September 13, 2005
07:53 AM

CGI::Application::PhotoGallery 0.05 released

[ #26706 ]

I've neglected it for over 2 years but (finally) I've done some updates to my first CPAN module: CGI::Application::PhotoGallery

Updates of interest:

  • using Cache::FileCache rather than my (horrible) caching scheme
  • HTTP caching (Last-Modified => If-Modified-Since)
  • no more thumbnail size restrictions
  • captions are stored in 1 file only
  • using File::Find::Rule and MIME::Types to find and pick out images
  • no more gallery structure limitations - point it at a directory and it will find photos and photos in any sub-directory (and it will do so recursively as you navigate)
  • nicer looking templates -- now with 100% fewer tables

Even though I've added some extra dependencies, I'm very happy with the end result.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Someone asked me about web photo catalogue software earlier today. While checking something else on CPAN I spotted your module. I saw it last time I looked for a photo catalogue, but didn't bother with it as it looked old and unmaintained. I'll have to try it out now it's just had a refresh.

    -- "It's not magic, it's work..."
    • Please do! Let me know what you think -- good/bad/whatever -- so i can fix things up for another release.

      It's meant to be low-barrier in terms of setup and usage, so I hope that comes across :)


  • Cool stuff, pretty easy to setup and get going. I did run into a small bug though - my directory structure is /var/www/, and in the main source package, line 298
    $directory =~ s/\.//g;
    filtered out my photos_dir so I changed it to
    $directory =~ s/^\.//g;
    and that did the trick.
    • Hi! Thanks for checking out my module.

      That error is the result of my failed attempt to not allow relative paths from the user.

      So, rather, those few surrounding lines should probably be:

      my $user_dir  = $self->query->param( 'dir' ) || '';

      $user_dir     =~ s/\.\.//g;
      $user_dir     =~ s/\/$//;

      my $directory = $photo_dir . $user_dir ;

      I've made this change in my CVS -- This will show up in the next release unless someone gives me a better way to do it :)

      Thanks again!

      • I'll implement that and ping you if there are any issues.

        On another note, I ran into some issues with using the default templates - on my setup the app croaked saying it couldn't find them. I don't have the exact error handy, but what would have really helped a lot in getting this going would be example usage of photos_index.tmpl and photos_single.tmpl in the Synopsis PARAMS section. I'd be willing to bet most users will want to customize those.