QR codes for URLs longer than 79 characters become bar codes
At my work environment, we are using the latest version of Simple QRCode (4.2) with Laravel 7 and PHP 7.3. We are generating URLs that are longer than 79 characters, and at that point, the QR code malforms and kinda becomes a bar code (unless it's an intended feature, sorry lol, is there a toggle?).
Reproduction steps:
- Generate a URL that is longer than 79 characters, for example, a normal Google Search URL.
- Generate a QR Code inside a Blade template, using
{!! QRCode::generate('text') !!} - The QR code will generate itself as bar code.
Expected (generated using this website and putting the query as https://www.google.com/search?q=test+search&source=hp&ei=271xYKfDCIGXwbkP2KSe8AI):

Generated:

Hi, Any news on this one? Since yesterday I have the same issue. It's really strange because it was working fine before, and I did not change anything on the server.
There is no news, but I'll gladly accept a PR that resolves this.
Any clue where I could search for the issue / fix? What I don't understand why it stopped working on a system overnight.
Not really. I'm confused on why it would start failing all of a sudden as no release has been created in this package or any dependencies when I took a look. When I find some time, I can look at this a little more.
Alright, thanks. In the meantime use the following workaround: I'm using tinyurl service to shorten the URLs: function tinyurl($url) { return file_get_contents('http://tinyurl.com/api-create.php?url='.urlencode($url)); }
Hi there there is any news about this issue? you code is perfect and very easy to use, but i'm facing the same error encoding large strings I think it is related also with the size and the correction error in some combination of these elements i got a image like barcode. Please any suggestion or workaround ( i cant use tiniurl) ? Thanks in advance Stefano
Is this the svg or png formatter?
Is this the svg or png formatter?
It happens with both afaik
I'm using it into a View
I have to use errorCorrection to L to avoid bars. It seems it's a stange combination between size strint lenght and errorCorrection
Is this the svg or png formatter?
I recall it being both, since trying to do it with any formatter didn't give me the desired result.
I set errorCorrection to L size 200x200 and 400x400 and it is broken
I think this issue is no more exists , I tested it & it works fine with me using laravel 7 , and php 7.3
It looks like wrong scale parameters are applied to the first <g> tag inside SVG. For me it was transform="scale(2,162)". So scale has two parameters 2(scale-X) and 162(scale-Y) when it should have one parameter scale(2.162). My solution was to replace comma with dot in line 100 of SvgImageBackEnd.php
sprintf('scale(%s)', str_replace(',','.',round($size, self::PRECISION)))
Can't reproduce.