Skip to content

Commit

Permalink
Merge pull request endroid#189 from sprain/bugfix-imagecopyresampled
Browse files Browse the repository at this point in the history
Force integer params in imagecopyresampled
  • Loading branch information
endroid authored Dec 16, 2018
2 parents 0095706 + 203ee22 commit fdd809a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Writer/PngWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private function createInterpolatedImage($baseImage, array $data, QrCodeInterfac
$image = imagecreatetruecolor($data['outer_width'], $data['outer_height']);
$backgroundColor = imagecolorallocatealpha($image, $qrCode->getBackgroundColor()['r'], $qrCode->getBackgroundColor()['g'], $qrCode->getBackgroundColor()['b'], $qrCode->getBackgroundColor()['a']);
imagefill($image, 0, 0, $backgroundColor);
imagecopyresampled($image, $baseImage, $data['margin_left'], $data['margin_left'], 0, 0, $data['inner_width'], $data['inner_height'], imagesx($baseImage), imagesy($baseImage));
imagecopyresampled($image, $baseImage, (int) $data['margin_left'], (int) $data['margin_left'], 0, 0, (int) $data['inner_width'], (int) $data['inner_height'], imagesx($baseImage), imagesy($baseImage));
imagesavealpha($image, true);

return $image;
Expand Down

0 comments on commit fdd809a

Please sign in to comment.