Comments (7)
Which bar code types are you generating? If a 2D symbol like QR-Code, there is a lot of processing required for the error correction bits. 1D symbols like code128 should render much faster.
from bwip-js.
I'm using 2D symbol like QR-Code and DataMatrix. So when i generate barcode with value from 1 to 100000, it take a long time. Is there anyway to make it faster for generate?
Thankz!
from bwip-js.
Is Data Matrix too slow, or just QR Code specifically?
The error correction isn't particularly expensive however QR Code has a very expensive mask evaluation routine to determine which of a set of masks when applied results in a symbol with the least number of undesirable image artefacts. The PS code is about as well optimised as you'll get for this but it's still a performance killer.
One improvement would be allow the user to specify a particular mask and skip the evaluation - not entirely to specification (most other implementations I've seen get the scoring wrong anyway) but it will speed things up and the symbols will still be valid. If this would be helpful then let me know and I'll implement.
from bwip-js.
Data Matrix is fine, just QR Code. Please help me if you have away to solve it!
Thankz.
from bwip-js.
@metafloor BWIPP commit 19cb9147aac2ff9519f70ec7f0eeb48060f2be1f introduces an undocumented mask option (1-8 for QR Code, 1-4 for Micro QR Code) that allows the user to pick a particular mask in order to avoid the cost of evaluating each mask for find the optimal. Ignoring the rendering, it reduces the time taken to generate a version 40 symbol from 810ms to 335ms on my system. That's about as good as you can get without micro-optimising a lot of the code for somewhat less gain.
I'm not proud of this as it reduces the quality of the QR Code output so will not cut a release based on this alone, but it's no worse that what a lot of generators do. Some experimentation might be required to determine whether some masks work better than others before settling on one in particular.
It's up to you whether you want to cherry pick it into BWIP-JS or await some future release. I'm choosing not to document the option. You might do likewise!
from bwip-js.
Attached is the replacement bwipp/qrcode.js file that incorporates the special one-off change (thanks Terry!). Copy it to your bwip-js/bwipp directory. This will not become part of a bwip-js release
until some later date.
Github won't allow uploading .js files so make sure to change the file extension from .txt back to .js.
qrcode.txt
from bwip-js.
Thank you so much you guy!
from bwip-js.
Related Issues (20)
- how to new line text HOT 3
- [React] Cannot find "toCanvas" HOT 5
- Maintain a Proper Changelog
- Lack of `default` condition in the exports map HOT 18
- Escaping "(" and ")" using ^040 and & ^41 in gs1 datamatrix encoder ends up with AI syntax error HOT 22
- parsefnc with iso-8859-15 seems not to work for pdf417 HOT 11
- SVG related functions are not represented in the .d.ts files HOT 4
- In React APP toBuffer import issue HOT 1
- when i use this to create an dataMatrix code, how can i set my code correct level, i set by this, but looks not useful HOT 2
- Compatibility with IE11 HOT 6
- Property 'toCanvas' does not exist on type 'typeof BwipJs'. HOT 4
- QrCode to zpl HOT 5
- Property 'toCanvas' does not exist on type 'typeof BwipJs' HOT 18
- nodejs 20.10.0 generate a different barcode compare when I use nodejs 20.9.0 HOT 3
- Datamatrix generation fo binary data after 3.4.0 has extra bytes HOT 3
- 4.2.0 will not generate the same barcode as 3.0.1 HOT 3
- please tag when doing a npm publish HOT 1
- Uncaught ReferenceError: BwipJs is not defined - Runtime error HOT 2
- New option showbearer via BWIP 2023-07-2 HOT 4
- backgroundcolor with # doesn't work or throw an error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bwip-js.