From 02a05a4e60c4333712b476b26a4f28876bbfaf4f Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 21 Apr 2021 07:07:50 +0200 Subject: update to 1.0.5 drop PHP 8 patch merged upstream --- .gitignore | 2 + 103.patch | 61 ---------------------------- composer.json | 2 +- php-khanamiryan-qrcode-detector-decoder.spec | 11 ++--- 4 files changed, 9 insertions(+), 67 deletions(-) delete mode 100644 103.patch diff --git a/.gitignore b/.gitignore index 1ab5c4f..01f0400 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ +clog package-*.xml *.tgz +*.tar.bz2 *.tar.gz *.tar.xz *.tar.xz.asc diff --git a/103.patch b/103.patch deleted file mode 100644 index b7900d6..0000000 --- a/103.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 534564dda8041e19884eb50b4694a7d5c2638abd Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Mon, 30 Nov 2020 09:01:24 +0100 -Subject: [PATCH] fix for PHP 8 - ---- - composer.json | 2 +- - lib/GDLuminanceSource.php | 6 +++--- - lib/QrReader.php | 2 +- - 3 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/composer.json b/composer.json -index 9187ebd..ba76df8 100644 ---- a/composer.json -+++ b/composer.json -@@ -21,7 +21,7 @@ - "php": ">=5.6" - }, - "require-dev": { -- "phpunit/phpunit": "^9.0" -+ "phpunit/phpunit": "^5.7 | ^7.5 | ^8.0 | ^9.0" - }, - "autoload": { - "psr-4": { -diff --git a/lib/GDLuminanceSource.php b/lib/GDLuminanceSource.php -index 526df82..f1f808c 100644 ---- a/lib/GDLuminanceSource.php -+++ b/lib/GDLuminanceSource.php -@@ -52,7 +52,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 -@@ -65,8 +65,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']; -diff --git a/lib/QrReader.php b/lib/QrReader.php -index 200f910..b7dd1ea 100644 ---- a/lib/QrReader.php -+++ b/lib/QrReader.php -@@ -62,7 +62,7 @@ public function __construct($imgSource, $sourceType = QrReader::SOURCE_TYPE_FILE - $height = $im->getImageHeight(); - $source = new IMagickLuminanceSource($im, $width, $height); - } else { -- if (!is_resource($im)) { -+ if (!is_resource($im) && !is_object($im)) { - throw new \InvalidArgumentException('Invalid image source.'); - } - $width = imagesx($im); diff --git a/composer.json b/composer.json index 9187ebd..ba76df8 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "php": ">=5.6" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^5.7 | ^7.5 | ^8.0 | ^9.0" }, "autoload": { "psr-4": { diff --git a/php-khanamiryan-qrcode-detector-decoder.spec b/php-khanamiryan-qrcode-detector-decoder.spec index 9f4aa02..163e080 100644 --- a/php-khanamiryan-qrcode-detector-decoder.spec +++ b/php-khanamiryan-qrcode-detector-decoder.spec @@ -6,7 +6,7 @@ # # Please, preserve the changelog entries # -%global gh_commit 07fceefb79d895e858e52921afb9c1433d2f3d5e +%global gh_commit 6c8c23003a87ecd7458807cd49372b1fb590d1f5 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner khanamiryan %global gh_project php-qrcode-detector-decoder @@ -20,7 +20,7 @@ %global with_tests 0%{!?_without_tests:1} Name: php-%{pk_vendor}-%{pk_project} -Version: 1.0.4 +Version: 1.0.5 Release: 1%{?dist} Summary: QR code decoder / reader @@ -32,8 +32,6 @@ Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit # From https://github.com/khanamiryan/php-qrcode-detector-decoder/pull/80 Patch0: https://patch-diff.githubusercontent.com/raw/khanamiryan/php-qrcode-detector-decoder/pull/80.patch -# From https://github.com/khanamiryan/php-qrcode-detector-decoder/pull/103 -Patch1: https://patch-diff.githubusercontent.com/raw/khanamiryan/php-qrcode-detector-decoder/pull/103.patch BuildArch: noarch %if %{with_tests} @@ -89,7 +87,6 @@ Autoloader: %{php_home}/%{ns_project}/autoload.php %prep %setup -q -n %{gh_project}-%{gh_commit} %patch0 -p1 -%patch1 -p1 %build @@ -142,6 +139,10 @@ exit $ret %changelog +* Wed Apr 21 2021 Remi Collet - 1.0.5-1 +- update to 1.0.5 +- drop PHP 8 patch merged upstream + * Mon Nov 30 2020 Remi Collet - 1.0.4-1 - update to 1.0.4 - add patch for PHP 8 from -- cgit