Swift_Image::fromPath PHP Method

fromPath() public static method

Create a new Image from a filesystem path.
public static fromPath ( string $path ) : Swift_Image
$path string
return Swift_Image
    public static function fromPath($path)
    {
        $image = self::newInstance()->setFile(new Swift_ByteStream_FileByteStream($path));
        return $image;
    }

Usage Example

 protected function embed($path)
 {
     if (!$path instanceof Swift_Image) {
         $path = Swift_Image::fromPath($path);
     }
     return $this->message->embed($path);
 }
All Usage Examples Of Swift_Image::fromPath