Skip to content

Commit 9ea06a5

Browse files
authored
Update qrimage.php
1 parent 0fed704 commit 9ea06a5

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

phpqrcode/qrimage.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,17 @@ private static function image($frame, $pixelPerPoint = 4, $outerFrame = 4)
8686
}
8787
}
8888

89-
$target_image =ImageCreate($imgW * $pixelPerPoint, $imgH * $pixelPerPoint);
90-
ImageCopyResized($target_image, $base_image, 0, 0, 0, 0, $imgW * $pixelPerPoint, $imgH * $pixelPerPoint, $imgW, $imgH);
89+
// $target_image =ImageCreate($imgW * $pixelPerPoint, $imgH * $pixelPerPoint);
90+
// ImageCopyResized($target_image, $base_image, 0, 0, 0, 0, $imgW * $pixelPerPoint, $imgH * $pixelPerPoint, $imgW, $imgH);
91+
92+
$targetW = (defined('IMAGE_WIDTH') ? IMAGE_WIDTH : $imgW * $pixelPerPoint );
93+
$targetH = (defined('IMAGE_HEIGHT') ? IMAGE_HEIGHT : $imgH * $pixelPerPoint );
94+
95+
$target_image =ImageCreate($targetW, $targetH);
96+
97+
ImageCopyResized($target_image, $base_image, 0, 0, 0, 0, $targetW, $targetH, $imgW, $imgH);
9198
ImageDestroy($base_image);
9299

93100
return $target_image;
94101
}
95-
}
102+
}

0 commit comments

Comments
 (0)