Permalink
Browse files

Fixes transparency support for GD crop method in CImage library.

  • Loading branch information...
JB Lebrun
JB Lebrun committed Oct 5, 2018
1 parent 63fb882 commit 636d1c14b3f02b3faabcfafc86ac180f874d9a7b
Showing with 3 additions and 3 deletions.
  1. +3 −3 engine/lib/object/CImage.php.inc
@@ -4,9 +4,9 @@
* @details Engine / Object Library
* @file engine/lib/object/CImage.php.inc
* @author CaMykS Team <camyks.contact@gmail.com>
* @version 1.0.1
* @version 1.0.2
* @date Creation: Nov 2011
* @date Modification: Sep 2018
* @date Modification: Oct 2018
* @copyright 2011 - 2018 CaMykS Team
* @note This program is distributed as is - WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@@ -389,9 +389,9 @@ final class CImage {
/* add background color */
if ($bgColor == '#transp' or $this->_gd_is_transparencyEnabled()) {
imageColorTransparent($newSrc, imageColorAllocateAlpha($newSrc, 0, 0, 0, 127));
imageAlphaBlending($newSrc, false);
imageSaveAlpha($newSrc, true);
imageFilledRectangle($newSrc, 0, 0, $width, $height, imageColorAllocateAlpha($newSrc, 255, 255, 255, 127));
} else {
imageFill($newSrc, 0, 0, $this->_gd_getAllocatedColor($bgColor, $newSrc));
}

0 comments on commit 636d1c1

Please sign in to comment.