createFromFile() public static method

public static createFromFile ( $imageFile ) : Image
$imageFile
return Image
Esempio n. 1
0
 /**
  * Open an image file and assign Image to first parameter.
  *
  * @param Image $image
  * @param string $imageFile
  *
  * @return Editor
  */
 public function open(&$image, $imageFile)
 {
     $image = Image::createFromFile($imageFile);
     return $this;
 }
Esempio n. 2
0
 /**
  * Create an image.
  * @param string $imageFile Path to image file.
  *
  * @return ImageInterface
  * @throws \Exception
  */
 public static function createImage($imageFile)
 {
     $editorName = self::detectAvailableEditor();
     if ('Imagick' === $editorName) {
         return ImagickImage::createFromFile($imageFile);
     } else {
         return GdImage::createFromFile($imageFile);
     }
 }