Skip to content

Commit

Permalink
DMDetector: fix nasty x <-> y parameter order bug in DetectPure
Browse files Browse the repository at this point in the history
This fixes the at least 4 year old bug that popped up in zxing-cpp#773.

The top/left parameters in `Deflate()` should be changed but that could
potentially break client code, so I decided against it.
  • Loading branch information
axxel committed Apr 29, 2024
1 parent 3f8de98 commit 441132c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/datamatrix/DMDetector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ static DetectorResult DetectPure(const BitMatrix& image)
int bottom = top + height - 1;

// Now just read off the bits (this is a crop + subsample)
return {Deflate(image, dimT, dimR, top + modSizeX / 2, left + modSizeY / 2, modSize),
return {Deflate(image, dimT, dimR, top + modSizeY / 2, left + modSizeX / 2, modSize),
{{left, top}, {right, top}, {right, bottom}, {left, bottom}}};
}

Expand Down

0 comments on commit 441132c

Please sign in to comment.