This commit is contained in:
codemasher
2020-04-04 03:57:17 +02:00
parent 2a242c3db2
commit 552d1581f6
+7 -1
View File
@@ -26,6 +26,8 @@ class QRImageWithText extends QRImage{
* @return string
*/
public function dump(string $file = null, string $text = null):string{
$file ??= $this->options->cachefile;
$this->image = \imagecreatetruecolor($this->length, $this->length);
$background = \imagecolorallocate($this->image, ...$this->options->imageTransparencyBG);
@@ -46,7 +48,11 @@ class QRImageWithText extends QRImage{
$this->addText($text);
}
$imageData = $this->dumpImage($file);
$imageData = $this->dumpImage();
if($file !== null){
$this->saveToFile($imageData, $file);
}
if((bool)$this->options->imageBase64){
$imageData = 'data:image/'.$this->options->outputType.';base64,'.\base64_encode($imageData);