Gregwar / Captcha

PHP Captcha library
MIT License
1.73k stars 290 forks source link

[Feature Request] Optional magick class support? #132

Open whotopia opened 1 month ago

whotopia commented 1 month ago

Feature request. I'm trying to get some software that uses Gregwar/Captcha working in an embedded Linux environment (OpenWRT) where the native php8-mod-gd library is not built with jpeg support. Can the code be enhanced so that, optionally, if there are no working gd functions, the library tries to do equivalent operations using Imagick class?

root@coolhost:/www/sms/lib/composer/vendor/gregwar/captcha/src/Gregwar/Captcha# php8-cli -r "var_dump(gd_info());"
array(15) {
  ["GD Version"]=>
  string(5) "2.3.3"
  ["FreeType Support"]=>
  bool(true)
  ["FreeType Linkage"]=>
  string(13) "with freetype"
  ["GIF Read Support"]=>
  bool(true)
  ["GIF Create Support"]=>
  bool(true)
  ["JPEG Support"]=>
  bool(false)
  ["PNG Support"]=>
  bool(false)
  ["WBMP Support"]=>
  bool(true)
  ["XPM Support"]=>
  bool(false)
  ["XBM Support"]=>
  bool(true)
  ["WebP Support"]=>
  bool(false)
  ["BMP Support"]=>
  bool(false)
  ["AVIF Support"]=>
  bool(false)
  ["TGA Read Support"]=>
  bool(false)
  ["JIS-mapped Japanese Font Support"]=>
  bool(false)
}