Exemple #1
0
 /**
  * Can this box handle pdf, png, jpeg (also acdepts jpg), gif, bmp, ico...
  * Mainly used to check for PDF support.
  * NOTE: this call is a performance hit, especially with netpbm and ghostscript available.
  * So we cache the result for 5 minutes. Keep that in mind if you make configuration changes, install
  * ghostscript, etc. and don't see an immediate difference.
  * @param mixed $extension
  * @return mixed
  */
 public static function supportsInput($extension)
 {
     $hint = aImageConverter::getHint("input:{$extension}");
     if (!is_null($hint)) {
         return $hint;
     }
     $result = false;
     if (sfConfig::get('app_aimageconverter_netpbm', true)) {
         if (aImageConverter::supportsInputNetpbm($extension)) {
             $result = true;
         }
     }
     if (!$result) {
         $result = aImageConverter::supportsInputGd($extension);
     }
     aImageConverter::setHint("input:{$extension}", $result);
     return $result;
 }