Beispiel #1
0
 /**
  * Checks the library to use and returns its class
  *
  * @param string $library The library name (Gd, Imagick)
  *
  * @throws ImageException if the image library does not exists.
  *
  * @return string
  */
 public static function getLibraryClass($library)
 {
     if (!$library) {
         $library = Libs\Imagick::checkCompatibility() ? self::LIB_IMAGICK : self::LIB_GD;
     }
     $class = 'Imagecow\\Libs\\' . $library;
     if (!class_exists($class)) {
         throw new ImageException('The image library is not valid');
     }
     if (!$class::checkCompatibility()) {
         throw new ImageException("The image library '{$library}' is not installed in this computer");
     }
     return $class;
 }