Output the image to the browser
@return void
@exit
19717
public function output()
    {
        $imageFile = $this->storage->getPath($this);

        if(file_exists($imageFile))
        {
            header('Content-Type: image');
            header('Content-Length: ' . filesize($imageFile));

            readfile($imageFile);
            exit;
        }
    }
211475
public function output() {
		if ( is_array( $this->output ) ) {
			echo '<div class="qm" id="' . esc_attr($this->collector->id()) . '">';
			echo '<table cellspacing="0"><tbody>';
			foreach ( $this->output as &$single ) {
				echo "<tr><td>" . $single . "</td></tr>";
			}
			echo '</tbody></table>';
			echo '</div>';
		}
	}
210510
protected function binaryOutput()
    {
        $data = file_get_contents($this->src);
        $im = getimagesize($this->src);
        header('Content-Length: ' . strlen($data));
        header("Content-type: " . $im['mime']);
        echo $data;
        flush();
        die;
    }
325857
public function renderImages()
    {
        foreach ($this->getVariables() as $key => $variable) {
            if (is_file($variable)) {
                $type = pathinfo($variable, PATHINFO_EXTENSION);
                $data = file_get_contents($variable);
                $base64 = 'data:image/' . $type . ';base64,' . base64_encode($data);
                $this->setVariable($key, $base64);
            }
        }
    }
444638
public function render()
    {
        // Different conditions for different types of tags
        switch ($this->element) {

            // Img tags use the src
            case 'img':
                if (empty($this->getAttribute('src'))) {
                    return '';
                }
                break;

            // Divs have the image as a background-image
            // https://regex101.com/r/eF0oD0/1
            default:
                if (!preg_match('#background-image:\s*url\([\'"]?[\w\/]#',
                    $this->getAttribute('style'))) {
                    return '';
                }
        }

        // Carry on with normal rendering
        return parent::render();
    }
117895
private function outputImage(string $imagePath = ''): void
    {
        $fPointer = \fopen($imagePath, 'rb');
        $this->sendCachingHeaders($imagePath);
        \header('Content-Type: '.$this->getImageContentType());
        \header('Content-Length: '.\filesize($imagePath));
        \fpassthru($fPointer);
        \fclose($fPointer);
        die();
    }
790406
protected function renderResource(): void
    {
        $processedImageInfo = $this->imageService->processImage($this->originalAsset->getResource(), $this->adjustments->toArray());
        $this->resource = $processedImageInfo['resource'];
        $this->width = $processedImageInfo['width'];
        $this->height = $processedImageInfo['height'];
        $this->persistenceManager->whitelistObject($this->resource);
    }
732404
private function getImageData()
    {
        ob_start();
        imagegif($this->image);
        $output = ob_get_contents();
        ob_end_clean();
        imagedestroy($this->image);

        return $output;
    }
242036
public function render(){
	    
	    if (!$this->media || !$this->media->canShow()) {
	        Log::addMediaLog('Image Builder error: >' . I18N::translate('Missing or private media object.'));
	        $this->renderError();
	    }
	    
	    $serverFilename = $this->media->getServerFilename();
	    
	    if (!file_exists($serverFilename)) {
	        Log::addMediaLog('Image Builder error: >'. I18N::translate('The media object does not exist.').'< for path >'.$serverFilename.'<');
	        $this->renderError();
	    }
	    
	    $mimetype = $this->media->mimeType();
	    $imgsize = $this->media->getImageAttributes();
	    $filetime = $this->media->getFiletime();
	    $filetimeHeader = gmdate('D, d M Y H:i:s', $filetime) . ' GMT';	    
	    $expireHeader = gmdate('D, d M Y H:i:s', WT_TIMESTAMP + $this->getExpireOffset()) . ' GMT';
	    
	    $type = Functions::isImageTypeSupported($imgsize['ext']);
	    $usewatermark = false;
	    // if this image supports watermarks and the watermark module is intalled...
	    if ($type) {
	        $usewatermark = $this->isShowWatermark();
	    }
	    
	    // determine whether we have enough memory to watermark this image
	    if ($usewatermark) {
	        if (!FunctionsMedia::hasMemoryForImage($serverFilename)) {
	            // not enough memory to watermark this file
	            $usewatermark = false;
	        }
	    }
	    
	    $etag = $this->media->getEtag();
	    
	    // parse IF_MODIFIED_SINCE header from client
	    $if_modified_since = 'x';
	    if (!empty(Filter::server('HTTP_IF_MODIFIED_SINCE'))) {
	        $if_modified_since = preg_replace('/;.*$/', '', Filter::server('HTTP_IF_MODIFIED_SINCE'));
	    }
	    
	    // parse IF_NONE_MATCH header from client
	    $if_none_match = 'x';
	    if (!empty(Filter::server('HTTP_IF_NONE_MATCH'))) {
	        $if_none_match = str_replace('"', '', Filter::server('HTTP_IF_NONE_MATCH'));
	    }
	    
	    // add caching headers.  allow browser to cache file, but not proxy
	    header('Last-Modified: ' . $filetimeHeader);
	    header('ETag: "' . $etag . '"');
	    header('Expires: ' . $expireHeader);
	    header('Cache-Control: max-age=' . $this->getExpireOffset() . ', s-maxage=0, proxy-revalidate');
	    
	    // if this file is already in the user’s cache, don’t resend it
	    // first check if the if_modified_since param matches
	    if ($if_modified_since === $filetimeHeader) {
	        // then check if the etag matches
	        if ($if_none_match === $etag) {
	            http_response_code(304);
	    
	            return;
	        }
	    }	    

	    // send headers for the image
	    $disposition = $this->as_attachment ? 'attachment' : 'inline';
	    header('Content-Type: ' . $mimetype);
	    header('Content-Disposition: ' . $disposition . '; filename="' . addslashes(basename($this->media->getFilename())) . '"');
	     
	    if ($usewatermark) {
	        // generate the watermarked image
	        $imCreateFunc = 'imagecreatefrom' . $type;
	        $imSendFunc   = 'image' . $type;
	    
	        if (function_exists($imCreateFunc) && function_exists($imSendFunc)) {
	            $im = $imCreateFunc($serverFilename);
	            $im = $this->applyWatermark($im);
	    	    
	            // send the image
	            $imSendFunc($im);
	            imagedestroy($im);
	    
	            return;
	        } else {
	            // this image is defective.  log it
	            Log::addMediaLog('Image Builder error: >' . I18N::translate('This media file is broken and cannot be watermarked.') . '< in file >' . $serverFilename . '< memory used: ' . memory_get_usage());
	        }
	    }
	    
	    // determine filesize of image (could be original or watermarked version)
	    $filesize = filesize($serverFilename);
	    
	    // set content-length header, send file
	    header('Content-Length: ' . $filesize);
	    
	    // Some servers disable fpassthru() and readfile()
	    if (function_exists('readfile')) {
	        readfile($serverFilename);
	    } else {
	        $fp = fopen($serverFilename, 'rb');
	        if (function_exists('fpassthru')) {
	            fpassthru($fp);
	        } else {
	            while (!feof($fp)) {
	                echo fread($fp, 65536);
	            }
	        }
	        fclose($fp);
	    }	    
	}
154707
public function outputPlaintext()
    {
        echo str_repeat('=', 100) . "\n";
        echo $this->_backtrace[0]['file'] . ':' . $this->_backtrace[1]['function'] . ':' . $this->_backtrace[0]['line'] . "\n";
        echo str_repeat('-', 100) . "\n";
        echo self::dump($this->_var, $this->_depth, false);
        echo str_repeat('=', 100) . "\n";
    }
984670
public function display()
    {
        if(isset($this->edited )){
            $image = $this->edited;
        } else {
            $image = $this->original;
        }

        if ($this->type == "jpg")

    {
            header("Content-type: image/jpeg");
            imagejpeg($image);

        } elseif ($this->type == "png") {

            header("Content-type: image/png");
            imagepng($image);

        } elseif ($this->type == "gif") {

            header("Content-type: image/gif");
            imagegif($image);
        }
    }
1243886
protected function output()
    {
        if ($this->canSendHeaders() || $this->send_headers == false) {
            if ($this->send_headers) {
                // only send the content-type headers if no headers have been output
                // this will ease debugging on misconfigured servers where warnings
                // may have been output which break the image and prevent easily viewing
                // source to see the error.
                header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
                header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT");
                header("Cache-Control: no-store, no-cache, must-revalidate");
                header("Cache-Control: post-check=0, pre-check=0", false);
                header("Pragma: no-cache");
            }

            switch ($this->image_type) {
                case self::SI_IMAGE_JPEG:
                    if ($this->send_headers) header("Content-Type: image/jpeg");
                    imagejpeg($this->im, null, 90);
                    break;
                case self::SI_IMAGE_GIF:
                    if ($this->send_headers) header("Content-Type: image/gif");
                    imagegif($this->im);
                    break;
                default:
                    if ($this->send_headers) header("Content-Type: image/png");
                    imagepng($this->im);
                    break;
            }
        } else {
            echo '<hr /><strong>'
                .'Failed to generate captcha image, content has already been '
                .'output.<br />This is most likely due to misconfiguration or '
                .'a PHP error was sent to the browser.</strong>';
        }

        imagedestroy($this->im);
        restore_error_handler();

        if (!$this->no_exit) exit;
    }
805304
public function output() {
        $parts = explode('/', $this->output_path);
        // get rid of the filename
        array_pop($parts);

        $path = implode('/', $parts);
        if ($path && !file_exists($path)) {
            if (!mkdir($path, 0777, true)) {
                throw new \Exception("could not make directory $path");
            }
        }

        if (!file_put_contents($this->output_path, $this->render())) {
            throw new \Exception("could not write $filename");
        }
    }
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');
    }
  }
25810
public function display()
    {
        $this->output = '';
        $output = $this->load($this->_layout);
        $this->output = $this->output.$output;

        return $this->output;
    }
203661
public function inline()
	{
		// Start buffer and grab output
		ob_start();
		$this->output(null);
		$image_data = ob_get_contents();
		ob_end_clean();

		// Encode and build data uri
		$base64 = base64_encode($image_data);
		$image_atts = getimagesize($this->source);

		return 'data:' . $image_atts['mime'] . ';base64,' . $base64;
	}
134130
protected function output()
    {
        // first get content to local var
        $content = $this->getContentRaw();

        // iterate log content
        foreach ($content as $logEntry) {

            // build the log-line
            $content = $logEntry['time'].' '.
                '['.$logEntry['type'].'] '.
                $logEntry['fingerprint'].' '.
                $logEntry['message'].
                $this->lineBreak.$this->getLineSeparator().$this->lineBreak;

            // use persistent write to write content to file?
            if ($this->getPersistent() === true) {
                $this->getFilesystem()->pwrite($this->getLogfile(), $content, $this->getAppend());
            } else {
                $this->getFilesystem()->write($this->getLogfile(), $content, $this->getAppend());
            }
        }

        // so we can clear the existing log
        $this->clearContent();
    }