Comments (2)
I don't mind tightening up the very lenient check here: https://github.com/zxing/zxing/blob/master/core/src/main/java/com/google/zxing/client/result/EmailDoCoMoResultParser.java#L60
Feel free to propose something that maybe looks for at least something like a domain after "@"
The app itself can't be updated, but I think a conservative change to that logic is not bad
from zxing.
see this code-private int[] determineDimensions(int sourceCodeWords, int errorCorrectionCodeWords) throws WriterException {
float ratio = 0.0f;
int[] dimension = null;
int currentCols = minCols;
for (int cols = minCols; cols <= maxCols; cols++) {
currentCols = cols;
int rows = calculateNumberOfRows(sourceCodeWords, errorCorrectionCodeWords, cols);
if (rows < minRows) {
break; // No need to check further as rows will only decrease
}
if (rows > maxRows) {
continue; // Skip this column count as it exceeds max rows
}
float newRatio = ((float) (17 * cols + 69) * DEFAULT_MODULE_WIDTH) / (rows * HEIGHT);
// Update if the new ratio is closer to the preferred ratio
if (dimension == null || Math.abs(newRatio - PREFERRED_RATIO) < Math.abs(ratio - PREFERRED_RATIO)) {
ratio = newRatio;
dimension = new int[]{cols, rows};
}
}
// Handle case when no suitable dimensions were found in the loop
if (dimension == null) {
int rows = calculateNumberOfRows(sourceCodeWords, errorCorrectionCodeWords, currentCols);
if (rows >= minRows && rows <= maxRows) {
dimension = new int[]{currentCols, rows};
} else {
throw new WriterException("Unable to fit message in columns");
}
}
return dimension;
}
generatePDF417Image("0000000001000000022200000003330444400888888881010101010", 371, null);
from zxing.
Related Issues (20)
- Fatal Exception: java.lang.ArrayIndexOutOfBoundsException: length=11664; index=11664
- Page not responding : https://zxing.github.io/zxing/core/index.html HOT 2
- Open scue code
- Zxing is not working with PDF417 for south african driving licenses HOT 2
- issue about scanning
- com.google.zxing.client.android.encode.QRCodeEncoder.encodeFromStreamExtra HOT 3
- How to get zxingorg 3.5.3-SNAPSHOT entity package HOT 6
- Why scanning bar codes slow? HOT 4
- Maui Android No Scan QR Code plsQCFASensor = null
- Baby's
- Fix bugs
- Issue about decode QR code fail caused by wrong square marker detected HOT 2
- Does the ZXing 3.5.3 version support JDK17 and JDK21? HOT 2
- PDF417 Incorrect dimension error? HOT 1
- This creation is my personal
- The PDF417 code is generated, but the scanner cannot recognize it normally? HOT 1
- BarCode Scanner device Orientation not changing in ipad and Tablet HOT 2
- High CPU Usage Due to Invert Colors Function in QRCodeAnalyzer HOT 1
- InactivityTimer never fires 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 zxing.