[ENHANCEMENT] readFromFile/readFromBlob result returning also the QR code coordinates inside the source image
Request: literally what the title says. Thanks!
Hi, why did you ignore the issue template? Please provide a proper description and reasons/use cases why this should be a feature, otherwise I'll close this issue. https://php-qrcode.readthedocs.io/en/main/Appendix/Contribute.html
Hi, sorry about not adhering to the template.
Description: when detecting QR codes in an image, getting back the pixel coordinates of the detected code.
Use case: I'm trying to detect all the QR codes in an image, not a single one. From what I gather, only the first QR code that is found is returned. With the pixel coordinates of the QR code, I can draw a rectangle on the image over the QR code, effectively erasing it. Then, I can run the detection again on the same image and get the second QR code, and so on.
Hope this is enough! :)
Ok thanks, that gives a rough idea. I guess the easiest way would be to get the coordinates of the finder patterns over here:
https://github.com/chillerlan/php-qrcode/blob/b915a1ec58978857cd278cd3eda947b8c388422b/src/Detector/Detector.php#L39-L40
However, these values are already run though the binarizer and might have undergone transformations during the locate process, so the accuracy may vary.
Either way, this is a very low priority enhancement unless it comes to me in form of a vision or a pull request, so I'll tag it as "help wanted".
Hi, I've done it myself here: https://github.com/pedrospinto/php-qrcode/tree/main This works perfectly for me. With the XY coordinates of the last detected QR code, I can obscure it and run the detection again on the same image to get the next code, and so on. Didn't make a pull request though. I'm not sure if this code is up to par with your standards...
Hey that looks great!
Didn't make a pull request though. I'm not sure if this code is up to par with your standards...
No worries, a PR is for working out the details - it's your contribution after all.