conversion from pdf to png replaces alpha channel with white

This commit is contained in:
Uwe Steinmann 2023-02-15 08:27:37 +01:00
parent 73562364b0
commit d45f050e46
2 changed files with 5 additions and 0 deletions

View File

@ -1,6 +1,7 @@
--------------------------------------------------------------------------------
Changes in version 5.1.30
--------------------------------------------------------------------------------
- conversion from pdf to png replaces alpha channel with white
--------------------------------------------------------------------------------
Changes in version 5.1.29

View File

@ -64,6 +64,10 @@ class SeedDMS_ConversionServicePdfToImage extends SeedDMS_ConversionServiceBase
if($imagick->readImage($infile.'['.$page.']')) {
if(!empty($params['width']))
$imagick->scaleImage(min((int) $params['width'], $imagick->getImageWidth()), 0);
/* Remove alpha channel and set to white */
$imagick->setImageBackgroundColor('white');
$imagick->setImageAlphaChannel(Imagick::ALPHACHANNEL_REMOVE);
$imagick->mergeImageLayers(Imagick::LAYERMETHOD_FLATTEN);
$imagick->setImageFormat('png');
$end = microtime(true);
if($this->logger) {