public function setImage($image) {

		if(false === is_string($image)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($image)), E_USER_ERROR);
		}

		$file = new File($image);

		if(false === $file -> exists()) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be an existing image', __METHOD__), E_USER_ERROR);
		}

		if(false === in_array(exif_imagetype($image), [IMAGETYPE_JPEG, IMAGETYPE_PNG])) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be an valid image (jpg, jpeg or png)', __METHOD__), E_USER_ERROR);
		}

		$this -> image = $file;

		return $this;
	}
public function setImage($image) {

		if(false === is_string($image)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($image)), E_USER_ERROR);
		}

		$file = new File($image);

		if(false === $file -> exists()) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be an existing image', __METHOD__), E_USER_ERROR);
		}

		if(false === in_array(exif_imagetype($image), [IMAGETYPE_JPEG, IMAGETYPE_PNG])) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be an valid image (jpg, jpeg or png)', __METHOD__), E_USER_ERROR);
		}

		$this -> image = $file;

		return $this;
	}
public function setImage ( $ image ) { if ( false === is_string ( $ image ) ) { return trigger_error ( sprintf ( 'Argument 1 passed to %s() must be of the type string, "%s" given' , __METHOD__ , gettype ( $ image ) ) , E_USER_ERROR ) ; } $ file = new File ( $ image ) ; if ( false === $ file -> exists ( ) ) { return trigger_error ( sprintf ( 'Argument 1 passed to %s() must be an existing image' , __METHOD__ ) , E_USER_ERROR ) ; } if ( false === in_array ( exif_imagetype ( $ image ) , [ IMAGETYPE_JPEG , IMAGETYPE_PNG ] ) ) { return trigger_error ( sprintf ( 'Argument 1 passed to %s() must be an valid image (jpg, jpeg or png)' , __METHOD__ ) , E_USER_ERROR ) ; } $ this -> image = $ file ; return $ this ; }
Set image by giving a file path as image
@param string $image
@return sFire\Captcha\Captcha
Set image by giving a file path as image