mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-13 21:21:27 +00:00
create 8-bit png instead of 16-bit
This commit is contained in:
parent
2e818d5426
commit
da992a7bdd
|
@ -65,9 +65,14 @@ class SeedDMS_ConversionServicePdfToImage extends SeedDMS_ConversionServiceBase
|
||||||
if(!empty($params['width']))
|
if(!empty($params['width']))
|
||||||
$imagick->scaleImage(min((int) $params['width'], $imagick->getImageWidth()), 0);
|
$imagick->scaleImage(min((int) $params['width'], $imagick->getImageWidth()), 0);
|
||||||
/* Remove alpha channel and set to white */
|
/* Remove alpha channel and set to white */
|
||||||
$imagick->setImageBackgroundColor('white');
|
$imagick->setImageBackgroundColor('white');
|
||||||
$imagick->setImageAlphaChannel(Imagick::ALPHACHANNEL_REMOVE);
|
/* Setting the color-type and bit-depth produces much smaller images
|
||||||
$imagick->mergeImageLayers(Imagick::LAYERMETHOD_FLATTEN);
|
* because the default depth appears to be 16 bit
|
||||||
|
*/
|
||||||
|
$imagick->setOption('png:color-type', 6);
|
||||||
|
$imagick->setOption('png:bit-depth', 8);
|
||||||
|
$imagick->setImageAlphaChannel(Imagick::ALPHACHANNEL_REMOVE);
|
||||||
|
$imagick->mergeImageLayers(Imagick::LAYERMETHOD_FLATTEN);
|
||||||
$imagick->setImageFormat('png');
|
$imagick->setImageFormat('png');
|
||||||
$end = microtime(true);
|
$end = microtime(true);
|
||||||
if($this->logger) {
|
if($this->logger) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user