Closed a-d-w-s closed 1 year ago
If I modify the code as follows, it no longer returns the error.
protected static function imageCopyMergeAlpha($dstIm, $srcIm, $dstX, $dstY, $srcX, $srcY, $srcW, $srcH, $pct) {
// Are we merging with transparency?
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, round(127 * ((100 - $pct) / 100)));
}
imagecopy($dstIm, $srcIm, (int) $dstX, (int) $dstY, (int) $srcX, (int) $srcY, (int) $srcW, (int) $srcH);
return true;
}
Original line:
imagefilter($srcIm, IMG_FILTER_COLORIZE, 0, 0, 0, 127 * ((100 - $pct) / 100));
Fixed in #310.
If I connect two images, I get an error message: notice: Implicit conversion from float 50.800000000000004 to int loses precision.
This function does it: $image->overlay(...);
Thank you