This error occurs when i’m try generate qr-code by simplesoftwareio/simple-qrcode in docker enviroment. It works without errors on the local machine (without docker)
Params:
php8.3
php-ext:
- bcmath
- Core
- ctype
- curl
- date
- dom
- exif
- fileinfo
- filter
- gd
- hash
- iconv
- imagick
- intl
- json
- libxml
- mbstring
- mysqlnd
- openssl
- pcntl
- pcre
- PDO
- pdo_pgsql
- pdo_sqlite
- Phar
- posix
- random
- readline
- redis
- Reflection
- session
- SimpleXML
- sockets
- sodium
- SPL
- sqlite3
- standard
- tokenizer
- xml
- xmlreader
- xmlwriter
- Zend OPcache
- zip
- zlib
Laravel 10.42
simplesoftwareio/simple-qrcode 4.2
Code:
$path = storage_path(sprintf('app/accounts/qr/%s.png', 'SOME_LOGIN'));
QrCode::format('png')
->size(500)
->style('dot', 0.9)
->eye('square')
->merge('/resources/images/qr_custom_mask.png', 1)
->errorCorrection('H')
->margin(3)
->generate(
json_encode(['login' => 'SOME_LOGIN', 'pass' => 'SOME_PASS']),
$path
);
All directories and resources in the paths exist
This code works in FPM mode, but in CLI (queue, tinker, schewdule) throws this error.
[2024-06-24 18:03:27] production.ERROR: imagecreatefromstring(): Data is not in a recognized format {"exception":"[object] (ErrorException(code: 0): imagecreatefromstring(): Data is not in a recognized format at /var/www/vendor/simplesoftwareio/simple-qrcode/src/Image.php:21)
I tried to rebuild container, manipulates flags with json_encode, clear cache and restart queues. It doesn’t work anyway. Please help!!!
Кирилл Золотарев is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.