File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 4646include_once ('common/HybridBinarizer.php ' );
4747
4848
49- final class QrReader
49+ final class rR
5050{
5151 const SOURCE_TYPE_FILE = 'file ' ;
5252 const SOURCE_TYPE_BLOB = 'blob ' ;
@@ -63,6 +63,7 @@ function __construct($imgsource, $sourcetype = 'file')
6363 $ im ->readImage ($ imgsource );
6464 }else {
6565 $ image = file_get_contents ($ imgsource );
66+ $ im = imagecreatefromstring ($ image );
6667 }
6768
6869 break ;
@@ -72,7 +73,7 @@ function __construct($imgsource, $sourcetype = 'file')
7273 $ im = new Imagick ();
7374 $ im ->readimageblob ($ imgsource );
7475 }else {
75- $ image = $ imgsource ;
76+ $ im = imagecreatefromstring ( $ imgsource) ;
7677 }
7778
7879 break ;
@@ -83,11 +84,8 @@ function __construct($imgsource, $sourcetype = 'file')
8384 $ height = $ im ->getImageHeight ();
8485 $ source = new \Zxing \IMagickLuminanceSource ($ im , $ width , $ height );
8586 }else {
86- $ sizes = getimagesize ($ imgsource );
87- $ width = $ sizes [0 ];
88- $ height = $ sizes [1 ];
89- $ im = imagecreatefromstring ($ image );
90-
87+ $ width = imagesx ($ im );
88+ $ height = imagesy ($ im );
9189 $ source = new \Zxing \GDLuminanceSource ($ im , $ width , $ height );
9290 }
9391 $ histo = new \Zxing \Common \HybridBinarizer ($ source );
You can’t perform that action at this time.
0 commit comments