summaryrefslogtreecommitdiff
path: root/core
AgeCommit message (Collapse)AuthorFilesLines
2026-07-28Fix PDF infinite loop (#2128)Sean Owen1-1/+2
Port of https://github.com/zxing-cpp/zxing-cpp/pull/320
2026-07-12reject bit matrix not matching layer count in aztec extractBits (#2117)jmestwa-coder2-2/+24
2026-07-09Address Issue #2115, Aztec grid (#2116)Sean Owen2-1/+31
2026-07-07reject non-positive datablock count in aztec correctBits (#2114)jmestwa-coder2-1/+20
2026-06-26reject negative and overflowing crop in core LuminanceSource classes (#2112)jmestwa-coder4-2/+24
the crop constructors in PlanarYUVLuminanceSource and GrayscaleLuminanceSource did not reject negative offsets or sizes and overflowed when checking left+width and top+height, letting an out-of-bounds crop reach getRow and getMatrix; validate the rectangle the same way as BufferedImageLuminanceSource.
2026-06-24fix quadratic backtracking in URIResultParser isPossiblyMaliciousURI (#2110)jmestwa-coder2-2/+57
2026-06-23use anchored matching in URIResultParser.isBasicallyValidURI (#2109)jmestwa-coder2-5/+15
2026-06-22Clear padding bits in BitMatrix.flip() so they are not read as set (#2108)Vasiliy Mikhailov2-0/+43
BitMatrix.flip() inverted every int in bits[], including the unused padding bits beyond the logical width in each rows last int. Methods that scan the raw bits (getTopLeftOnBit/getBottomRightOnBit/getEnclosingRectangle/equals) then treated those stray bits as part of the matrix, e.g. getBottomRightOnBit() returning (31,4) instead of (4,4) on a 5x5 matrix. Mask off the padding after flipping. Adds a regression test.
2026-06-22guard truncated structured carrier message in maxicode decode (#2106)jmestwa-coder2-0/+25
2026-06-21format decoded digits locale-independently in maxicode/pdf417/aztec (#2100)jmestwa-coder5-5/+52
2026-06-21fix catastrophic backtracking in email domain regex (#2099)jmestwa-coder2-1/+12
2026-06-20reject wrong-size bit matrix in maxicode BitMatrixParser (#2098)jmestwa-coder2-1/+69
2026-06-20reject non-square bit matrix in qrcode BitMatrixParser (#2096)jmestwa-coder1-2/+2
2026-06-20reject oversized received array in pdf417 ErrorCorrection.decode (#2097)jmestwa-coder2-0/+21
2026-06-16guard empty symbol in code39 check digit handling (#2092)jmestwa-coder2-0/+22
2026-06-15avoid NegativeArraySizeException in aztec getEncodedData (#2091)jmestwa-coder2-1/+8
2026-06-13guard truncated symbol in rss expanded AI01AndOtherAIs decoder (#2089)jmestwa-coder2-0/+41
2026-06-12guard unterminated AI in ExpandedProductResultParser (#2088)jmestwa-coder2-1/+12
2026-06-05guard trailing shift char in code39 decodeExtended (#2086)jmestwa-coder2-0/+23
2026-06-05avoid out-of-bounds reads after control codewords in pdf417 parser (#2085)jmestwa-coder2-3/+50
2026-06-03guard base256 length read in datamatrix decodeBase256Segment (#2084)jmestwa-coder2-0/+12
2026-06-03avoid out-of-bounds read in pdf417 decodeMacroBlock (#2083)jmestwa-coder1-4/+8
* avoid out-of-bounds read in pdf417 decodeMacroBlock * use maxLength local for codewords[0] in decodeMacroBlock
2026-05-30avoid out-of-bounds read for NS sequence in maxicode getMessage (#2079)jmestwa-coder1-1/+4
2026-05-27Avoid charset provider lookups for UTF-8 QR encoding (#2077)Mygod3-21/+103
* Avoid charset provider lookups for UTF-8 QR encoding * Simplify charset lookup handling
2026-05-01Add reader initialization support for Data Matrix and PDF417 (#2069)Daniel Gredler15-16/+45
2026-05-01Add Code 128 reader initialization support (#2068)Daniel Gredler7-5/+13
2026-04-30Fix filling in of stack traces during testing (#2067)Daniel Gredler1-2/+5
2026-04-30Add Aztec reader initialization support (#2066)Daniel Gredler13-7/+78
2026-04-08Fix QR decode failure for small/native-size images (#2061)Andrew Szeto3-3/+78
* Fix QR decode failure for small/native-size images (#1976) QRCodeWriter.encode(..., 0, 0) produces a 33x33 native-size QR that ZXing cannot decode. The CENTER_QUORUM filter in selectBestPatterns() (added in 110ef9e to fix #1567) removes finder patterns with count < 2. For small images, the row-skip interval (iSkip=3, MIN_SKIP) means the scanner only crosses the top two finder pattern centers on a single row each, giving them count=1. The bottom-left pattern gets count=2 because it's scanned after iSkip drops to 2. The filter then removes the two count=1 patterns, leaving 1 of the 3 needed, and throws NotFoundException. The fix: only apply the CENTER_QUORUM filter when either (a) at least 3 confirmed patterns would survive, or (b) the total candidate list exceeds a size threshold. This preserves #1567 protection while allowing small images through. Why a size threshold: the filter was added to prevent O(n^3) blowup in the triangle-selection loop when noisy images produce thousands of spurious candidates. When the candidate list is small (<= 25 entries, yielding <= ~2300 loop iterations), the cubic cost is negligible regardless of whether the patterns are real or spurious. A clean single-QR image produces ~3 candidates; even a noisy image below the threshold is computationally trivial. Above the threshold, the filter applies unconditionally, matching today's behavior. Alternatives considered: - Removing the filter entirely: all 561 existing tests pass, but re-opens #1567 for pathological images with thousands of spurious count=1 candidates. - Reducing MIN_SKIP from 3 to 1 for small images: addresses the symptom (more scan rows = higher counts) but doesn't fix the fundamental interaction between iSkip and the quorum filter, and changes scan behavior for all small images. - Fallback (try with filter, retry without on failure): re-opens #1567 whenever fewer than 3 confirmed patterns exist, which is exactly the scenario that produces thousands of unconfirmed candidates in noisy images. * Increase noisy-image test timeout from 5s to 30s GitHub shared runners timed out at 5s. Local measurement shows ~1.2s, implying at least 4x slowdown on CI. 30s gives a comfortable margin while still catching the O(n^3) regression from #1567.
2026-02-04Add ERRORS_CORRECTED metadata to QRCodeMultiReader (#2044)Miztan1-0/+1
2025-11-11[maven-release-plugin] prepare for next development iterationSean Owen1-2/+2
2025-11-11[maven-release-plugin] prepare release zxing-3.5.4zxing-3.5.4Sean Owen1-1/+1
2025-11-11Restore 3.5.4-SNAPSHOTSean Owen1-1/+1
2025-11-11[maven-release-plugin] prepare release zxing-3.5.4Sean Owen1-2/+2
2025-11-11[maven-release-plugin] rollback the release of zxing-3.5.4Sean Owen1-2/+2
2025-11-11[maven-release-plugin] prepare for next development iterationSean Owen1-2/+2
2025-11-11[maven-release-plugin] prepare release zxing-3.5.4Sean Owen1-2/+2
2025-11-11[maven-release-plugin] rollback the release of zxing-3.5.4Sean Owen1-2/+2
2025-11-11[maven-release-plugin] prepare release zxing-3.5.4Sean Owen1-2/+2
2025-11-11Loosen ITF max variance for 3x module widths (#2014)Daniel Gredler4-6/+9
2025-11-11Add GrayscaleLuminanceSource (#2013)Daniel Gredler3-120/+276
2025-11-10Add 90-degree rotation support to RGBLuminanceSource (#2012)Daniel Gredler2-1/+71
2025-07-23Add input validation for pixel array length in RGBLuminanceSource and add ↵Leo Fernandes2-0/+18
test case for regression (#1961)
2025-02-10Comment on distortion calculation for isosceles right triangles (#1908)magethle1-0/+2
* Fix distortion calculation for isosceles right triangles * Revert "Fix distortion calculation for isosceles right triangles" This reverts commit 4a8ad9a5bea9d0be251450f9e0db15b16e85e1ac. * Add comment to distortion calculation The formula for calculating the distortion seems wrong but practically it seems to work slightly better
2025-02-04Add hint to correct wrong dimension (#1901)magethle1-1/+2
* Add hint to correct wrong dimension Fix issue #1900 * Revert "Add hint to correct wrong dimension" This reverts commit 16723b3434a78ab49894f611cfb57c3e712b9b97. * Correct wrong dimension to lower value Fix issue #1900 * Cleanup code --------- Co-authored-by: Matthias Agethle <matthias.agethle@elca.ch>
2024-11-17Fixing issue #1831 (#1879)François Tiercelin2-4/+57
* throw a more explicit exception when trying to PDF417/TEXT encode something outside of 0...255 * refactor PDF417HighLevelEncoder to avoid code duplication extend UT to new method PDF417HighLevelEncoder#checkCharset * fix javadoc typo make UT more stringent on PDF417HighLevelEncoder#checkCharset * restrict TEXT to 0...127 test with CP437 and Greek chars * reinstate testEncodeAuto UT * refactor testEncodeAuto UT * address codacy findings * formatting * fix issue #1831 make PDF417#determineDimensions to enable finer UT add UT coverage to validate fix for #1831 * fix javadoc for PDF417#determineDimensions remove stacktrace when UT fails * make UT Java 8 compliant
2024-10-22PDF417: Check that input is made of 0...127 chars when using ↵François Tiercelin2-13/+116
Compaction.TEXT, throw an explicit exception if not the case (#1878) * throw a more explicit exception when trying to PDF417/TEXT encode something outside of 0...255 * refactor PDF417HighLevelEncoder to avoid code duplication extend UT to new method PDF417HighLevelEncoder#checkCharset * fix javadoc typo make UT more stringent on PDF417HighLevelEncoder#checkCharset * restrict TEXT to 0...127 test with CP437 and Greek chars * reinstate testEncodeAuto UT * refactor testEncodeAuto UT * address codacy findings * formatting
2024-10-19Be more stringent on email validation rules (#1870)François Tiercelin3-4/+32
* be more stringent on email validation rules add UT to validate various email formats * fix indentation * fix failing UT case * refine regex for email's domain: * only letters in the last part * no part starting or ending with a - (- allowed inside the part) add UT to cover such cases
2024-08-02Fix SYMBOLOGY_IDENTIFIER loss in QRCodeMultiReader (#1839)xiebaiyuan1-0/+3
2024-05-02Promote renderResult method to public (#1801)cdcarloschacon2-4/+75
This small commit makes public the "renderResult" method of the "QRCodeWriter" class. The reason to promote this method as public is that I'm facing Business Case where, besides of generating the QR code as a PNG image, I also need to print information about the QR code itself (specifically, the QR version). Navigating through the code of zxing library, I noticed that the com.google.zxing.qrcode.encoder.Encoder allows me to have that (the QR metadata); however, by invoking that class I only have part of the equation (the QRCode DTO) ... I'm still needing to generate the BitMatrix in order to produce the QR image. Here, I have two alternatives: either I invoke the Encoder.encode class by myself and repeat the same logic when invoking the QRCodeWriter.encode method; or I make the renderResult Public, call the Encoder.encode and then I proceed to call the QRCodeWriter.renderResult method with the previous result.