| @@ 82-92 (lines=11) @@ | ||
| 79 | } |
|
| 80 | ||
| 81 | // Disable image mode |
|
| 82 | if (!extension_loaded('gd')) { |
|
| 83 | $this->mode = 'text'; |
|
| 84 | } else { |
|
| 85 | $required_functions = [ |
|
| 86 | 'imagecreatetruecolor', |
|
| 87 | 'imagecolorallocate', |
|
| 88 | 'imagefilledrectangle', |
|
| 89 | 'imagejpeg', |
|
| 90 | 'imagedestroy', |
|
| 91 | 'imageftbbox' |
|
| 92 | ]; |
|
| 93 | foreach ($required_functions as $func) { |
|
| 94 | if (!function_exists($func)) { |
|
| 95 | $this->mode = 'text'; |
|
| @@ 40-50 (lines=11) @@ | ||
| 37 | $this->invalid = true; |
|
| 38 | } |
|
| 39 | ||
| 40 | if (!extension_loaded('gd')) { |
|
| 41 | $this->mode = 'bmp'; |
|
| 42 | } else { |
|
| 43 | $required_functions = [ |
|
| 44 | 'imagecreatetruecolor', |
|
| 45 | 'imagecolorallocate', |
|
| 46 | 'imagefilledrectangle', |
|
| 47 | 'imagejpeg', |
|
| 48 | 'imagedestroy', |
|
| 49 | 'imageftbbox' |
|
| 50 | ]; |
|
| 51 | foreach ($required_functions as $func) { |
|
| 52 | if (!function_exists($func)) { |
|
| 53 | $this->mode = 'bmp'; |
|