public static function fromString(string $data): self
    {
        if (false === $image = imagecreatefromstring($data)) {
            throw new InvalidArgumentException('Could not read image');
        }

        return new static($image);
    }
public static function fromString(string $data): self
    {
        if (false === $image = imagecreatefromstring($data)) {
            throw new InvalidArgumentException('Could not read image');
        }

        return new static($image);
    }
public static function fromString ( string $ data ) : self { if ( false === $ image = imagecreatefromstring ( $ data ) ) { throw new InvalidArgumentException ( 'Could not read image' ) ; } return new static ( $ image ) ; }
Create a new decoder instance from the specified string.

@param string $data
@return GdDecoder
Create a new decoder instance from the specified string .