From: Steinar H. Gunderson Date: Thu, 11 Jan 2007 13:45:51 +0000 (+0100) Subject: Use progressive JPEG for larger images -- not because it makes them load so much X-Git-Url: https://git.sesse.net/?p=pr0n;a=commitdiff_plain;h=804ba7165f1ec6ee561c206e11dcbfd0dcd45a59;ds=sidebyside Use progressive JPEG for larger images -- not because it makes them load so much prettier (hopefully the precaching will take that anyhow), but because we gain about 4% file size for free. --- diff --git a/perl/Sesse/pr0n/Common.pm b/perl/Sesse/pr0n/Common.pm index d0bafe6..4014bb5 100644 --- a/perl/Sesse/pr0n/Common.pm +++ b/perl/Sesse/pr0n/Common.pm @@ -362,7 +362,12 @@ sub ensure_cached { # 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;