createFromFile() public static method

Create Image from image file.
public static createFromFile ( string $imageFile ) : Image
$imageFile string Path to image.
return Image
Ejemplo 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;
 }
Ejemplo 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);
     }
 }