Exemplo n.º 1
0
 /**
  * Creates an object to represent an image on the filesystem
  * 
  * @throws fValidationException  When no image was specified, when the image does not exist or when the path specified is not an image
  * 
  * @param  string  $file_path    The path to the image
  * @param  boolean $skip_checks  If file checks should be skipped, which improves performance, but may cause undefined behavior - only skip these if they are duplicated elsewhere
  * @return fImage
  */
 public function __construct($file_path, $skip_checks = FALSE)
 {
     self::determineProcessor();
     parent::__construct($file_path, $skip_checks);
     if (!self::isImageCompatible($file_path)) {
         $valid_image_types = array('GIF', 'JPG', 'PNG');
         if (self::$processor == 'imagemagick') {
             $valid_image_types[] = 'TIF';
         }
         throw new fValidationException('The image specified, %1$s, is not a valid %2$s file', $file_path, fGrammar::joinArray($valid_image_types, 'or'));
     }
 }