-
Notifications
You must be signed in to change notification settings - Fork 714
Add "svg-compressed" to create a simple classic QR Code with compressed file size. #407
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
base: main
Are you sure you want to change the base?
Conversation
…er savings by removing M cmds.
…rder to avoid the O(n^2)-ish perf hit for splicing a python list repeatedly. Only store spliceable turns, and assert that we dealt with all of them correctly.
… less readable, but oh well.
Would need to understand the reasoning and implications before putting this to production.
Hi @tobiasploetz, thank you for your contribution in #342. Really appreciate your work there! I’ve continued building on it by adding tests and a few additional touches. I noticed the SVG output savings are quite impressive! Around 800 bytes compared to the regular 12 KB version for "Hello". However, I’m curious about the reasoning behind optimizing the SVG size. Since SVGs are typically printed, it seems like file size might not be a major concern, and rather might lead to rendering problems in DTP applications. Could you help me better understand the motivation here? Currently it lacks drawer validation, means it allows |
I was initially annoyed sending svg files back and forth for art purposes taking up a bunch more space than it should. There's also an oddity with the box method of drawing where boxes touch other boxes, and it gets imported into a PDF or .ai file and then there are some fine lines in between each box. The svg-compressed mode doesn't have that problem since the paths don't have overlapping lines. |
viewBox = "-{b} -{b} {d} {d}".format(d=dimension, b=self.border) | ||
return super()._svg(viewBox=viewBox, **kwargs) | ||
|
||
def _generate_subpaths(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be worth it to move this logic to a separate module altogether (moduledrawers/_svg_compressed.py
?) so you could use less inner classes and enums?
Extensions for #342