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{
8181 throw new QRCodeOutputException ('ext-gd not loaded ' );
8282 }
8383
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+
8497 $ 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 ];
9299
93100 if (!isset ($ info [$ mode ]) || $ info [$ mode ] !== true ){
94101 throw new QRCodeOutputException (sprintf ('output mode "%s" not supported ' , $ this ->options ->outputType ));
You can’t perform that action at this time.
0 commit comments