From 297eb070c379ab4e2434798b9183f9eff987eed6 Mon Sep 17 00:00:00 2001 From: Thiago Lopes Date: Thu, 13 Feb 2025 14:06:31 +0100 Subject: [PATCH 1/4] bugfix --- lib/GDLuminanceSource.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/GDLuminanceSource.php b/lib/GDLuminanceSource.php index 9b9b9af..af872be 100644 --- a/lib/GDLuminanceSource.php +++ b/lib/GDLuminanceSource.php @@ -51,7 +51,7 @@ public function GDLuminanceSource($gdImage, $width, $height) $this->dataHeight = $height; $this->left = 0; $this->top = 0; - $this->$gdImage = $gdImage; + $this->gdImage = $gdImage; // In order to measure pure decoding speed, we convert the entire image to a greyscale array @@ -64,8 +64,8 @@ public function GDLuminanceSource($gdImage, $width, $height) for($j=0;$j<$height;$j++){ for($i=0;$i<$width;$i++){ - $argb = imagecolorat($this->$gdImage, $i, $j); - $pixel = imagecolorsforindex($this->$gdImage, $argb); + $argb = imagecolorat($this->gdImage, $i, $j); + $pixel = imagecolorsforindex($this->gdImage, $argb); $r = $pixel['red']; $g = $pixel['green']; $b = $pixel['blue']; From 3f2768248ddaa18b3cc66e50da0488bbafa31da6 Mon Sep 17 00:00:00 2001 From: Thiago Lopes Date: Fri, 21 Feb 2025 13:35:16 +0100 Subject: [PATCH 2/4] readme file --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 3c15f83..2212742 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,19 @@ -#php qr decoder -> php识别二维码, 不需要安装扩展 从哪里弄来的我也忘了,毕竟好几年了 +### PHP QR Decoder +> this package is a fork of `zxing/qr-reader` to fix a bug when reading file using GD -### 安装 -`composer require zxing/qr-reader` +### How to install +`composer require thiagolp90/qr-reader` -### 使用 +### How to use ``` include __DIR__.'/vendor/autoload.php'; -$qrcode = new \Zxing\QrReader('./qr.png'); //图片路径 -$text = $qrcode->text(); //返回识别后的文本 +$qrcode = new \Zxing\QrReader('./qr.png'); //Image path +$text = $qrcode->text(); //Return text echo $text; ``` -### 需要 +### Requirements ``` PHP >= 5.3 GD Library From b7528738767d50edbe3b1b3a786fa4108c3d4913 Mon Sep 17 00:00:00 2001 From: Thiago Lopes Date: Fri, 21 Feb 2025 14:10:31 +0100 Subject: [PATCH 3/4] readme file --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2212742..6b724c0 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,10 @@ -### PHP QR Decoder -> this package is a fork of `zxing/qr-reader` to fix a bug when reading file using GD +## PHP QR Decoder ### How to install `composer require thiagolp90/qr-reader` +> this package is a fork of `zxing/qr-reader` to fix a bug when reading file using GD + ### How to use ``` include __DIR__.'/vendor/autoload.php'; From 261cdb1e1dd300c67dae677906028295bc44f67e Mon Sep 17 00:00:00 2001 From: Thiago Lopes Date: Fri, 21 Feb 2025 14:12:19 +0100 Subject: [PATCH 4/4] composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 3e60bb7..3ded10a 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "zxing/qr-reader", + "name": "thiagolp90/qr-reader", "description": "PHP qr code reader library", "keywords": [ "php",