endroid / qr-code

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

URL string? #266

Closed onlinesid closed 4 years ago

onlinesid commented 4 years ago

This is just a question, is there a property/option that should be set if the data is a URL or is it just a string, e.g.:

use Endroid\QrCode\QrCode;

$qrCode = new QrCode('https://github.com');

// do we need to set a flag/option/property to tell QR code reader that the string is a URL?

header('Content-Type: '.$qrCode->getContentType());
echo $qrCode->writeString();
MelchiorKokernoot commented 4 years ago

Does not seem like it. Google lens parses the url flawlessly if you put it in the first parameter for the constructor.

endroid commented 4 years ago

@onlinesid Indeed there is no way to indicate the contents represent a URL. Howevers, readers should be able to easily detect the content type.