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 46
46
include_once ('common/HybridBinarizer.php ' );
47
47
48
48
49
- final class QrReader
49
+ final class rR
50
50
{
51
51
const SOURCE_TYPE_FILE = 'file ' ;
52
52
const SOURCE_TYPE_BLOB = 'blob ' ;
@@ -63,6 +63,7 @@ function __construct($imgsource, $sourcetype = 'file')
63
63
$ im ->readImage ($ imgsource );
64
64
}else {
65
65
$ image = file_get_contents ($ imgsource );
66
+ $ im = imagecreatefromstring ($ image );
66
67
}
67
68
68
69
break ;
@@ -72,7 +73,7 @@ function __construct($imgsource, $sourcetype = 'file')
72
73
$ im = new Imagick ();
73
74
$ im ->readimageblob ($ imgsource );
74
75
}else {
75
- $ image = $ imgsource ;
76
+ $ im = imagecreatefromstring ( $ imgsource) ;
76
77
}
77
78
78
79
break ;
@@ -83,11 +84,8 @@ function __construct($imgsource, $sourcetype = 'file')
83
84
$ height = $ im ->getImageHeight ();
84
85
$ source = new \Zxing \IMagickLuminanceSource ($ im , $ width , $ height );
85
86
}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 );
91
89
$ source = new \Zxing \GDLuminanceSource ($ im , $ width , $ height );
92
90
}
93
91
$ histo = new \Zxing \Common \HybridBinarizer ($ source );
You can’t perform that action at this time.
0 commit comments