From cd41f6839b3f4251415b45cf28b153cfd4a67345 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 8 Jan 2026 07:03:28 -0500 Subject: [PATCH] Bug 8088: (follow-up) Tidy Signed-off-by: Owen Leonard --- Koha/CoverImage.pm | 7 +++---- tools/upload-cover-image.pl | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Koha/CoverImage.pm b/Koha/CoverImage.pm index 9239e59495f..fb0b5cf5856 100644 --- a/Koha/CoverImage.pm +++ b/Koha/CoverImage.pm @@ -74,8 +74,8 @@ sub new { sub _scale_image { my ( $self, $image, $maxwidth, $maxheight ) = @_; my ( $width, $height ) = $image->getBounds(); - $image->alphaBlending(0); - $image->saveAlpha(1); + $image->alphaBlending(0); + $image->saveAlpha(1); if ( $width > $maxwidth || $height > $maxheight ) { my $percent_reduce; # Percent we will reduce the image dimensions by... @@ -87,8 +87,7 @@ sub _scale_image { } my $width_reduce = sprintf( "%.0f", ( $width * $percent_reduce ) ); my $height_reduce = sprintf( "%.0f", ( $height * $percent_reduce ) ); - my $newimage = GD::Image->new( $width_reduce, $height_reduce, 1 ) - ; #'1' creates true color image... + my $newimage = GD::Image->new( $width_reduce, $height_reduce, 1 ); #'1' creates true color image... $newimage->alphaBlending(0); $newimage->saveAlpha(1); $newimage->copyResampled( $image, 0, 0, 0, 0, $width_reduce, $height_reduce, $width, $height ); diff --git a/tools/upload-cover-image.pl b/tools/upload-cover-image.pl index 330c4a04283..239a78c5db5 100755 --- a/tools/upload-cover-image.pl +++ b/tools/upload-cover-image.pl @@ -101,7 +101,7 @@ my @results; if ( $op eq 'cud-process' && $fileID ) { my $upload = Koha::UploadedFiles->find($fileID); if ( $filetype eq 'image' ) { - my $fh = $upload->file_handle; + my $fh = $upload->file_handle; GD::Image->trueColor(1); my $srcimage = GD::Image->new($fh); $fh->close if $fh; @@ -185,7 +185,7 @@ if ( $op eq 'cud-process' && $fileID ) { my $full_filename = Cwd::abs_path("$dir/$filename"); #Resolve any relative filepath references my $srcimage; - if ( $full_filename =~ /^\Q$dir\E/ ){ + if ( $full_filename =~ /^\Q$dir\E/ ) { GD::Image->trueColor(1); $srcimage = GD::Image->new($full_filename); } -- 2.39.5