Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVG output lines between paths #57

Closed
ipetak opened this issue Jan 5, 2021 · 5 comments
Closed

SVG output lines between paths #57

ipetak opened this issue Jan 5, 2021 · 5 comments

Comments

@ipetak
Copy link

ipetak commented Jan 5, 2021

Hi,

I've noticed that outputting the QR code as SVG generates SVG with lines that look like borders on some squares. I haven't managed to figure out what exactly those lines are, stroke, outline or just misalignment of paths, it seems like they are transparent. Here is a screenshot of SVG versus the PNG output so its easier to notice what I'm talking about.

SVG QR code

PNG QR code

My QR options are:
_
'version' => 6,
'eccLevel' => QRCode::ECC_L,
'outputType' => QRCode::OUTPUT_MARKUP_SVG,
'imageBase64' => false
_

Can you try recreating the issue and looking into it please, maybe I'm doing something wrong. Thank you ahead!

@codemasher
Copy link
Member

Hey, it seems that's rather a browser issue, specifically rendering. The distance between the blocks should be 0 and there should not be a visible line regardless. I can see these lines too and it also depends on the browser's current zoom and changes with the zoom level, in both, chrome and firefox. As for the generation: at least the blocks of the same color in the same line should be connected and i found a bug that prevents this. I'll look into it as soon as i can but it's low priority as i'm currently revamping some internals. I can leave the issue open and tag it as "help needed" as i don't know too much about SVG to find an easy way how to fix it (one of which would be to connect all modules of the same color). Right now i can only suggest to use png output in case it's bothering.

@codemasher codemasher changed the title SVG output lines between paths v3.4 SVG output lines between paths Jan 5, 2021
@ipetak
Copy link
Author

ipetak commented Jan 6, 2021

Sounds good, thanks for the fast response I'll use the PNG temporary and probably dig a bit more about the issue itself. Again thank you for the help.

@codemasher
Copy link
Member

I'm currently working on an overhaul of the SVG output module and honestly i have absolutely no idea where these lines come from. I'll check this off as rendering issue which is beyond my powers to fix. In the current iteration I'm rendering each module individually and one would expect the lines between each then, but instead they just seem to appear randomly:
image

Having individual modules however has its perks: a nice way to circumvent the line issue (and - surprisingly - there are no visible lines between the few square blocks!?)
image

So I'm going to close this issue for now.

@codemasher
Copy link
Member

Another update: it looks like the lines were caused by the modules being in different <path> elements (one for each functional pattern). I've added an option to combine the modules into a single path for each dark and light and the lines are gone. While still a render issue that shouldn't exist, the issue seems to be resolved.

image

@ipetak
Copy link
Author

ipetak commented Dec 7, 2021

Great! Thank you for taking the time to look into this. Awesome work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants