Issue 524

git-svn-id: https://zxing.googlecode.com/svn/trunk@1570 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
smparkes@smparkes.net 2010-08-31 03:18:56 +00:00
parent c34f284041
commit d98d2af1ab
2 changed files with 6 additions and 0 deletions

View file

@ -374,6 +374,9 @@ public class Detector {
int alignmentAreaTopY = Math.max(0, estAlignmentY - allowance);
int alignmentAreaBottomY = Math.min(image.getHeight() - 1, estAlignmentY + allowance);
if (alignmentAreaBottomY - alignmentAreaTopY < overallEstModuleSize * 3) {
throw NotFoundException.getNotFoundInstance();
}
AlignmentPatternFinder alignmentFinder =
new AlignmentPatternFinder(

View file

@ -273,6 +273,9 @@ Ref<AlignmentPattern> Detector::findAlignmentInRegion(float overallEstModuleSize
}
int alignmentAreaTopY = max(0, estAlignmentY - allowance);
int alignmentAreaBottomY = min((int)(image_->getHeight() - 1), estAlignmentY + allowance);
if (alignmentAreaBottomY - alignmentAreaTopY < overallEstModuleSize * 3) {
throw zxing::ReaderException("region too small to hold alignment pattern");
}
AlignmentPatternFinder alignmentFinder(image_, alignmentAreaLeftX, alignmentAreaTopY, alignmentAreaRightX
- alignmentAreaLeftX, alignmentAreaBottomY - alignmentAreaTopY, overallEstModuleSize, callback_);