Skip to content

Commit 68c5727

Browse files
committed
ITF: actually check what the comment already said (both quiet zone sizes)
This should fix the issue with a cropped left quiet zone reported by @synedra-mpe here: #869 (comment)
1 parent 1a5337a commit 68c5727

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

core/src/oned/ODITFReader.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ Barcode ITFReader::decodePattern(int rowNumber, PatternView& next, std::unique_p
7272
|| next[0] < threshold[0] || next[1] > threshold[1] || next[2] > threshold[2])
7373
return {};
7474

75-
// Check quiet zone size (full quiet zone or cropped on both ends)
76-
if (!(next[3] > minQuietZone * (threshold.bar + threshold.space) / 3
75+
// Check quiet zone size (full quiet zone on both ends or cropped on both ends)
76+
if (!(std::min((int)next[3], xStart) > minQuietZone * (threshold.bar + threshold.space) / 3
7777
|| (next.isAtLastBar() && startsAtFirstBar && std::max(xStart, (int)next[3]) < 2 * std::min(xStart, (int)next[3]) + 2)))
7878
return {};
7979

test/samples/itf-1/with-tail.png

84 Bytes
Loading

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy