Not really a problem with PHP's GD library, more of a problem with the "programmer" (me).
Here's the situation: I want to create an image using php gd once and save it so that it doesn't have to recreate it every time the page is loaded. So, here's the script:
So, what happens is it checks to see if the file exists, and if it doesn't it creates the image and saves it - this works. If the file already exists, it redirects to the index2.php (the home page) and that works.
Here's where things fuck up, when it creates the image it won't redirect, it just gives me this error:
Here's the situation: I want to create an image using php gd once and save it so that it doesn't have to recreate it every time the page is loaded. So, here's the script:
Code:
<?php
include ('config.php');
if($img = @GetimageSize("images/logo.gif"))
{
// nothing
}
else
{
$text = $site;
$file = "images/company_name.gif";
$dim = getimagesize($file);
$imagewidth = $dim[0];
$imageheight = $dim[1];
$image = imagecreatefromgif($file);
$white = imagecolorallocate($image, 255, 255, 255);
$font = "Spyroclassic.ttf";
imageTTFtext($image, 16, 0, 6, 21, $white, $font, $text);
imagegif($image,'images/logo.gif');
header("Content-type: image/gif");
imagedestroy($image);
}
header( 'Location: [URL="http://www.my-domain.tld/test-directory/%E2%80%9D"]http://www.My-Domain.tld/test-directory/[/URL]index2.php' ) ;
?>
Here's where things fuck up, when it creates the image it won't redirect, it just gives me this error:
Anybody that can help me? Please?The image “http://www.My-Domain.tld/test-directory/” cannot be displayed, because it contains errors.