Bugzilla – Attachment 92018 Details for
Bug 22988
Visible reduction in image quality
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22988: Always set trueColor for the fullsize image
Bug-22988-Always-set-trueColor-for-the-fullsize-im.patch (text/plain), 1.97 KB, created by
Jonathan Druart
on 2019-08-05 16:52:57 UTC
(
hide
)
Description:
Bug 22988: Always set trueColor for the fullsize image
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-08-05 16:52:57 UTC
Size:
1.97 KB
patch
obsolete
>From f424f99b532b722e6094276cc40589af3a40cc7a Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 5 Aug 2019 11:51:34 -0500 >Subject: [PATCH] Bug 22988: Always set trueColor for the fullsize image > >--- > C4/Images.pm | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > >diff --git a/C4/Images.pm b/C4/Images.pm >index 856e894d8a..ebc9ed687b 100644 >--- a/C4/Images.pm >+++ b/C4/Images.pm >@@ -75,7 +75,7 @@ sub PutImage { > # Check the pixel size of the image we are about to import... > my $thumbnail = _scale_image( $srcimage, 140, 200 ) > ; # MAX pixel dims are 140 X 200 for thumbnail... >- my $fullsize = _scale_image( $srcimage, 600, 800 ) >+ my $fullsize = _scale_image( $srcimage, 600, 800, { force_true_color => 1 } ) > ; # MAX pixel dims are 600 X 800 for full-size image... > $debug and warn "thumbnail is " . length($thumbnail) . " bytes."; > >@@ -156,9 +156,11 @@ sub DelImage { > } > > sub _scale_image { >- my ( $image, $maxwidth, $maxheight ) = @_; >+ my ( $image, $maxwidth, $maxheight, $params ) = @_; > my ( $width, $height ) = $image->getBounds(); > $debug and warn "image is $width pix X $height pix."; >+ >+ my $true_color = delete $params->{force_true_color} || $image->trueColor; > if ( $width > $maxwidth || $height > $maxheight ) { > > # $debug and warn "$filename exceeds the maximum pixel dimensions of $maxwidth X $maxheight. Resizing..."; >@@ -179,7 +181,7 @@ 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, $image->trueColor ) >+ my $newimage = GD::Image->new( $width_reduce, $height_reduce, $true_color) > ; # if third is set, creates true color image > $newimage->copyResampled( $image, 0, 0, 0, 0, $width_reduce, > $height_reduce, $width, $height ); >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 22988
: 92018