src/Webtrees/ImageBuilder.php
protected function renderError() {	
	    $error = I18N::translate('The media file was not found in this family tree.');

    	$width  = (mb_strlen($error) * 6.5 + 50) * 1.15;
    	$height = 60;
    	$im     = imagecreatetruecolor($width, $height); /* Create a black image */
    	$bgc    = imagecolorallocate($im, 255, 255, 255); /* set background color */
    	imagefilledrectangle($im, 2, 2, $width - 4, $height - 4, $bgc); /* create a rectangle, leaving 2 px border */
    
    	$this->embedText($im, $error, 100, '255, 0, 0', WT_ROOT . Config::FONT_DEJAVU_SANS_TTF, 'top', 'left');
    
    	http_response_code(404);
    	header('Content-Type: image/png');
    	imagepng($im);
    	imagedestroy($im);
	}
protected function renderError() {	
	    $error = I18N::translate('The media file was not found in this family tree.');

    	$width  = (mb_strlen($error) * 6.5 + 50) * 1.15;
    	$height = 60;
    	$im     = imagecreatetruecolor($width, $height); /* Create a black image */
    	$bgc    = imagecolorallocate($im, 255, 255, 255); /* set background color */
    	imagefilledrectangle($im, 2, 2, $width - 4, $height - 4, $bgc); /* create a rectangle, leaving 2 px border */
    
    	$this->embedText($im, $error, 100, '255, 0, 0', WT_ROOT . Config::FONT_DEJAVU_SANS_TTF, 'top', 'left');
    
    	http_response_code(404);
    	header('Content-Type: image/png');
    	imagepng($im);
    	imagedestroy($im);
	}
protected function renderError ( ) { $ error = I18N :: translate ( 'The media file was not found in this family tree.' ) ; $ width = ( mb_strlen ( $ error ) * 6.5 + 50 ) * 1.15 ; $ height = 60 ; $ im = imagecreatetruecolor ( $ width , $ height ) ; /* Create a black image */ $ bgc = imagecolorallocate ( $ im , 255 , 255 , 255 ) ; /* set background color */ imagefilledrectangle ( $ im , 2 , 2 , $ width - 4 , $ height - 4 , $ bgc ) ; /* create a rectangle, leaving 2 px border */ $ this -> embedText ( $ im , $ error , 100 , '255, 0, 0' , WT_ROOT . Config :: FONT_DEJAVU_SANS_TTF , 'top' , 'left' ) ; http_response_code ( 404 ) ; header ( 'Content-Type: image/png' ) ; imagepng ( $ im ) ; imagedestroy ( $ im ) ; }
Render an error as an image.
Render an error as an image .