Skip to content
Permalink
Browse files

Fixed PNG transparency lost during thumbnailing in some servers

  • Loading branch information
ggppdk committed Oct 26, 2016
1 parent 8df82e8 commit f27a74bf0c840d9b9c9d7e05487d42bce302b586
Showing with 9 additions and 5 deletions.
  1. +9 −5 site/librairies/phpthumb/phpthumb.class.php
@@ -1681,16 +1681,20 @@ function ImageMagickThumbnailToGD() {
}
}

ob_start();
$getimagesize = getimagesize($this->sourceFilename);
$GetImageSizeError = ob_get_contents();
ob_end_clean();

if (!is_null($this->dpi) && $this->ImageMagickSwitchAvailable('density')) {
// for vector source formats only (WMF, PDF, etc)
$commandline .= ' -flatten';
if (!is_array($getimagesize) || $getimagesize[2] != IMAGETYPE_PNG)
{
$commandline .= ' -flatten';
}
$commandline .= ' -density '.phpthumb_functions::escapeshellarg_replacement($this->dpi);
}
ob_start();
$getimagesize = getimagesize($this->sourceFilename);
$GetImageSizeError = ob_get_contents();
ob_end_clean();

if (is_array($getimagesize)) {
$this->DebugMessage('getimagesize('.$this->sourceFilename.') SUCCEEDED: '.print_r($getimagesize, true), __FILE__, __LINE__);
} else {

0 comments on commit f27a74b

Please sign in to comment.
You can’t perform that action at this time.