+ if (defined $ENV{QUERY_STRING} && $ENV{QUERY_STRING} eq 'thumbonly' &&
+ $r->dir_config('GalleryAllowThumbonly') &&
+ -f $filename) {
+
+ my ($width, $height, $type) = imgsize($filename);
+ my @filetypes = qw(JPG TIF PNG PPM GIF);
+ if (grep $type eq $_, @filetypes) {
+ my ($thumbnailwidth, $thumbnailheight) = get_thumbnailsize($r, $width, $height);
+ my $imageinfo = get_imageinfo($r, $filename, $type, $width, $height);
+ my $cached = get_scaled_picture_name($filename, $thumbnailwidth, $thumbnailheight);
+ $r->headers_out->set(Location => uri_escape(".cache/$cached", $escape_rule));
+ return $::MP2 ? Apache2::Const::REDIRECT() : Apache::Constants::REDIRECT();
+ }
+ }