Commit graph

3780 commits

Author SHA1 Message Date
Peter Abeles 6c2ea9e6bc
Update README.md (#1485)
Added BoofCV to related third-party open source projects
2022-01-18 18:31:45 -06:00
Sean Owen 10d6b08fc6 Probable fix for AIOOBE from https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43765 2022-01-18 14:29:46 -06:00
Sean Owen 037efb0c28 Set FEATURE_SECURE_PROCESSING when reading XML in HtmlAssetTranslator, just in case (#1482) 2022-01-14 08:43:05 -06:00
Sean Owen b30da44d01 Add ReaderException.setStackTrace 2022-01-12 14:18:32 -06:00
AlexGeller1 ab23778d4b
Minimal encoding for Data Matrix with multi ECI and GS1-FNC1 support (2nd) (#1479)
* Added Data Matrix minimal encoding with multi-ECI and GS1-FNC1 support.

* Added support for MACRO-5 and MACRO-6

* Improved comment
2022-01-12 11:58:24 -06:00
Sean Owen 491006ac3b Add isStackTrace support to NotFoundException 2022-01-11 10:48:24 -06:00
AlexGeller1 c4266bf09c
Add support for multiple character-ECIs in data matrix decoder (#1474)
* Added support for multiple character-ECIs

* - Changed from ArrayList<Byte> to ByteArrayOutputStream
- Added blank lines

* Improved performance for the general case (without ECI)
2022-01-05 09:32:36 -06:00
AlexGeller1 9b972bbb07
Simplified code, improved memory usage and performance of the QR-Code minimal encoder. (#1465)
* Simplified code, improved memory usage and performance.

* Simplified code
2021-12-08 09:11:04 -06:00
AlexGeller1 21eb978d67
Fix of error in specification ISO/IEC 16022 Second edition Annex P as suggested by Martin Burke of zint (See 68566fefd2/) (#1459)
Quote of Martin's proposed changes to the spec:
The algorithm can be salvaged to be at least sound by making those changes, e.g. by adding to step e):

 "1) If the next character cannot be encoded as X12, switch to ASCII mode and go to step b)."

(and renumbering the following sub-steps). Similarly step f):

"1) If the next character cannot be encoded as EDIFACT, switch to ASCII mode and go to step b)."
2021-11-15 18:25:31 -06:00
AlexGeller1 c25029d29a
Fix bug624: Illegal Character Exception (#1454)
* - added code to suppress the terminator if the capacity of the version is less than 4 bit
- added test case

* - Removed code in MinimalEncoder that added Mode.TERMINATOR (is taken care of in Encoder.terminateBits)
- Removed the corresponding test case

* Updated test cases

* Improved documentation

* Changed documentation to not use an example with an unsupported character encoding

* Improved wording of comment

* - Simplified code
- Added space after comma in several places

* Added support for more character sets supported by CharacterSetECI

* Syntactic enhancements

* Changed instantiation of generic types to diamond style

* Updated documentation of the QR_COMPACT hint to explain the impact of setting the CHARACTER_SET hint .

* Changed whitespace

* Removed comment

* Fixed typos in comments

* Added text cases for KANJI and Shift_JS encoding

* Improved comments on Japanese language test cases

* Fixed bug

* Compacted code slightly

* Whitespace changes

* Deepend indent
2021-11-11 08:23:33 -06:00
Sean Owen 6c034f9775 Minor code tweaks 2021-10-21 23:38:11 -05:00
AlexGeller1 2e22d09479
Compact QR-Code: Support more character sets (in particular cp1256 (Arabic) and Shift-JIS) (#1453)
* - added code to suppress the terminator if the capacity of the version is less than 4 bit
- added test case

* - Removed code in MinimalEncoder that added Mode.TERMINATOR (is taken care of in Encoder.terminateBits)
- Removed the corresponding test case

* Updated test cases

* Improved documentation

* Changed documentation to not use an example with an unsupported character encoding

* Improved wording of comment

* - Simplified code
- Added space after comma in several places

* Added support for more character sets supported by CharacterSetECI

* Syntactic enhancements

* Changed instantiation of generic types to diamond style

* Updated documentation of the QR_COMPACT hint to explain the impact of setting the CHARACTER_SET hint .

* Changed whitespace

* Removed comment

* Fixed typos in comments

* Added text cases for KANJI and Shift_JS encoding

* Improved comments on Japanese language test cases
2021-10-21 10:10:28 -05:00
AlexGeller1 c729abe393
Compacted QR-code: remove needless adding of Mode.TERMINATOR (is taken care of in Encoder.terminateBits) (#1452)
* - added code to suppress the terminator if the capacity of the version is less than 4 bit
- added test case

* - Removed code in MinimalEncoder that added Mode.TERMINATOR (is taken care of in Encoder.terminateBits)
- Removed the corresponding test case

* Updated test cases

* Improved documentation

* Changed documentation to not use an example with an unsupported character encoding

* Improved wording of comment

* - Simplified code
- Added space after comma in several places
2021-10-19 08:47:58 -05:00
AlexGeller1 128775149b
Add support for EncodeTypeHint.CHARACTER_SET for compacted QR-Codes (#1450)
* Added experimental version of QR-Code compaction which can be activated via EncodeHintType.QR_COMPACT

* - Changed algorithm from recursive divide and conquer to iterative Dijkstra
- Performed the requested modifications.

* Added better debug output and better documententation of the algorithm

* - Added missing error handling in case of a failing assert
- Fixed typo in the documentation

* Fixed bug that the minimal encoder would fail with an internal error if the string to encode contained only characters from ISO-8859-1 and on or more character that is not defined in any of the ISO-8859 characters sets.

* Added unit tests

* - indented class and method comments
- fixed code indententation
- added vertical spacing in statement lists to separate locical blocks
- added comments to document some numeric constants
- commented out debug logging
- made class ResultNode final and all but the methods called by the
class Encoder private.

* - Fixed indentation and line length
- Improved comments

* Fixed line length

* Improved comments

* - Whitespace and comment style changes
- Replaced string concatentation with StringBuilder.append()
- Replaced Vector with ArrayList
- Made members that are ony modified in the constructor final
- Made other minor changes

* - Made more members final
- replaced assert by throwing an IllegalStateException

* Changed internal data representation to be based on java.util.LinkedList

* Removed uneccessary spaces and comments

* Improved the debug output (now produces a compacted graph)

* - Added code to exclude not supported ECIs
- Fixed regression that bits were incorrectly computed

* - Fixed regression that bits were wrongly computed
- Improved compaction
- added a commented proposal for unit test that makes use of the decoder to validate the encoded bits

* Removed useless comparisons

* Removed commented code

* Optimization: added code to cache the value of LinkedList.size().

* Added more test cases

* - Added support for EncodeTypeHint.CHARACTER_SET
- Added support to encode in all ISO-8859 character sets available on the platform
- Removed code that handles failing asserts

* - Replaced string switch case with HashMap lookup
- Reintroduced asserts

* - Replaced <code> with {@code}
- Changed indentation in comment
- Simplified code

* Improved documentation

* Added comment about decoding compatibility with zxing.

* - Made MinimalEncoder responsible of ensuring that the bits fit in the returned version.
- Removed asserts that throw NPE in case of falure.

* Restricted encoder to use only encodings defined in CharacterSetECI

* Improved clarity and readability of the algorithm and of the datastrutures used.
- Minimizing algorithm is based on immutable edges
- ResultList now contains exaclty one ResultNode per mode and possibly several as before

* Changed unit tests (forgotten in previous push)
2021-10-17 08:57:06 -05:00
Sean Owen 831ebac6e7 Minor code style updates to MinimalEncoder and a few other files ; minor dep updates 2021-10-12 21:06:05 -05:00
AlexGeller1 3909ebe294
Fix qr compaction (#1449)
* - Added missing error handling in case of a failing assert
- Fixed typo in the documentation

* Fixed bug that the minimal encoder would fail with an internal error if the string to encode contained only characters from ISO-8859-1 and on or more character that is not defined in any of the ISO-8859 characters sets.
2021-10-12 09:09:19 -05:00
Sean Owen f984496a10 Fix javadoc error 2021-10-11 11:44:10 -05:00
Choi Su Beom f4f3c2971d
fix(core): do not evaluate out of index as white on qrcode mask evaluation (#1446)
* fix(core): do not evaluate out of index as white on qrcode mask evaluation
2021-10-09 13:15:00 -05:00
AlexGeller1 7a760c6384
Added experimental version of QR-Code compaction (#1445)
* Added experimental version of QR-Code compaction which can be activated via EncodeHintType.QR_COMPACT
2021-10-09 10:50:46 -05:00
Sean Owen af7831b5c7 Optimization for https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=39707 2021-10-07 21:31:16 -05:00
Sean Owen b51346c072
Enforce line length and indent in checkstyle (#1448) 2021-10-05 15:49:47 -05:00
Anders Hammarquist fc50fca12f
Fix decoding of FNC1 in AztecCode. (#1441)
* Fix decoding of FNC1 in AztecCode. Flush buffer to make sure FNC1 is output in the correct
position in the stream.

* Simplify. Flush buffers outside switch, as it happens for all non-error cases anyway.
2021-09-28 15:28:07 -05:00
Anders Hammarquist 83650ce341
Add option to output raw bitstream from CommandLineRunner. (#1442)
* Add option to output raw bitstream from CommandLineRunner.
Useful for debugging barcodes. Same as the web decoder.

* Use StringBuilder. Fix indentation.
2021-09-28 15:27:49 -05:00
Sean Owen be2c5bdd88 Fix for https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38913 2021-09-17 21:46:37 -05:00
Sean Owen c6a4e0fa97 Optimization for https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38541 2021-09-11 18:03:19 -05:00
Sean Owen f5ef61ec13 Possible fix for https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38486 2021-09-11 08:56:09 -05:00
Sean Owen 91a423b050 Possible fix for https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38309 2021-09-09 12:04:56 -05:00
Sean Owen 0235f355ff Possible fix for https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38197 ; refactor FieldParser data impl 2021-09-06 20:43:18 -05:00
Sean Owen 8761b26a50 Fix Clirr 2021-09-06 08:40:36 -05:00
Sean Owen 895775efa5 Possible fix for https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38181 ; disallow encodings not supported by the JVM 2021-09-06 07:23:27 -05:00
MakKi (makki_d) f04ab98f97
fix valid y range (#1430) 2021-09-05 11:57:11 -05:00
Sean Owen aeeec7b07f Possible fix for https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38086 2021-09-04 08:46:11 -05:00
Sean Owen 5b0036446e Fix for https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38010 2021-09-02 09:27:41 -05:00
Sean Owen 6bcae2e5ea Minor hack to fix corner case from https://oss-fuzz.com/testcase-detail/5178194588729344 2021-09-01 22:13:16 -05:00
Sean Owen 50ead4f658 Another possible improvement against https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=37905&q=label%3AProj-zxing 2021-09-01 21:31:36 -05:00
Sean Owen 490769e75f Possible fix for https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=37905 2021-09-01 12:48:20 -05:00
Sean Owen f6087eea12 Another possible fix for https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=37858 2021-08-31 12:07:57 -05:00
Sean Owen 629ce38a5d Dependency, plugin updates 2021-08-30 20:08:56 -05:00
Sean Owen dc6c8ea422 Possible fix for https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=37868 2021-08-30 20:06:44 -05:00
Sean Owen 73a3c3a704 Possible fix for https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=37858 2021-08-30 13:35:02 -05:00
Sean Owen b3941e251b Possible fix for https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=37853 2021-08-30 13:24:58 -05:00
Sean Owen 2b48aec2c4 Possible fix for https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=37811 2021-08-30 10:01:28 -05:00
gschwaer d2027d0e0f
Introduce hint to force specific code set for Code-128 encoding (#1411)
* Introduce hint to force specific code set for Code-128 encoding

* Address review comments

* Make character check more readable; address review comments

* Address review comments

Co-authored-by: Gero Schwäricke <gero@schwaericke.email>
2021-07-29 15:28:21 -05:00
Sean Owen 0d08915628 Minor changes from code inspection 2021-07-27 09:20:28 -05:00
Ikko Ashimine 1499c92178
Fix typo in ResultMetadataType.java (#1410)
identifer -> identifier
2021-07-26 18:46:34 -05:00
Sean Owen 32331c0708 Fix possible AIOOBE from fuzz test 2021-07-16 11:47:49 -05:00
MakKi (makki_d) ad061f05e2
Fix symbology identifier tests (#1396)
* rename metadata test files

* implement symbology identifier on ITFReader

* add metadata test

* remove unused code
2021-06-07 07:11:10 -05:00
Sean Owen adbf17d7a7 Minor code and dep changes; return better HTTP status codes from web app 2021-05-23 09:16:45 -05:00
gitlost d4c3d73592
PDF417 Macro: fileId numeric decode; allow Macro only symbol (#1379)
* PDF417 Macro: fileId numeric decode; allow Macro only symbol

* PDF417 Macro: additional FormatException unit tests
2021-04-12 09:44:42 -05:00
dehnhard 99e9b34f5a
Update ResultMetadataType.java (#1376) 2021-04-06 10:19:57 -05:00