Make the box PNGs a bit smaller. They're still smaller than what we get out
authorSteinar H. Gunderson <sesse@debian.org>
Mon, 26 May 2008 20:33:39 +0000 (22:33 +0200)
committerSteinar H. Gunderson <sesse@debian.org>
Mon, 26 May 2008 20:33:39 +0000 (22:33 +0200)
of pngcrush, and they have a silly comment at the end (tEXt chunks) that
I can't find out where comes from, but it's at least better.

perl/Sesse/pr0n/Common.pm

index 027268a2c469faeeb2b5d232d91e619753a8b341..ae1d3d0ee3bc82307883bbf9e0bf69285eb9cdef 100644 (file)
@@ -574,7 +574,9 @@ sub ensure_cached {
                        $img->Read('xc:white');
                                
                        my $info = Image::ExifTool::ImageInfo($fname);
-                       if (!make_infobox($img, $info, $r)) {
+                       if (make_infobox($img, $info, $r)) {
+                               $img->Quantize(colors=>16, dither=>'False');
+                       } else {
                                # Not enough room for the text, make a tiny dummy transparent infobox
                                @$img = ();
                                $img->Set(size=>"1x1");
@@ -584,7 +586,7 @@ sub ensure_cached {
                                $height = 1;
                        }
                                
-                       $err = $img->write(filename => $cachename);
+                       $err = $img->write(filename => $cachename, quality => 99);
                        $r->log->info("New infobox cache: $width x $height for $id.jpg");
                        
                        return ($cachename, 'image/png');