From 4040c07937330c8afa59234af5799fa4b92a53da Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 18 Dec 2018 14:02:19 -0300 Subject: [PATCH] Bug 21987: Do not generate true color thumbnails if not needed If the original image is not a true color image we should not generate a true color thumbnail. Signed-off-by: Michal Denar Signed-off-by: Martin Renvoize Signed-off-by: Nick Clemens (cherry picked from commit 5c41d584cb654efbfd8c854bac0d30d87a054ab5) Signed-off-by: Martin Renvoize (cherry picked from commit 8928ba93250633eb82199e06c2198487b955d734) Signed-off-by: Lucas Gass --- C4/Images.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Images.pm b/C4/Images.pm index 37b24179aa..856e894d8a 100644 --- a/C4/Images.pm +++ b/C4/Images.pm @@ -179,8 +179,8 @@ sub _scale_image { and warn "Reducing image by " . ( $percent_reduce * 100 ) . "\% or to $width_reduce pix X $height_reduce pix"; - my $newimage = GD::Image->new( $width_reduce, $height_reduce, 1 ) - ; #'1' creates true color image... + my $newimage = GD::Image->new( $width_reduce, $height_reduce, $image->trueColor ) + ; # if third is set, creates true color image $newimage->copyResampled( $image, 0, 0, 0, 0, $width_reduce, $height_reduce, $width, $height ); return $newimage; -- 2.39.5