Skip to content

Commit

Permalink
Force integer params in imagecopyresampled
Browse files Browse the repository at this point in the history
  • Loading branch information
sprain committed Dec 13, 2018
1 parent 0095706 commit 203ee22
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 203ee22

Please sign in to comment.