From dd8f235ff9adb9fed8198522fe2b8d37cab7bdda Mon Sep 17 00:00:00 2001 From: Hammat Wele Date: Wed, 8 Jan 2025 21:22:43 +0000 Subject: [PATCH] Bug 8088: (follow-up) keep image transparency when importing a batch of cover images MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Images of covers must preserve transparency of png-images when uploading a batches of images in a ZIP file Plan test : Make sure you have a valid Zip file that contains the images to upload and a valid datalink.txt or idlink.txt file 1. Apply the patch. 2. In 'Cataloging > Upload local cover image', set 'LocalCoverImages' to 'show' and OPACLocalCoverImages to 'show'. 3. Click on « Drop files here » and select the ZIP file to upload then click «Process images» 6. For each notice check the transparency of images --->Notice the background is transparent --- Koha/CoverImage.pm | 5 ----- tools/upload-cover-image.pl | 1 + 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/Koha/CoverImage.pm b/Koha/CoverImage.pm index 0d9e1faf44..ea84594502 100644 --- a/Koha/CoverImage.pm +++ b/Koha/CoverImage.pm @@ -67,11 +67,6 @@ sub new { $params->{mimetype} = 'image/png'; $params->{imagefile} = $fullsize->png(); $params->{thumbnail} = $thumbnail->png(); - # Convert the image to PNG and print it on standard output - - open my $fh1, '>', '/inlibro/BD/outputV.png'; - print {$fh1} $params->{thumbnail}; - close $fh1; } return $class->SUPER::new($params); diff --git a/tools/upload-cover-image.pl b/tools/upload-cover-image.pl index 8627e50286..1ec7ffe1f6 100755 --- a/tools/upload-cover-image.pl +++ b/tools/upload-cover-image.pl @@ -191,6 +191,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/ ){ + GD::Image->trueColor(1); $srcimage = GD::Image->new($full_filename); } my $biblio; -- 2.34.1