endroid / qr-code

QR Code Generator
https://endroid.nl
MIT License
4.41k stars 725 forks source link

Fatal error when string to write includes ENCODING=...... #316

Closed janeks closed 3 years ago

janeks commented 3 years ago

Data length: 2391. String fragment that throws an error: PHOTO;TYPE=JPEG;ENCODING=b:/9j/4QAYRXhpZgAASUkqAA........

Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 259210001 bytes) in ..\endroid\qrcode\Writer\PngWriter.php on line 53

endroid commented 3 years ago

Hi @janeks the memory usage is dependent on many different factors which makes it very hard / impossible to calculate on forehand. In other words I don't think it can be avoided. However, if you have specific suggestions for performance improvements please let me know what sections / code and I will look into it. Or if you can create a branch with a test case containing this specific example I can possibly find a bottleneck and improve this. So I'll close this for now but if you can provide a failing test case I can reopen it.