AbstractDriver::getImageOnProcess

Gets library image on process resource.

@return resource
423362
protected function &getResampleImageResource()
    {
        if ( ! is_resource($this->resampleImageResource)) {
            $this->resampleImageResource = $this->sourceImageResource;
        }

        return $this->resampleImageResource;
    }
5483
public function getImageInfo($filename)
	{
		if ($filename instanceof Image) {
			$filename = $this->adapter->getFileStorage()->getImagePath($filename);
		}

		$info = new ImageInfo($filename);

		if ($info->hasError()) {
			throw new ImageProcessorException('File ' . $filename . ' not found or is not readable. ' . $info->getError());
		}

		return $info;
	}
830339
protected function initSourceImageResource() 
    { 
    	$ext = $this->getExtension();
    	
    	switch($ext) {
		case 'gif':
			$this->sourceImageResource = ImageCreateFromGif($this->sourceImagePath);
			break;
    	
		case 'jpg':
			$this->sourceImageResource = ImageCreateFromJpeg($this->sourceImagePath);
			break;
    	
		case 'png':
			$this->sourceImageResource = ImageCreateFromPng($this->sourceImagePath);
			break;
    	
		default:
			throw new \RuntimeException("An error occurred trying to create the image, extension '" . $ext. "' is not supported");
			break;
    	}
    	
    	return $this;
    }
822288
public function &GetImageObject()
    {
        if (is_null($this->oImage)) {
            $this->oImage = $this->GetImage(0, 'cms_media_id', true);
        }

        return $this->oImage;
    }
422874
public function getProcess(): Process
    {
        if ($this->process === null) {
            $this->process = new Process(
                $this->getSchemaName(),
                $this->getInitialState(),
                $this->buildStates()
            );
        }

        return $this->process;
    }
322985
public function getOGImage()
    {
        $config = $this->getSiteConfig();
        
        if (($image = $this->owner->MetaImage) && $image->exists()) {
            return $image->AbsoluteURL;
        }
        
        if ($config->AppIconLargeID && $config->AppIconLarge()->exists()) {
            return $config->AppIconLarge()->AbsoluteURL;
        }
    }
480636
protected function getImageInstance()
    {
        //Tries to create the image instance
        try {
            $imageInstance = $this->ImageManager->make($this->path);
        } catch (NotReadableException $e) {
            $message = __d('thumber', 'Unable to read image from file `{0}`', rtr($this->path));

            if ($e->getMessage() == 'Unsupported image type. GD driver is only able to decode JPG, PNG, GIF or WebP files.') {
                $message = __d('thumber', 'Image type `{0}` is not supported by this driver', mime_content_type($this->path));
            }

            throw new RuntimeException($message);
        }

        return $imageInstance;
    }
1098323
protected function processJpeg()
    {
        ob_start();
        imagejpeg($this->image->getCore(), null, $this->quality);
        $this->image->mime = image_type_to_mime_type(IMAGETYPE_JPEG);
        $buffer = ob_get_contents();
        ob_end_clean();

        return $buffer;
    }
67191
public function getProcess()
    {
        if (0 === count($this->prefix) && 0 === count($this->arguments)) {
            throw new LogicException('You must add() command arguments before calling getProcess().');
        }

        $arguments = array_merge($this->prefix, $this->arguments);
        $process = new Process($arguments, $this->cwd, $this->env, $this->input, $this->timeout, $this->options);

        if ($this->inheritEnv) {
            $process->inheritEnvironmentVariables();
        }
        if ($this->outputDisabled) {
            $process->disableOutput();
        }

        return $process;
    }
825686
public function defaultImage()
    {
        // Return an empty Image object if no default value
        if (empty($this->value)) {
            return new Image;
        }

        // All src images must live in the /img (relative) directory
        if (!Str::is('/img/*', $this->value)) {
            $msg = 'Element images must be stored in public/img: '.$this->value;
            throw new Exception($msg);
        }

        // Check if the image already exists in the uploads directory
        $src = $this->value;
        $src_abs = public_path($src);
        $path = str_replace('/img/', '/elements/', $src);
        if (!app('upchuck.disk')->has($path)) {

            // Copy it to the disk
            $stream = fopen($src_abs, 'r+');
            app('upchuck.disk')->writeStream($path, $stream);
            fclose($stream);
        }

        // Wrap the touching of the element and images table in a transaction
        // so that the element isn't updated if the images write fails
        DB::beginTransaction();

        // Update or create this Element instance
        $this->value = app('upchuck')->url($path);
        $this->save();

        // Create and return new Image instance. The Image::populateFileMeta()
        // requires an UploadedFile, so we need to do it manually here.
        $size = getimagesize($src_abs);
        $image = new Image([
            'file' => $this->value,
            'name' => $this->inputName(),
            'file_type' => pathinfo($src_abs, PATHINFO_EXTENSION),
            'file_size' => filesize($src_abs),
            'width'     => $size[0],
            'height'    => $size[1],
        ]);
        $this->images()->save($image);
        DB::commit();

        // Clear cached image relations
        unset($this->relations['images']);

        // Return the image
        return $image;
    }
631997
public function getDetailThumbnailImage()
    {
        if ($this->fvHasDetailThumbnail) {
            $app = Application::getFacadeApplication();
            $config = $app->make('config');
            $type = ThumbnailType::getByHandle($config->get('concrete.icons.file_manager_detail.handle'));
            $result = '<img src="' . $this->getThumbnailURL($type->getBaseVersion()) . '"';
            if ($config->get('concrete.file_manager.images.create_high_dpi_thumbnails')) {
                $result .= ' data-at2x="' . $this->getThumbnailURL($type->getDoubledVersion()) . '"';
            }
            $result .= ' />';
        } else {
            $result = $this->getTypeObject()->getThumbnail();
        }

        return $result;
    }
1181250
public function polar(): Image
    {
        return self::runCmplx(function ($image) {
            return $image->complex(OperationComplex::POLAR);
        }, $this);
    }
147724
public function img()
    {
        // Check for an existing Image relation
        if (($image = $this->parentImg($this->inputName()))
            && $image->exists) {

            // If the Image represents a default image, but doesn't match the current
            // item from the config, trash the current one and build the new default
            // image.
            if ($replacement = $this->getReplacementImage($image)) {
                return $replacement;
            }

            // Return the found image
            return $image;
        }

        // Else return a default image
        return $this->defaultImage();
    }
438367
protected function process()
    {
        extract($this->compileExpression());

        $this->clean();
        $this->resolver->close();

        $this->resolver->setParameter($params);
        $this->resolver->setSource($source);
        $this->resolver->setFilter($filter);

        if ($image = $this->resolver->getCached()) {
            $src = $this->base.$this->resolver->getCachedUrl($image);

            $extension = $image->getSourceFormat(true);
            $this->resolver->close();
            $image->close();

            return $src.'.'.$extension;
        }

        if ($image = $this->resolver->resolve($image)) {
            $src = $this->resolver->getImageUrl($image);
            $this->resolver->close();
            $image->close();

            return $src;
        }

        $this->resolver->close();

        return;
    }
865730
public function getIsImage()
    {
        // Check file type
        $mime = $this->getMimeType();
        return $mime && in_array($mime, $this->config()->supported_images);
    }
577111
public ProcessImage getProcessImage(int unitId) {
        ModbusSlave slave = ModbusSlaveFactory.getSlave(this);
        if (slave != null) {
            return slave.getProcessImage(unitId);
        }
        return null;
    }
796103
public static function getImageConvertExecutable()
    {
        if ( !is_null( self::$imageConvert ) )
        {
            return self::$imageConvert;
        }
        return ( self::$imageConvert = self::findExecutableInPath( 'convert' ) );
    }