code: public function setResource($gdResource)
  	{
  		if (!\is_resource($gdResource) || get_resource_type($gdResource) !== 'gd')
  		{
  			throw new \InvalidArgumentException('$gdResource is not a valid GD resource');
  		}
  
  		$this->gdResource = $gdResource;
  
  		return $this;
  	}
docs: Set the GD resource handle
  
  @param resource $gdResource The GD resource handle
  
  @return static
  
  @throws \InvalidArgumentException If $gdResource is not a GD resource