diff --git a/src/claviska/SimpleImage.php b/src/claviska/SimpleImage.php index 3379467..7c95316 100644 --- a/src/claviska/SimpleImage.php +++ b/src/claviska/SimpleImage.php @@ -63,7 +63,7 @@ public function __construct($image = '', $flags = []) { $this->flags = [ "sslVerify" => true // Skip SSL peer validation ]; - + // Override default flag values. foreach($flags as $flag => $value) { $this->setFlag($flag, $value); @@ -206,7 +206,7 @@ public function fromFile($file) { $alpha = imagecolorallocatealpha($gif, 0, 0, 0, 127); imagecolortransparent($gif, $alpha); imagefill($gif, 0, 0, $alpha); - + imagecopy($this->image, $gif, 0, 0, 0, 0, $width, $height); imagedestroy($gif); break; @@ -526,7 +526,7 @@ protected static function imageCopyMergeAlpha($dstIm, $srcIm, $dstX, $dstY, $src if($pct < 100) { // Disable alpha blending and "colorize" the image using a transparent color imagealphablending($srcIm, false); - imagefilter($srcIm, IMG_FILTER_COLORIZE, 0, 0, 0, 127 * ((100 - $pct) / 100)); + imagefilter($srcIm, IMG_FILTER_COLORIZE, 0, 0, 0, round(127 * ((100 - $pct) / 100))); } imagecopy($dstIm, $srcIm, (int) $dstX, (int) $dstY, (int) $srcX, (int) $srcY, (int) $srcW, (int) $srcH);