取得图像信息
@access public

@param string $image 图像文件名

@return array | false
509457
public static function getImageInfo($image)
    {
        $imagesInfoArr = @getimagesize($image);
        if (!$imagesInfoArr) return false;
        list($imagesInfo['width'], $imagesInfo['height'], $imagesInfo['ext']) = $imagesInfoArr;
        $imagesInfo['ext'] = strtolower(ltrim(image_type_to_extension($imagesInfo['ext']), '.'));
        return $imagesInfo;
    }
741290
public function imageInspect($image)
    {
        return $this->browser->get(
            $this->uri->expand(
                '/images/{image}/json',
                array(
                    'image' => $image
                )
            )
        )->then(array($this->parser, 'expectJson'));
    }
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);
    }
1045245
public function decode($image = null) {
        try {
            
            if(is_array($image)) {
                $this->setArrayImages($image);

                if($this->_ARRAY_IMAGES == null) {
                    throw new \Exception("Nothing to decode");
                }

            } else {
                if(!file_exists($image)) {
                    throw new \Exception("File/Folder does not exist");
                }

                $this->setSingleImage($image);

                if($this->_SINGLE_IMAGE == null) {
                    throw new \Exception("Nothing to decode");
                }
            }

            $image = $this->prepare();

            if(empty($image)) {
                throw new \Exception("Is the java PATH set correctly ? Current Path set is : " . $this->getJavaPath());
            }

            // If the image is single then return the actual image
            if(count($image) == 1) {
                return current($image);
            }

            return $image;
        } catch(\Exception $e) {
            echo $e->getMessage();
        }
    }
293543
public function apply( $image ) {

        imagefilter($image->getCore(), IMG_FILTER_COLORIZE, $this->red, $this->green, $this->blue);
        return $image;
    }
1072649
public function execute($image)
    {
        switch ($image->exif('Orientation')) {

            case 2:
                $image->flip();
                break;

            case 3:
                $image->rotate(180);
                break;

            case 4:
                $image->rotate(180)->flip();
                break;

            case 5:
                $image->rotate(270)->flip();
                break;

            case 6:
                $image->rotate(270);
                break;

            case 7:
                $image->rotate(90)->flip();
                break;

            case 8:
                $image->rotate(90);
                break;
        }

        return true;
    }
54826
final protected function getImageInfo($file)
    {
        $image = getimagesize($file);

        if ($image !== false) {
            return array(
                'width' => $image[0],
                'height' => $image[1],
                'type' => $image[2],
                'mime' => $image['mime'],
                'bits' => isset($image['bits']) ? $image['bits'] : null
            );
        } else {
            return false;
        }
    }
353169
public function execute($image)
    {
        $backupName = $this->argument(0)->value();

        // clone current image resource
        $clone = clone $image;
        $image->setBackup($clone->getCore(), $backupName);

        return true;
    }
1135004
public function getImageWidth($image): ?string
    {
        if (null === ($file = $this->container->get('huh.utils.file')->getFileFromUuid($image))) {
            return null;
        }

        return $file->width;
    }
163232
private function _computeResolution($image)
    {
        $this->res = "MED";
        if(preg_match("/HiRes/i", $image))
            $this->res = "HIGH";
        elseif (preg_match("/LowRes/i", $image))
            $this->res = "LOW";
        elseif (preg_match("/Thumb/i", $image))
            $this->res = "THUMB";
        elseif (preg_match("/MediumRes/i", $image))
            $this->res = "MED";
    }
894046
public function getImageStorage($image)
    {
        if (@file_exists('file://' . $image)) {
            return DriverInterface::IMAGE_STORAGE_FILE;
        } elseif (false === strpos($image, '://')) {
            return DriverInterface::IMAGE_STORAGE_STRING;
        } else {
            return DriverInterface::IMAGE_STORAGE_URL;
        }
    }
488969
protected function _getImage($Image = null) {
		if (is_string($Image)) {
			$class = 'Imagine\\' . $this->config('engine') . '\Imagine';
			$Imagine = new $class();
			return $Imagine->open($Image);
		}
		if (!empty($this->_image)) {
			return $this->_image;
		}
		throw new \RuntimeException('Could not get the image object!');
	}
357880
public function getImageInfo($image)
    {
        if ( empty($image) || !file_exists($image))
        {
            throw new \InvalidArgumentException('Image file not found.');
        }

        $pathInfo = pathinfo($image);
        $info     = getimagesize($image);

        if ( !in_array($pathInfo['extension'], $this->types) )
        {
            throw new \InvalidArgumentException('Unsupported image file extension.');
        }

        $info['width']    = $info[0];
        $info['height']   = $info[1];
        $info['ext']      = $info['type'] = $pathInfo['extension'];
        $info['size']     = filesize($image);
        $info['dir']      = $pathInfo['dirname'];
        $info['path']     = str_replace('/', DIRECTORY_SEPARATOR, $image);
        $info['fullname'] = $pathInfo['basename'];
        $info['filename'] = $pathInfo['filename'];
        $info['type']     = ($info['type'] == 'jpg') ? 'jpeg' : $info['type'];

        return $info;
    }
1304364
private function getPathsForVolumeAsset($image)
    {
        try {
            $this->transformPath = ImagerHelpers::getTransformPathForAsset($image);
        } catch (InvalidConfigException $e) {
            Craft::error($e->getMessage(), __METHOD__);
            throw new ImagerException($e->getMessage(), $e->getCode(), $e);
        }

        $runtimeImagerPath = Craft::$app->getPath()->getRuntimePath().'/imager/';

        $this->url = $image->getUrl();
        $this->path = FileHelper::normalizePath($runtimeImagerPath.$this->transformPath.'/');
        $this->filename = $image->getFilename();
        $this->basename = $image->getFilename(false);
        $this->extension = $image->getExtension();

        try {
            FileHelper::createDirectory($this->path);
        } catch (Exception $e) {
            Craft::error($e->getMessage(), __METHOD__);
            throw new ImagerException($e->getMessage(), $e->getCode(), $e);
        }
    }
714652
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
        imagealphablending($image->getCore(), true);
        return imagecopy($image->getCore(), $watermark->getCore(), $target->x, $target->y, 0, 0, $watermark_size->width, $watermark_size->height);
    }
5863
public function getImageSize($Image = null) {
		$Image = $this->_getImage($Image);
		$BoxInterface = $Image->getSize($Image);
		return [
			$BoxInterface->getWidth(),
			$BoxInterface->getHeight(),
			'x' => $BoxInterface->getWidth(),
			'y' => $BoxInterface->getHeight()
		];
	}
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);
    }