Skip to content

Commit 0c1f322

Browse files
committed
🚿
1 parent 8df4a7a commit 0c1f322

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Decoder/Binarizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ private function calculateThresholdForBlock(
339339
for($j = 0, $o = $yoffset * $width + $xoffset; $j < self::BLOCK_SIZE; $j++, $o += $width){
340340
for($i = 0; $i < self::BLOCK_SIZE; $i++){
341341
// Comparison needs to be <= so that black == 0 pixels are black even if the threshold is 0.
342-
if(($luminances[$o + $i] & 0xff) <= $average){
342+
if(((int)($luminances[$o + $i]) & 0xff) <= $average){
343343
$matrix->set($xoffset + $i, $yoffset + $j);
344344
}
345345
}

0 commit comments

Comments
 (0)