Skip to content

Commit

Permalink
2D matrix symbols with custom module width should maintain aspect ratio
Browse files Browse the repository at this point in the history
  • Loading branch information
gredler committed Mar 13, 2024
1 parent 1893868 commit 1e84b62
Show file tree
Hide file tree
Showing 20 changed files with 282 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/main/java/uk/org/okapibarcode/backend/AztecCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ protected void encode() {
}
}
}
row_height[y - AZTEC_COMPACT_OFFSET[layers - 1]] = 1;
row_height[y - AZTEC_COMPACT_OFFSET[layers - 1]] = moduleWidth;
pattern[y - AZTEC_COMPACT_OFFSET[layers - 1]] = bin2pat(bin);
}

Expand Down Expand Up @@ -721,7 +721,7 @@ protected void encode() {
}
}
}
row_height[y - AZTEC_OFFSET[layers - 1]] = 1;
row_height[y - AZTEC_OFFSET[layers - 1]] = moduleWidth;
pattern[y - AZTEC_OFFSET[layers - 1]] = bin2pat(bin);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/uk/org/okapibarcode/backend/AztecRune.java
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ protected void encode() {
}
}
pattern[row] = bin2pat(rowBinary);
row_height[row] = 1;
row_height[row] = moduleWidth;
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/uk/org/okapibarcode/backend/CodeOne.java
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ protected void encode() {
}
}
pattern[i] = bin2pat(bin);
row_height[i] = 1;
row_height[i] = moduleWidth;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/uk/org/okapibarcode/backend/GridMatrix.java
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ protected void encode() {
bin.append('0');
}
}
row_height[x] = 1;
row_height[x] = moduleWidth;
pattern[x] = bin2pat(bin);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/uk/org/okapibarcode/backend/MicroQrCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ protected void encode() {
}
}
pattern[i] = bin2pat(bin);
row_height[i] = 1;
row_height[i] = moduleWidth;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/uk/org/okapibarcode/backend/QrCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ protected void encode() {
}
}
pattern[i] = bin2pat(bin);
row_height[i] = 1;
row_height[i] = moduleWidth;
}
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
PROPERTIES

moduleWidth=2
content=this_is_just_a_test

LOG

ECI Mode: 3
ECI Charset: ISO-8859-1
Encoding: LL 21 9 10 20 ML 23 LL 10 20 ML 23 LL 11 22 20 21 ML 23 LL 2 ML 23 LL 21 6 20 21
Codewords: 57 21 10 42 29 47 49 21 14 55 56 46 53 10 61 47 48 23 27 60 42 26 37 31
Compact Mode: true
Layers: 2
Codeword Length: 6 bits
Data Codewords: 24
ECC Codewords: 16
Mode Message: 01010111
Blocks Merged: 93 -> 75

CODEWORDS

2131314112
111314314
011111115232
011121323212
0151111121122
01>13
022117312
11112151231
123113111131
111211111111123
1111211311123
14115112111
012217321
32:4
013221211321
1223314111
22663
214111441
2631313
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
PROPERTIES

moduleWidth=2
content=123

LOG

Binary: 1101000101100010000000000101
Blocks Merged: 29 -> 19

CODEWORDS

41141
;
272
01115111
2113112
01111111112
0111131111
01115111
011711
01:
0812
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
PROPERTIES

moduleWidth=2
preferredVersion=A
content=testing123

LOG

Version: A
Codewords: 239 209 49 209 204 125 207 44 8 255
ECC Codeword Count: 10
Grid Size: 4 X 5
Blocks Merged: 53 -> 46

CODEWORDS

314112411
5413131
22125411
22112172
041145111
041715
B
0B
01@1
011>11
01@1
1341121113
21424113
1114231311
0332212131
011111121111411
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
PROPERTIES

moduleWidth=2
forceMode=SQUARE
content=this_is_a_test

LOG

ECI Mode: 3
ECI Charset: ISO-8859-1
Encoding: TEX (33 21 22) (32 1 26) (22 32 1) (26 14 1) (26 33 18) (32 33 0) ASC
Codewords: 239 209 159 200 67 142 130 164 178 167 187 205 41 254
Grid Size: 18 X 18
Data Codewords: 18
ECC Codewords: 14
Blocks Merged: 89 -> 78

CODEWORDS

239
209
159
200
67
142
130
164
178
167
187
205
41
254
129
237
133
28
224
159
25
203
120
146
42
120
80
194
13
54
240
206
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
PROPERTIES

moduleWidth=2
content=this_is_a_test

LOG

Using GB2312 character encoding
Encoding: LOWR 19 7 8 18 SHT/58 8 18 SHT/58 0 SHT/58 19 4 18 19
Codewords: 28 103 34 47 94 72 75 119 80 31 61 38 36 83 108
Layers: 2
ECC Level: 5
Data Codewords: 15
ECC Codewords: 25
Grid Size: 5 X 5
Blocks Merged: 193 -> 165

CODEWORDS

66666
213111212131112121111
3121416141213
1211161416231
661416141
66666
066666
011112114211111121111211
06623111121114
04111411111211112132
032114131241111211
066666
66666
2111121312323121111
132612311121231
1142222221236
12312332111121231
66666
066666
011112112112111111121114
062223216222
022221111321312222
011112111211211114121111
066666
66666
23111421111114231
6132222411312
1211131212311211123
612323114111112
66666
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
PROPERTIES

eccMode=L
preferredVersion=3
moduleWidth=2
content=0H

LOG

Encoding: ALPH (2) 17
Codewords: 72 8 128 236 17 236 17 236 0
Version: M3
ECC Level: M
Mask Pattern: 10
Blocks Merged: 63 -> 45

CODEWORDS

711111111
15132111
113115111
113115111
11311221111
151152
71111121
0;112
1322142
02113111221
251111211
01241232
23121321
014122113
21222222
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
PROPERTIES

moduleWidth=2
content=ABC $%*+-./:DEF123

LOG

ECI Mode: 3
ECI Charset: ISO-8859-1
Encoding: ALPH 461 576 1703 1795 1887 1979 599 676 93
Codewords: 32 145 205 72 26 159 129 245 255 118 149 213 32 93 0 236
Version: 1
ECC Level: M
Mask 000 Penalties: 98 221 741 741
Mask 001 Penalties: 126 276 796 EXIT
Mask 010 Penalties: 141 348 828 EXIT
Mask 011 Penalties: 141 354 874 EXIT
Mask 100 Penalties: 115 274 834 EXIT
Mask 101 Penalties: 125 317 797 EXIT
Mask 110 Penalties: 141 354 834 EXIT
Mask 111 Penalties: 130 307 787 EXIT
Mask Pattern: 000
Blocks Merged: 112 -> 77

CODEWORDS

73317
15111221151
1131121411311
1131142111311
113111221111311
15131111151
711111117
091128
11111113241211
012112113414
4125211221
3112113441
422112121221
08142213
7321611
15122532
1131111165
113112321231
1131113131311
15121122123
711332121

0 comments on commit 1e84b62

Please sign in to comment.