Opens an image file for processing.

@param string $image Image file.
@return Object Imagine Image class object, depending on the chosen engine.
491472
public function open($image) {
		if (!file_exists($image)) {
			throw new \RuntimeException(sprintf('File `%s` does not exist!', $image));
		}
		$this->_image = $this->imagine()->open($image);
		return $this;
	}
1283151
public function execute($image)
    {
        $x1 = $this->argument(0)->type('numeric')->required()->value();
        $y1 = $this->argument(1)->type('numeric')->required()->value();
        $x2 = $this->argument(2)->type('numeric')->required()->value();
        $y2 = $this->argument(3)->type('numeric')->required()->value();
        $callback = $this->argument(4)->type('closure')->value();

        $namespace = $image->getDriver()->getNamespace();
        $rectangle_classname = "\{$namespace}\Shapes\RectangleShape";

        $rectangle = new $rectangle_classname($x1, $y1, $x2, $y2);

        if ($callback instanceof Closure) {
            $callback($rectangle);
        }

        $rectangle->applyToImage($image, $x1, $y1);

        return true;
    }
159208
public function run(Image $image)
    {
        $blur = $this->getBlur();

        if ($blur !== null) {
            $image->blur($blur);
        }

        return $image;
    }
120604
public function updateFile(ImagineImageInterface $image)
    {
        if ($this->angle !== null && is_int($this->angle)) {
            $transformation = new Transformation();
            $transformation->rotate($this->angle, null);
            $transformation
                ->apply($image)
                ;
        }

        return $image;
    }
679381
public function execute($image)
    {
        $source = $this->argument(0)->required()->value();
        $position = $this->argument(1)->type('string')->value();
        $x = $this->argument(2)->type('digit')->value(0);
        $y = $this->argument(3)->type('digit')->value(0);

        // build watermark
        $watermark = $image->getDriver()->init($source);

        // define insertion point
        $image_size = $image->getSize()->align($position, $x, $y);
        $watermark_size = $watermark->getSize()->align($position);
        $target = $image_size->relativePosition($watermark_size);

        // insert image at position
        return $image->getCore()->compositeImage($watermark->getCore(), \Imagick::COMPOSITE_DEFAULT, $target->x, $target->y);
    }
617449
public function apply($image)
    {
        for ($i=0; $i < $this->amount; $i++) {
            imagefilter($image->getCore(), IMG_FILTER_GAUSSIAN_BLUR);
        }
        return $image;
    }
709556
function ($image) {
      var href;

      if ($image[0].nodeName === "A") {
        href = $image.attr('href');
      } else {
        href = $image.parent().attr('href');
      }

      this.preload($image);

      if (href) return href;
      return $image.attr('src');
    }
1189113
public function addImage(string $image)
    {
        $url = self::ADD_IMAGE.$this->access_token;
        $this->curl->setOpt(CURLOPT_SAFE_UPLOAD, true);

        return Response::json($this->curl->post($url, [
            'media' => new \CURLFile($image),
        ]));
    }
365804
public function loadImage($image)
    {
        $imageLibrary = ucfirst($this->imageLibrary);
        $functionName = 'loadWith' . $imageLibrary;
        $this->image = $image;

        if (!method_exists($this, $functionName)) {
            throw new IcrRuntimeException('Wrong image library name provided!');
        }

        return call_user_func([$this, $functionName]);
    }
1203414
public function loadToString($image)
    {
        $srcStorage = $this->getImageStorage($image);
        if ($srcStorage !== DriverInterface::IMAGE_STORAGE_STRING) {
            $image = @file_get_contents($image);
            if (false === $image) {
                throw new Exception\RuntimeException('could not load image');
            }
        }
        return $image;
    }
1294252
public function prepare($image)
    {
        if (request()->has(static::FILE_DELETE_FLAG)) {
            return $this->destroy();
        }

        $this->name = $this->getStoreName($image);

        $this->callInterventionMethods($image->getRealPath());

        return $this->uploadAndDeleteOriginal($image);
    }
880852
public function apply( $image ) {
        $image->getCore()->blurImage(1 * $this->amount, 0.5 * $this->amount);
        return $image;
    }
444666
private function openFile($file)
    {
        if (!(is_readable($file) && is_file($file))) {
            $this->throwException('FILE_EXISTS', $file);
        }
        $handle = fopen($file, 'rb');
        if (!$handle) {
            $this->throwException('FILE_OPEN', $file);
        }
        return $handle;
    }
991786
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;
	}
713004
public function image($image)
    {
        $filePaths = loader()->getPublicDirs(true);
        $image = str_replace(['\\', '/'], DIRECTORY_SEPARATOR, $image);

        foreach ($filePaths as $filePath) {
            $filePath .= 'img' . DIRECTORY_SEPARATOR;

            if (is_file($filePath . $image)) {
                return path_to_url($filePath . $image);
                break;
            }

            unset($filePath);
        }
    }
608191
private function getImageType($image) {
        if (function_exists('exif_imagetype')) {
            return exif_imagetype($image);
        } else {
            try {
                $info = getimagesize($image);
                return $info ? $info[ 2 ] : false;
            } catch (\Exception $e) {
                return false;
            }
        }
    }
316980
public function apply( $image ) {
        if ( $this->type === 'ordered' ) {
            return $this->ordered( $image );
        } else if ( $this->type === 'diffusion' ) {
            return $this->diffusion( $image );
        }
        throw new \Exception( sprintf( 'Invalid dither type "%s".', $this->type ) );
    }