Gets an image from Clipboard.

@return image
760992
public static Image getClipboardImage() {
        Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
        try {
            return (Image) clipboard.getData(DataFlavor.imageFlavor);
        } catch (Exception e) {
            return null;
        }
    }
422851
public function getMainImage()
    {
        $imgUrl = false;

        if ($this->getImage() !== null) {
            $imgUrl = $this->getImage();
        }

        if (!$imgUrl) {
            foreach ($this->dom->getElementsByTagName('link') as $link) {
                /** @var \DOMElement $link */
                /*
                 * Check for the rel attribute, then check if the rel attribute is either img_src or image_src, and
                 * finally check for the existence of the href attribute, which should hold the image url.
                 */
                if ($link->hasAttribute('rel') && ($link->getAttribute('rel') === 'img_src' || $link->getAttribute('rel') === 'image_src') && $link->hasAttribute('href')) {
                    $imgUrl = $link->getAttribute('href');
                    break;
                }
            }
        }

        if (!empty($imgUrl) && $this->configuration->getFixRelativeURLs()) {
            $this->setImage($this->toAbsoluteURI($imgUrl));
        }
    }
241640
public function getImageUrl()
    {
        if(array_key_exists(self::ITEM_IMAGE_URL, $this->_itemData)) {
            return (string) $this->_itemData[self::ITEM_IMAGE_URL];
        }
        return null;
    }
1120885
public function getCroppableImageObject()
    {
        $requestID = Controller::curr()->request->requestVar('CroppableImageID');

        if ($requestID == '0' && !$this->Value()) {
            return;
        }

        if (!$this->linkObject) {
            $id = $this->Value() ? $this->Value() : $requestID;
            if ((int) $id) {
                $this->linkObject = SaltedCroppableImage::get()->byID($id);
            }
        }
        return $this->linkObject;
    }
527732
public function getFirstImage()
    {
        $images = $this->getImage();
        if ($images) {
            foreach ($images as $image) {
                return $image;
            }
        }

        return null;
    }
981835
public function image() {
		if (Request::hasFile('image') && Request::has('table_name') && Request::has('field_name')) {
			return json_encode(self::saveImage(
				Request::input('table_name'), 
				Request::input('field_name'), 
				Request::file('image'),
				null,
				Request::file('image')->getClientOriginalExtension()
			));
		} elseif (!Request::hasFile('image')) {
			return 'no image';
		} elseif (!Request::hasFile('table_name')) {
			return 'no table_name';
		} elseif (!Request::hasFile('field_name')) {
			return 'no field_name';
		}
	}
248328
public function render(): Image {
        $ftbbox = imageftbbox($this->fontSize, 0, $this->fontFile, $this->text, $this->extraInfo);

        $width = max($ftbbox[2] - $ftbbox[6], 1);
        $height = max($ftbbox[3] - $ftbbox[7], 1);

        // Getting an offset for the first symbol of text
        $ftbbox = imageftbbox($this->fontSize, 0, $this->fontFile, $this->text[0] ?? '', $this->extraInfo);
        $offset = $ftbbox[3] - $ftbbox[7];

        $image = Utility::transparentImage($width, $height);
        imagefttext(
            $image->getResource(),
            $this->fontSize,
            0,
            0,
            $offset,
            $this->color->allocate($image->getResource()),
            $this->fontFile,
            $this->text,
            $this->extraInfo
        );

        return $image;
    }
980348
public function getImagineImage()
    {
        if (null === $this->imagineImage) {
            $app = Application::getFacadeApplication();
            $resource = $this->getFileResource();
            $mimetype = $resource->getMimeType();
            $imageLibrary = $app->make(ImagineInterface::class);

            switch ($mimetype) {
                case 'image/svg+xml':
                case 'image/svg-xml':
                case 'text/plain':
                    if ($imageLibrary instanceof \Imagine\Gd\Imagine) {
                        try {
                            $imageLibrary = $app->make('image/imagick');
                        } catch (Exception $x) {
                            $this->imagineImage = false;
                        } catch (Throwable $x) {
                            $this->imagineImage = false;
                        }
                    }
                    break;
            }

            if (null === $this->imagineImage) {
                $metadataReader = $imageLibrary->getMetadataReader();
                if (!$metadataReader instanceof ExifMetadataReader) {
                    if ($app->make('config')->get('concrete.file_manager.images.use_exif_data_to_rotate_images')) {
                        try {
                            $imageLibrary->setMetadataReader(new ExifMetadataReader());
                        } catch (NotSupportedException $e) {
                        }
                    }
                }
                try {
                    $this->imagineImage = $imageLibrary->load($resource->read());
                } catch (FileNotFoundException $e) {
                    $this->imagineImage = false;
                }
            }
        }

        return $this->imagineImage ?: null;
    }
1346537
public BufferedImage getBufferedImage()
    {
        if (image == null || abort)
            return null;
        
        // no container that would repaint -- wait for the complete image
        if (container == null)
            waitForLoad();
        
        BufferedImage img = new BufferedImage(getIntrinsicWidth(), getIntrinsicHeight(), BufferedImage.TYPE_INT_ARGB);
        Graphics2D g = img.createGraphics();
        g.drawImage(image, null, null);
        g.dispose();

        return img;
    }
1049832
public function getTag() {
		if($this->exists()) {
			$url = $this->getURL();
			$title = ($this->Title) ? $this->Title : $this->Filename;
			if($this->Title) {
				$title = Convert::raw2att($this->Title);
			} else {
				if(preg_match("/([^\/]*)\.[a-zA-Z0-9]{1,6}$/", $title, $matches)) {
					$title = Convert::raw2att($matches[1]);
				}
			}
			return "<img src=\"$url\" alt=\"$title\" ".$this->getAttributesHTML()." />";
		}
	}
822288
public function &GetImageObject()
    {
        if (is_null($this->oImage)) {
            $this->oImage = $this->GetImage(0, 'cms_media_id', true);
        }

        return $this->oImage;
    }
1000344
public BufferedImage getNewImageInstance() {
        BufferedImage buf = new BufferedImage(image.getWidth(), image.getHeight(), image.getType());
        buf.setData(image.getData());
        return buf;
    }
149885
public function getData()
    {
        $imagick = new \Imagick();
        $imagick->newImage($this->width, $this->height, $this->backgroundColor->__toString());
        $imagick->setImageFormat('png');

        if (method_exists($imagick, 'setImageProperty')) {
            $imagick->setImageProperty('Software', 'Jdenticon');
        } else {
            $imagick->setImageAttribute('Software', 'Jdenticon');
        }
        
        $imagick->drawImage($this->draw);
        return $imagick->getImageBlob();
    }
346004
public function get()
    {
        if ($this->argument instanceof Argument && ! $this->argument->has('color')) {
            return $this->text;
        }

        $text = '';
        if ($this->foregroundColor !== '') {

            //~ Highlight
            $highlight = $this->hasHighlightedForeground ? static::HIGH_FOREGROUND : static::REGULAR_FOREGROUND;

            //~ Decoration
            $decoration = $this->isBold ? static::DECORATION_BOLD : '';
            $decoration .= $this->isUnderline ? static::DECORATION_UNDERLINE : '';
            $decoration = ! empty($decoration) ? $decoration : static::DECORATION_NONE;

            //~ Apply style
            $text .= self::BEGIN . $decoration . $highlight . $this->foregroundColor . self::END;
        }

        if ($this->backgroundColor !== '') {
            $highlight = $this->hasHighlightedBackground ? static::HIGH_BACKGROUND : static::REGULAR_BACKGROUND;
            $text .= self::BEGIN . $highlight . $this->backgroundColor . self::END;
        }

        $text .= $this->text . self::DESACTIVATE;

        return $text;
    }
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!');
	}
1133729
public function getImageAttribute()
    {
        // It should have image
        if ($this->exists) {
            return $this->image();
        }

        return isset($this->attributes['image']) ? $this->attributes['image'] : null;
    }
375790
public function getImageType()
    {
        $this->imageType = ($this->imageType === 'jpg') ? 'jpeg' : $this->imageType;
        $this->imageType = ( in_array($this->imageType, $this->imageTypes) ) ? $this->imageType : 'png';

        return $this->imageType;
    }