Skip to content

Commit 50a45b1

Browse files
committed
Add public method QrReader::decode(), it is the same QrReader::text()
Fix bugs
1 parent ca1eed7 commit 50a45b1

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Created by .ignore support plugin (hsz.mobi)

lib/QrReader.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ function __construct($filename)
7070

7171
$source = new \Zxing\GDLuminanceSource($im, $width, $height);
7272
}
73-
$histo = new Zxing\Common\HybridBinarizer($source);
74-
$bitmap = new Zxing\BinaryBitmap($histo);
75-
$reader = new Zxing\Qrcode\QRCodeReader();
73+
$histo = new \Zxing\Common\HybridBinarizer($source);
74+
$bitmap = new \Zxing\BinaryBitmap($histo);
75+
$reader = new \Zxing\Qrcode\QRCodeReader();
7676

7777
$this->result = $reader->decode($bitmap);
7878
}catch (\Zxing\NotFoundException $er){
@@ -93,5 +93,9 @@ public function text()
9393
}
9494
}
9595

96+
public function decode()
97+
{
98+
return $this->text();
99+
}
96100
}
97101

lib/common/customFunctions.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ function numberOfTrailingZeros($i) {
3535
}
3636
function intval32bits($value)
3737
{
38-
3938
$value = ($value & 0xFFFFFFFF);
4039

4140
if ($value & 0x80000000)
@@ -66,7 +65,7 @@ function sdvig3($num,$count=1){//>>> 32 bit
6665
*/
6766

6867
function sdvig3($a,$b) {
69-
return $a>>$b;
68+
7069
if ($a >= 0) {
7170
return bindec(decbin($a>>$b)); //simply right shift for positive number
7271
}

0 commit comments

Comments
 (0)