File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -81,14 +81,21 @@ protected function checkGD():void{
81
81
throw new QRCodeOutputException ('ext-gd not loaded ' );
82
82
}
83
83
84
+ $ modes = [
85
+ self ::GDIMAGE_BMP => 'BMP Support ' ,
86
+ self ::GDIMAGE_GIF => 'GIF Create Support ' ,
87
+ self ::GDIMAGE_JPG => 'JPEG Support ' ,
88
+ self ::GDIMAGE_PNG => 'PNG Support ' ,
89
+ self ::GDIMAGE_WEBP => 'WebP Support ' ,
90
+ ];
91
+
92
+ // likely using default or custom output
93
+ if (!isset ($ modes [$ this ->options ->outputType ])){
94
+ return ;
95
+ }
96
+
84
97
$ info = gd_info ();
85
- $ mode = [
86
- self ::GDIMAGE_BMP => 'BMP Support ' ,
87
- self ::GDIMAGE_GIF => 'GIF Create Support ' ,
88
- self ::GDIMAGE_JPG => 'JPEG Support ' ,
89
- self ::GDIMAGE_PNG => 'PNG Support ' ,
90
- self ::GDIMAGE_WEBP => 'WebP Support ' ,
91
- ][$ this ->options ->outputType ];
98
+ $ mode = $ modes [$ this ->options ->outputType ];
92
99
93
100
if (!isset ($ info [$ mode ]) || $ info [$ mode ] !== true ){
94
101
throw new QRCodeOutputException (sprintf ('output mode "%s" not supported ' , $ this ->options ->outputType ));
You can’t perform that action at this time.
0 commit comments