summaryrefslogtreecommitdiff
path: root/core/src/test/java
AgeCommit message (Collapse)AuthorFilesLines
2022-01-12Minimal encoding for Data Matrix with multi ECI and GS1-FNC1 support (2nd) ↵AlexGeller11-3/+148
(#1479) * Added Data Matrix minimal encoding with multi-ECI and GS1-FNC1 support. * Added support for MACRO-5 and MACRO-6 * Improved comment
2021-11-16Fix of error in specification ISO/IEC 16022 Second edition Annex P as ↵AlexGeller11-0/+27
suggested by Martin Burke of zint (See https://sourceforge.net/p/zint/code/ci/68566fefd2a4623041b0232a5941f8fed1e22018/) (#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-11Fix bug624: Illegal Character Exception (#1454)AlexGeller11-9/+9
* - 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-10-21Compact QR-Code: Support more character sets (in particular cp1256 (Arabic) ↵AlexGeller11-0/+23
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-19Compacted QR-code: remove needless adding of Mode.TERMINATOR (is taken care ↵AlexGeller11-44/+41
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-17Add support for EncodeTypeHint.CHARACTER_SET for compacted QR-Codes (#1450)AlexGeller11-52/+56
* 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-12Fix qr compaction (#1449)AlexGeller11-82/+116
* - 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-09fix(core): do not evaluate out of index as white on qrcode mask evaluation ↵Choi Su Beom2-147/+166
(#1446) * fix(core): do not evaluate out of index as white on qrcode mask evaluation
2021-10-09Added experimental version of QR-Code compaction (#1445)AlexGeller11-0/+187
* Added experimental version of QR-Code compaction which can be activated via EncodeHintType.QR_COMPACT
2021-10-05Enforce line length and indent in checkstyle (#1448)Sean Owen23-713/+768
2021-09-28Fix decoding of FNC1 in AztecCode. (#1441)Anders Hammarquist1-0/+5
* 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-07-29Introduce hint to force specific code set for Code-128 encoding (#1411)gschwaer1-0/+82
* 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-27Minor changes from code inspectionSean Owen2-41/+26
2021-04-12PDF417 Macro: fileId numeric decode; allow Macro only symbol (#1379)gitlost1-4/+81
* PDF417 Macro: fileId numeric decode; allow Macro only symbol * PDF417 Macro: additional FormatException unit tests
2021-04-04MaxiCode decoding: add missing NS to Set C (#1375)gitlost1-1/+1
2021-04-02Update dependencies and add one new testSean Owen1-0/+1
2021-04-02Add support for guessing UTF-16 encoding based on BOMSean Owen1-1/+21
2021-04-02inverted barcode support (#1371)dehnhard3-1/+78
* also decodes inverted barcode on hint Co-authored-by: Daniel Dehnhard <daniel@dehnhard.it>
2021-03-18Aztec Detector::getDimension() fix for layers 27 (131x131) (#1370)gitlost1-4/+4
2021-03-18Update DMRE versions to ISO/IEC 21471:2020 (#1369)gitlost1-0/+36
2020-12-09Improve test coverageSean Owen3-1/+70
2020-12-08Misc dead code cleanup, plugin updatesSean Owen6-111/+27
2020-11-09PDF417 detector: try 90 and 270 rotations also (#1333)Dan Lenski2-0/+18
2020-11-08Aztec encode with ECI for non-default character sets (#1330)Dan Lenski4-46/+58
* Aztec encoder: add ECI codes according to character set Added redundant methods to avoid modifying existing tests. * fix testAztecWriter - ISO-8859-1 cannot actually encode Euro symbol ('€'); this test case only passed before because the Decoder wasn't actually doing the bytes→String decode, but simply round-tripping an unknown byte. - Add extra test cases for implicit ISO-8859-1 (without ECI code), explicit ISO-8559-1 (with ECI code), and Shift_JIS * remove unnecessary conversion between String and byte[] in Aztec EncoderTest and DetectorTest * Aztec DecoderTest: use constants for charsets * Aztec Code: remove unnecessary conversion between Charset and Charset.name() strings * PDF417, QR, DataMatrix: remove unnecessary conversion between Charset and Charset.name() strings Includes replacing StringUtils.guessEncoding() with .guessCharset(), to return Charset rather than String. This change makes the tacit assumption that Shift_JIS charset *will* be available. There are existing comments suggesting that it might not always be available… but the existing *tests* assume it will be.
2020-10-28Aztec Code: decode ECI and FNC1 (#1328)Dan Lenski2-14/+70
* decode Aztec FLG(n) Per https://en.wikipedia.org/wiki/Aztec_Code#Character_set, FLG(0) → FNC1, FLG(1-6) → ECI identifier Decode FNC1 as 0x1d (ASCII escape character; same as Code128, DataMatrix, others) Not doing anything with ECI yet, but this at least fixes the mis-synchronization of the bit stream that comes from ignoring the bits that follow it. * include ecLevel (percentage) in DecoderResult for Aztec * Aztec decoder: follow character set indicated by ECI codes Modeled on PDF417's DecodedBitStreamParser * add testAztecResultECI and testHighLevelDecode to aztec.decoder.DecoderTest The latter includes non-ECI, ECI, and mixed test cases.
2020-09-07Many small updates from code analysis; remove unused files; tune server ↵Sean Owen9-51/+43
params (#1311)
2020-06-06Misc code simplification and editsSean Owen1-0/+1
2019-12-12Plugin updates; misc code simplifications and optimizationsSean Owen3-42/+29
2019-07-29Don't run Aztec test 1000 times pointlesslySean Owen1-33/+31
2019-07-29Add addition wifi: QR code test case from mailing listSean Owen1-1/+2
2019-06-16findFinderPattern()[1] points the outside pixel of the finder pattern (#1179)MakKi (makki_d)1-2/+2
2019-05-14Bump to 3.4.0. Require Java 8. Various code simplifications and plugin / dep ↵Sean Owen4-73/+16
updates
2019-04-18Improve FinderPatternFinder.selectBestPatterns (#1158)MakKi (makki_d)1-1/+1
* rewrite FinderPatternFinder.selectBestPatterns
2019-03-22Remove duplicate results when it has structured append header. (#1147)MakKi (makki_d)1-0/+37
* remove duplicate results in processStructuredAppend * add whitespace * remove illegal import
2019-01-20Small code improvements from inspectionsSean Owen6-23/+23
2018-11-15Continue in codeset A when character encoded single number or FNC1-4 in ↵MakKi (makki_d)1-3/+18
Code128Writer (#1108) * Continue in code A when character encodes FNC1-4 in Code128Writer * FNC1 in codeset A * Single number also can continue in codeset A
2018-11-09Support Full-ASCII in Code93Writer (#1104)MakKi (makki_d)1-0/+24
* support extended characters in Code93Writer * remove redundancy * add test for convertToExtended * thanks for review * fix comment, use package-private for testing
2018-11-02fix code93 extended character decoder (#1101)MakKi (makki_d)1-0/+49
2018-10-04Rewrite DataMatrix Detector (#1080)MakKi (makki_d)1-4/+4
* rewrite datamatrix detector * comments * remove unused * modify test * fix CI errors
2018-09-22Fixed duplicated assertion (#1072)Ben John1-2/+2
2018-09-03Many more changes from recent IJ inspectionsSean Owen1-3/+3
2018-08-06Tighten definition of what's accepted as a URI, to exclude some potentially ↵Sean Owen3-5/+12
malicious ones
2018-07-23fix binary shift cost heuristics (#1044)Andreas Niederle1-2/+34
* fix binary shift cost heuristics * corrected some indents
2018-07-10Check if characters are digits for EAN_13, EAN_8, ITF and UPC_EAN_EXTENSION ↵Koen van Vliet4-0/+17
(#1039) * Check if characters are digits * Use regex to check if input is valid. Added tests * Create checkNumeric method * Remove unused locals, moved attributes to top of class. * Simplify testcase * Reduce repeated code * Fixed indentation
2018-06-20Fix QR-code hanzi segment decoder (#1033)MakKi (makki_d)1-0/+13
* Fix QR-code hanzi segment decoder * remove unicode character
2018-06-19remove spacing from head of polynomial string (#1032)MakKi (makki_d)1-0/+2
2018-06-03Oops, fix checkstyleSean Owen1-0/+3
2018-06-03Move and slightly add to new GenericGFPoly testsSean Owen2-7/+45
2018-06-03String of zero polynomial be "0" (#1020)MakKi (makki_d)1-1/+8
* String of zero polynomial be "0" * add test * add more test * modify test case
2018-05-18Apply checkstyle to test code too, and fix violations; minor updates from ↵Sean Owen44-194/+279
code inspections