src/Modules/Imager/GDDriver.php
public function open($image_path)
    {
        $image_size = getimagesize($image_path);

        if (false === $image_size) {
            throw new \RuntimeException("File isn`t a valid image");
        }

        switch ($image_size['mime']) {
            case 'image/jpeg':
                $image_handler = imagecreatefromjpeg($image_path);
                break;
            case 'image/png':
                $image_handler = imagecreatefrompng($image_path);
                break;
            case 'image/gif':
                $image_handler = imagecreatefromgif($image_path);
                break;
            default:
                throw new \LogicException("Image mime type '" . $image_size['mime'] . "' don`t support");
        }

        imagealphablending($image_handler, false);
        $this->setImage($image_handler, $image_size[0], $image_size[1]);
        $this->mime_type = $image_size['mime'];

        return $this;
    }
public function open($image_path)
    {
        $image_size = getimagesize($image_path);

        if (false === $image_size) {
            throw new \RuntimeException("File isn`t a valid image");
        }

        switch ($image_size['mime']) {
            case 'image/jpeg':
                $image_handler = imagecreatefromjpeg($image_path);
                break;
            case 'image/png':
                $image_handler = imagecreatefrompng($image_path);
                break;
            case 'image/gif':
                $image_handler = imagecreatefromgif($image_path);
                break;
            default:
                throw new \LogicException("Image mime type '" . $image_size['mime'] . "' don`t support");
        }

        imagealphablending($image_handler, false);
        $this->setImage($image_handler, $image_size[0], $image_size[1]);
        $this->mime_type = $image_size['mime'];

        return $this;
    }
@param string $image_path

@return $this
@throws \RuntimeException
@throws \LogicException