PHPImageOptim\Tools\Common::setImagePath PHP Method

setImagePath() public method

Sets the path of the image
public setImagePath ( $imagePath )
$imagePath
    public function setImagePath($imagePath)
    {
        if (!file_exists($imagePath)) {
            throw new Exception('Invald image path');
        }
        if (!is_readable($imagePath)) {
            throw new Exception('The file cannot be read');
        }
        $this->imagePath = $imagePath;
        return $this;
    }