Comments (2)
Thanks for the kind words.
I don't have plans for graceful failures if validation fails. This code should do basic validation of the inputs and trough an exception if it is invalid.
What are you planning? An error message on the generated barcode? Or also exceptions but more explicit?
from php-barcode-generator.
A common experience is for us, but I'm sure other users of the open source project I'm working on is where the Barcode type is selected in the settings, but an item does not have a valid barcode of that type. It sounds like me wrapping the call in a try catch block then acting appropriately based on exceptions thrown is the way to go, but here are some things I'm looking at trying to figure out:
- Barcode type guessing. For example, in our use, we generally want EAN13 barcodes, but occasionally an ISBN-10 is in the field and some of those end in 'x', which fails on an EAN13.
- On failure, use a backup barcode type. For now, when an exception is thrown, I can use that to use a solid backup (like CODE128)
In the end, I suppose it makes more sense for the exception to be thrown. Currently the thrown exception does state that x is not allowed or that the check digit failed. As I'm thinking through it, I think maybe my feature request would be for a type guessing function in the library or the ability to not pass the type and have it try to guess when the type is not passed. These are all things that I can implement in my code, but I thought I'd ask before doing it.
from php-barcode-generator.
Related Issues (20)
- Not compatible with PHP 73 HOT 1
- thrown in /home/devspedi/public_html/wp-content/themes/additrans/lib/php-barcode-generator/src/BarcodeGenerator.php on line 140 HOT 1
- using FORM as array like name='data[]' HOT 1
- Barcode images not showing in Gmail, tried with PNG and HTML as base64 is not supported HOT 1
- TYPE_EAN_13 Error with 13 numbers HOT 2
- Image not showing when used text and number, but also showing number. HOT 5
- Unable to work with php 8.2 and XAMPP on Windows x64 HOT 1
- PHP 8.2: fix E_DEPRECATED warning HOT 1
- Make $widthFactor to be float HOT 4
- Fatal error: Uncaught Error: Call to undefined function Picqer\Barcode\imagejpeg() HOT 3
- Page autosubmit after scan QR code HOT 2
- Barcodes generated using BarcodeGeneratorDynamicHTML() do not render when printed HOT 1
- Feature Request: Add feature to optionally generate barcodes by width (px) not width factor HOT 19
- Cannot use object of type Picqer\\Barcode\\Barcode as array HOT 1
- Code128 donβt work HOT 2
- No dependencies? HOT 5
- Add background and margin on generated barcode HOT 4
- GTIN14 not working HOT 2
- Barcode Generated looks weird JPG,PNG HOT 8
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 php-barcode-generator.