Encode the current image as an inline IMG tag.

@return string The image encoded as an inline IMG tag.
160036
public function encode()
    {
        if (empty($this->image) === true) {
            throw new \RuntimeException('No source image has been specified.');
        }
        $str = '<img src="data:' . $this->mimeType . ';base64,' . base64_encode($this->image) . '"';
        if (empty($this->extraHtml) === false) {
            $str .= ' ' . trim($this->extraHtml);
        }
        $str .= ' />';
        return $str;
    }
932336
public function getThumbnail(): Imagick
    {
        $image = new Imagick($this->file->getPathname().'[0]');
        $image->setImageFormat('png');

        return $image;
    }
970037
public function twitterCardImage()
    {
        $context = $this->contextObject();

        $img = null;
        if ($context instanceof HasTwitterCardInterface) {
            $img = (string)$context['twitter_card_image'];
        }

        if (!$img) {
            $img = (string)$this->fallbackTwitterCardImage();
        }

        if ($img) {
            $uri = $this->baseUrl();
            return $uri->withPath(strval($img));
        }

        return $this->metaImage();
    }
1085121
public function writeInHTMLOutput()
  {
    $image = $this->applyFilters();

    if ($this->extension == self::IMAGE_TYPE_JPG) {
      ob_start();
      imagejpeg($image, null, $this->jpgQuality);
      $contents = ob_get_contents();
      ob_end_clean();

      $base64 = "data:image/jpeg;base64," . base64_encode($contents);
      echo "<img src=$base64 />";
    } else if ($this->extension == self::IMAGE_TYPE_PNG) {
      ob_start();
      imagepng($image, null, $this->pngCompression);
      $contents = ob_get_contents();
      ob_end_clean();

      $base64 = "data:image/png;base64," . base64_encode($contents);
      echo "<img src=$base64 />";
    } else {
      throw new \Exception('Impossible de générer l\'image : extension non supportée');
    }
  }
788112
protected function processPng()
    {
        $format = 'png';
        $compression = \Imagick::COMPRESSION_ZIP;

        $imagick = $this->image->getCore();
        $imagick->setFormat($format);
        $imagick->setImageFormat($format);
        $imagick->setCompression($compression);
        $imagick->setImageCompression($compression);

        return $imagick->getImagesBlob();
    }
1209086
public function writeToMemory(): string
    {
        Utils::debugLog('writeToMemory', [
            'instance' => $this,
            'arguments' => []
        ]);

        $result = vips_image_write_to_memory($this->image);
        if ($result === -1) {
            self::errorVips();
        }

        Utils::debugLog('writeToMemory', ['result' => $result]);

        return $result;
    }
909101
public function getImageUrlAttribute()
    {
        if ($this->exists) {
            $image = $this->image();

            if ($image) {
                return $image->url;
            }

            return config('media.image.default');
        }

        return config('media.image.default');
    }
1331918
public function getThumbnailEncoded()
    {
        if ($data = base64_decode($this->getThumbnail(), $strict = true)) {
            // In case we don't have the file info extension enabled,
            // we'll set the jpeg mime type as default.
            $mime = 'image/jpeg';

            $image = base64_encode($data);

            if (function_exists('finfo_open')) {
                $finfo = finfo_open();

                $mime = finfo_buffer($finfo, $data, FILEINFO_MIME_TYPE);

                return "data:$mime;base64,$image";
            }

            return "data:$mime;base64,$image";
        }
    }
1192086
public function mozify()
	{
		if ($this->imageUrl == '')
		{
			return;
		}

		$html  = $this->_mozifyCss() . PHP_EOL;
		$html .= $this->_mozifyStartMsoHack() . PHP_EOL;
		$html .= $this->_mozifyImageReplacement() . PHP_EOL;
		$html .= $this->_mozifyMosaic() . PHP_EOL;
		$html .= $this->_mozifyEndWrapper() . PHP_EOL;
		$html .= $this->_mozifyEndMsoHack() . PHP_EOL;

		$this->counter++;

		return $html;
	}
1298682
private function compile()
    {
        $commands = array_keys($this->commands);
        $values = $this->getArrayValues(array_values($this->commands));

        $origSource = $this->source;

        $vs = '%s';
        $bin = $this->converter;
        $type = preg_replace('#^image/#', null, $this->getInfo('type'));

        $this->tmpFile = $this->getTempFile();

        if ($this->isMultipartImage()) {

            $this->intermediate = $this->getTempFile($type);
            $this->source = $this->intermediate;

        }

        array_unshift($values, sprintf('%s:%s', $type, escapeshellarg($this->source)));

        array_unshift($values, $bin);

        array_unshift($commands, $vs);
        array_unshift($commands, $vs);

        if ($this->isMultipartImage()) {

            array_unshift(
                $values,
                sprintf(
                    '%s %s:%s -coalesce %s %s',
                    $this->converter,
                    $type,
                    $origSource,
                    $this->intermediate,
                    PHP_EOL
                )
            );
            array_unshift($commands, $vs);
        }

        array_push($values, sprintf('%s:%s', $this->getOutputType(), $this->tmpFile));
        array_push($commands, $vs);

        $cmd = implode(' ', $commands);

        $this->source = $origSource;

        return vsprintf($cmd, $values);
    }
413863
public function toString()
        {
            if ($this->void) {
                return '<'.$this->tag.$this->createAttributes().' />';
            } else {
                return '<'.$this->tag.$this->createAttributes().'>'.$this->recursivelyStringify($this->content).'</'.$this->tag.'>';
            }
        }
42960
public function getImage()
    {
        $this->imageWidth = null;
        $this->imageHeight = null;

        $images = $this->images;
        $bigger = (bool) $this->getConfig('choose_bigger_image');
        $minWidth = $this->getConfig('min_image_width', 1);
        $minHeight = $this->getConfig('min_image_height', 1);

        $images = array_filter($images, function ($image) use ($minWidth, $minHeight) {
            return $image['width'] >= $minWidth && $image['height'] >= $minHeight;
        });

        if (empty($images)) {
            return null;
        }

        reset($images);
        $image = current($images);

        if ($bigger) {
            $sizes = [];

            foreach ($images as $img) {
                $sizes[$img['url']] = $img['size'];
            }

            $biggest = static::getBigger($sizes);

            foreach ($images as $img) {
                if ($biggest == $img['url']) {
                    $image = $img;
                    break;
                }
            }
        }

        $this->imageWidth = $image['width'];
        $this->imageHeight = $image['height'];

        return $image['url'];
    }
38476
private function getImage()
    {
        $image = $this->_parser->find('.container-left .user-profile', 0);
        $image = $image->find('.user-image img', 0);

        return $image ? Helper::imageUrlCleaner($image->src) : '';
    }
711218
protected function img() {
		foreach ($this->localStatic[ __FUNCTION__ ] as $imgDir) {
			//if(is_file($imgDir . DIRECTORY_SEPARATOR . 'Thumbs.db'))
			//	unlink($imgDir . DIRECTORY_SEPARATOR . 'Thumbs.db');
			/*
			  $this->start('Optimizing '. $imgDir)
			  ->runLocal([
			  self::IMGMIN,
			  '-o', 7,
			  $imgDir,// . DIRECTORY_SEPARATOR. '*',
			  $this->localStatic . 'img'
			  ])->finish();
			 */
			foreach (self::rglob($imgDir . DIRECTORY_SEPARATOR . '*.{jpg,jpeg,png,gif,svg,bmp}', GLOB_BRACE) as $image) {
				$output = $this->tmp[ __FUNCTION__ ] . substr($image, strlen($imgDir) + 1);
				self::readyDir($output);


				if ($this->compress)
					$this->start('Optimizing ' . $image)
							->runLocal(['imagemin',
								//'-o', 7,
								$image,
								'>',
								$output
							])->finish();
				else
					copy($image, $output); // symlink
			}
		}
		
		return $this;
	}
225042
public function getImage()
    {
        // No fields, no image.
        if (empty($this->contenttype['fields'])) {
            return '';
        }

        // Grab the first field of type 'image', and return that.
        foreach ($this->contenttype['fields'] as $key => $field) {
            if ($field['type'] === 'image' && isset($this->values[$key])) {
                // After v1.5.1 we store image data as an array
                if (is_array($this->values[$key])) {
                    return isset($this->values[$key]['file']) ? $this->values[$key]['file'] : '';
                }

                return $this->values[$key];
            }
        }

        // otherwise, no image.
        return '';
    }
316334
private function getImage()
    {
        $image = $this->_parser->find('#content table tr', 0)->find('td', 0)->find('img', 0);

        return $image ? $image->src : '';
    }
183185
function getImageId(){
		$ary = explode('/',$this->_image_id); // "75c/75c1/" -> ["75c","75c1",""]
		if(isset($ary[1])){
			return (int)hexdec($ary[1]);
		}
	}