mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-08-31 12:38:22 +00:00
:octocat: QRImagick: base64 data URI support
This commit is contained in:
@@ -14,9 +14,9 @@ namespace chillerlan\QRCode\Output;
|
||||
|
||||
use chillerlan\QRCode\Data\QRMatrix;
|
||||
use chillerlan\Settings\SettingsContainerInterface;
|
||||
use Imagick, ImagickDraw, ImagickPixel;
|
||||
|
||||
use finfo, Imagick, ImagickDraw, ImagickPixel;
|
||||
use function extension_loaded, is_string;
|
||||
use const FILEINFO_MIME_TYPE;
|
||||
|
||||
/**
|
||||
* ImageMagick output module (requires ext-imagick)
|
||||
@@ -93,6 +93,10 @@ class QRImagick extends QROutputAbstract{
|
||||
|
||||
$this->saveToFile($imageData, $file);
|
||||
|
||||
if($this->options->imageBase64){
|
||||
$imageData = $this->toBase64DataURI($imageData, (new finfo(FILEINFO_MIME_TYPE))->buffer($imageData));
|
||||
}
|
||||
|
||||
return $imageData;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user