speedata / luaqrcode Goto Github PK
View Code? Open in Web Editor NEWPure Lua qrcode library
Home Page: http://speedata.github.io/luaqrcode/
License: Other
Pure Lua qrcode library
Home Page: http://speedata.github.io/luaqrcode/
License: Other
None of the QR codes generated by luaqrcode are readable in the QR Droid (Android app) using the default "Zapper" recognition method. They are not recognized as QR codes at all. When I switch the recognition method to "ZXing", the same codes are perfectly readable. One example of such a code is here (the four letters "ahoj" are encoded).
The following string failed to render correctly:
{"l":44,"w":[{"a":"one","b":"en"},{"a":"two","b":"to"},{"a":"three","b":"tre"},{"a":"five","b":"fem"},{"a":"seven","b":"sju"},{"a":"eleven","b":"elleve"},{"a":"thirteen","b":"tretten"},{"a":"boy","b":"gutt"},{"a":"girl","b":"jente"}],"n":"test123"}
The version information is broken.
Greetings,
This is an interesting library!
I tried to reproduce the QR from the homepage site:
According to Zxing, it contains the URL http://speedata.github.com/luaqrcode/
so I tried to reproduce it (changing the EC levels, just in case), to no avail:
Is there any reason for that?
(Zxing could decode all of them. I also tried other QR generators that gave different images - So I assume there's some variability perhaps - but I would have at least expected the library to generate the same output as its own homepage?)
Small standalone program reproducing my above output, in case I misinterpreted something.
local q = require("lua-libraries/qrencode")
pl = require("pl.import_into")()
for ec = 1, 4 do
local ok, tab_or_message = q.qrcode("http://speedata.github.com/luaqrcode/", ec)
for _, col in ipairs(tab_or_message) do
print(table.concat(pl.tablex.map(function(cell) return cell < 0 and " " or "โ" end, col), ""))
end
print("\n\n")
end
(I may have inverted columns and lines, but that's just an axial symmetry).
Hi Patrick, thanks for your great work on this project. I am using luaqrcode in my aseprite plugin to generate qrcode from pixel art.
But I found an issue when I try to generate a qrcode with a long repeating 0x00 (pixels with 0th palette) with ec_level = M
, the decoder returns a lot of 1s among the 0s, which causing dirty dots when we decode the image from qrcode.
Here is the code to replica the bug:
local data = {}
for i = 1, 255 do
table.insert(data, 0)
end
qrencode.qrcode(data, 2)
this code generates a qrcode which is decoded by https://zxing.org/w/decode.jspx as following data:
40 0f f0 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00
00 00 ec 11 ec 11 ec 11 ec 11 ec 11 ec 11 ec 11
ec 11 ec 11 ec 11 ec 11 ec 11 ec 11 ec 11 ec 11
ec 11
As you can see there are 01
s inside the data, which should be all 00
.
I had tried to figure it out for a while, but it's far out of my scope, I'd appreciate it if you could help.
Thanks,
mutoo
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.