From dec917eb3eb20cdda77ff630bc5ee1fc075beb1b Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Mon, 26 May 2008 22:33:39 +0200 Subject: [PATCH] Make the box PNGs a bit smaller. They're still smaller than what we get out 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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/perl/Sesse/pr0n/Common.pm b/perl/Sesse/pr0n/Common.pm index 027268a..ae1d3d0 100644 --- a/perl/Sesse/pr0n/Common.pm +++ b/perl/Sesse/pr0n/Common.pm @@ -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'); -- 2.39.2