khanamiryan / php-qrcode-detector-decoder

This is a PHP library to detect and decode QR-codes. This is first and only QR code reader that works without extensions.
Apache License 2.0
1.38k stars 324 forks source link

"PHP Memory Limit does not allow pixel export." exception when the memory limit is in fact unlimited #133

Open tasugo opened 2 years ago

tasugo commented 2 years ago

When there is no memory limit set, or it is set to -1 (unlimited), the instantiation of IMagickLuminanceSource throws a RuntimeException("PHP Memory Limit does not allow pixel export.") complaining about it, because it wrongfully thinks the limit is not enough.

This is due to the fact that in the checking method, a call to kmgStringToBytes performs a substr without taking into account the negative value, or the - sign.

I'm creating a PR that fixes this

GenieTim commented 2 years ago

I think this should be fixed in the current version, 2.0.2

webdeveloper100 commented 7 months ago

Hello, I have the exact problem on a production server. PHP Memory Limit does not allow pixel export. khanamiryan/qrcode-detector-decoder/lib/IMagickLuminanceSource.php (34) I had a look into the vendor file, I can't see the changes proposed in the PR #134 and I have version 2.0.2 installed.