]> git.sesse.net Git - pr0n/commitdiff
Use progressive JPEG for larger images -- not because it makes them load so much
authorSteinar H. Gunderson <sesse@debian.org>
Thu, 11 Jan 2007 13:45:51 +0000 (14:45 +0100)
committerSteinar H. Gunderson <sesse@debian.org>
Thu, 11 Jan 2007 13:45:51 +0000 (14:45 +0100)
prettier (hopefully the precaching will take that anyhow), but because we gain
about 4% file size for free.

perl/Sesse/pr0n/Common.pm

index d0bafe648af346c7def363b87ce0f92ae2c0dfb9..4014bb56661e13e5635d0abef7fe0b20486b337f 100644 (file)
@@ -362,7 +362,12 @@ sub ensure_cached {
                        # Strip EXIF tags etc.
                        $cimg->Strip();
 
                        # Strip EXIF tags etc.
                        $cimg->Strip();
 
-                       $err = $cimg->write(filename=>$cachename, quality=>$quality);
+                       if (($nwidth >= 640 && $nheight >= 480) ||
+                           ($nwidth >= 480 && $nheight >= 640)) {
+                               $err = $cimg->write(filename=>$cachename, quality=>$quality, interlace=>'Plane');
+                       } else {
+                               $err = $cimg->write(filename=>$cachename, quality=>$quality);
+                       }
 
                        undef $cimg;
 
 
                        undef $cimg;