Skip to content

Commit

Permalink
Dev
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriy-budiyev committed Feb 6, 2018
1 parent 38a9a62 commit b26e375
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/com/budiyev/android/codescanner/DecodeTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,12 @@ public Result decode(@NonNull MultiFormatReader reader) throws ReaderException {
}
}
Rect frameRect = Utils.getImageFrameRect(width, height, mViewFrameRect, mPreviewSize, mViewSize);
if (frameRect.getWidth() > 0 && frameRect.getHeight() > 0) {
int frameWidth = frameRect.getWidth();
int frameHeight = frameRect.getHeight();
if (frameWidth > 0 && frameHeight > 0) {
return reader.decodeWithState(new BinaryBitmap(new HybridBinarizer(
new PlanarYUVLuminanceSource(image, width, height, frameRect.getLeft(), frameRect.getTop(),
frameRect.getWidth(), frameRect.getHeight(), mReverseHorizontal))));
frameWidth, frameHeight, mReverseHorizontal))));
} else {
return null;
}
Expand Down

0 comments on commit b26e375

Please sign in to comment.