]> git.sesse.net Git - pr0n/blobdiff - perl/Sesse/pr0n/Image.pm
Fix a double-correction that would mess up images where width=NULL/height=NULL.
[pr0n] / perl / Sesse / pr0n / Image.pm
index 7f3e3c09825a015f9295c40f2541c2c53dea60a6..e298dc317277e1e2613345776ba9923e84374eec 100644 (file)
@@ -16,16 +16,16 @@ sub handler {
        # Find the event and file name
        my ($event,$filename,$xres,$yres);
        my $infobox = 1;
-       if ($r->uri =~ m#^/([a-zA-Z0-9-]+)/original/(nobox/)?([a-zA-Z0-9._-]+)$#) {
+       if ($r->uri =~ m#^/([a-zA-Z0-9-]+)/original/(nobox/)?([a-zA-Z0-9._()-]+)$#) {
                $event = $1;
                $filename = $3;
-       } elsif ($r->uri =~ m#^/([a-zA-Z0-9-]+)/(\d+)x(\d+)/(nobox/)?([a-zA-Z0-9._-]+)$#) {
+       } elsif ($r->uri =~ m#^/([a-zA-Z0-9-]+)/(\d+)x(\d+)/(nobox/)?([a-zA-Z0-9._()-]+)$#) {
                $event = $1;
                $filename = $5;
                $xres = $2;
                $yres = $3;
                $infobox = 0 if (defined($4));
-       } elsif ($r->uri =~ m#^/([a-zA-Z0-9-]+)/(nobox/)?([a-zA-Z0-9._-]+)$#) {
+       } elsif ($r->uri =~ m#^/([a-zA-Z0-9-]+)/(nobox/)?([a-zA-Z0-9._()-]+)$#) {
                $event = $1;
                $filename = $3;
                $xres = -1;
@@ -47,11 +47,6 @@ sub handler {
        $dbwidth = $ref->{'width'};
        $dbheight = $ref->{'height'};
 
-       #}
-               
-       $dbwidth = -1 unless defined($dbwidth);
-       $dbheight = -1 unless defined($dbheight);
-
        # Scale if we need to do so
        my ($fname,$thumbnail) = Sesse::pr0n::Common::ensure_cached($r, $filename, $id, $dbwidth, $dbheight, $infobox, $xres, $yres);