Mail Index

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ApacheGallery] Bug#287833: Patch to fix missing gif, ppm and tiff images

Package: libapache-gallery-perl
Severity: normal
Tags: patch upstream

The following patch fixes a rather annoying bug that shows up with
gif, ppm, or tiff files not actually showing up when they should
because of the get_scaled_picture_name() rule for:

	grep $type eq $_, qw(PPM TIF GIF)

[I've not specified \w+ more tightly because it needs to match

Index: lib/Apache/
--- lib/Apache/       (revision 288)
+++ lib/Apache/       (working copy)
@@ -128,6 +131,12 @@
                $filename =~ s/\/(\d+)x(\d+)\-//;
+               # Revert cache extension changing for non-jpg files
+               # This is can be broken if you actually have a file
+               # named foo-\w+.jpg, which is why we check for -e
+               # $filename.
+               $filename =~ s/\-(\w+)\.jpg$/.$1/ if not -e $filename;
                my ($width, $height, $type) = imgsize($filename);
                my $imageinfo = get_imageinfo($r, $filename, $type, $width, $height);

Don Armstrong

Our days are precious, but we gladly see them going
If in their place we find a thing more precious growing
A rare, exotic plant, our gardener's heart delighting
A child whom we are teaching, a booklet we are writing
 -- Frederick Rükert _Wisdom of the Brahmans_ 
 [Hermann Hesse _Glass Bead Game_]    

Attachment: signature.asc
Description: Digital signature