Bug 8088: (follow-up) Tidy

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Owen Leonard 2026-01-08 07:03:28 -05:00 committed by Lucas Gass
parent 22a13ba009
commit 61c84f9e6a
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
2 changed files with 5 additions and 6 deletions

View File

@ -75,8 +75,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...
@ -88,8 +88,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 );

View File

@ -102,7 +102,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;
@ -187,7 +187,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);
}