From c8d89c79b781a473ee2f85fc168d8ad864ff7ab0 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Mon, 28 Jan 2008 03:54:52 +0100 Subject: [PATCH] Don't use YCbCr if we need to draw an info box; ImageMagick is too broken for that (stuff drawn with "white" in YCbCr gets pink, and even working around that, Freetype antialiasing in YCbCr is broken). --- perl/Sesse/pr0n/Common.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/perl/Sesse/pr0n/Common.pm b/perl/Sesse/pr0n/Common.pm index 000b351..8ae6839 100644 --- a/perl/Sesse/pr0n/Common.pm +++ b/perl/Sesse/pr0n/Common.pm @@ -403,9 +403,13 @@ sub ensure_cached { } else { # We always want YCbCr JPEGs. Setting this explicitly here instead of using # RGB is slightly faster (no colorspace conversion needed) and works equally - # well for our uses. (Ideally we'd be able to keep the image subsampled and + # well for our uses, as long as we don't need to draw an information box, + # which trickles several ImageMagick bugs related to colorspace handling. + # (Ideally we'd be able to keep the image subsampled and # planar, but that would probably be difficult for ImageMagick to expose.) - $magick->Set(colorspace=>'YCbCr'); + if (!$infobox) { + $magick->Set(colorspace=>'YCbCr'); + } $err = $magick->Read($fname); } -- 2.39.2