I've written a web app that generates images with text based on user input.
Everything works well in Netscape, Mozilla, and Opera but when the image is viewed in Internet Explorer, the image looks terrible.
The text can only be seen as an outline.
I am using the function
imagecreatefrompng
so all images are that are being outputted are png files. I would like to stick with PNG's and not use jpegs. GIF's are out of the question as I didn't compile GD with GIF support.
Here is the code that I am currently using.
------------------------------------------------------------------------
if (empty($textfield))
{
echo
"Could not create image - form not filled out correctly";
exit;
}
$im = imagecreatefrompng ("banner.png");
//Find image dimensions
$width_image = ImagesX($im);
$height_image = ImagesY($im);
$font_size = 23;
//Set text coordinates
$text_x = $width_image - (627);
$text_y = $height_image - (8);
$black = ImageColorAllocate ($im, 0, 0, 0);
ImageTTFText ($im, $font_size, 0, $text_x, $text_y, $black, "/universultra.ttf",
$overbanner);
//Output
Imagepng ($im, ($image_dir). "Banner.png");
ImageDestroy ($im);
------------------------------------------------------------------------
Can anyone figure out why this is happening
Link to image
I took a screenshot of the image in IE and then saved it as a gif.
Everything works well in Netscape, Mozilla, and Opera but when the image is viewed in Internet Explorer, the image looks terrible.
The text can only be seen as an outline.
I am using the function
imagecreatefrompng
so all images are that are being outputted are png files. I would like to stick with PNG's and not use jpegs. GIF's are out of the question as I didn't compile GD with GIF support.
Here is the code that I am currently using.
------------------------------------------------------------------------
if (empty($textfield))
{
echo
"Could not create image - form not filled out correctly";
exit;
}
$im = imagecreatefrompng ("banner.png");
//Find image dimensions
$width_image = ImagesX($im);
$height_image = ImagesY($im);
$font_size = 23;
//Set text coordinates
$text_x = $width_image - (627);
$text_y = $height_image - (8);
$black = ImageColorAllocate ($im, 0, 0, 0);
ImageTTFText ($im, $font_size, 0, $text_x, $text_y, $black, "/universultra.ttf",
$overbanner);
//Output
Imagepng ($im, ($image_dir). "Banner.png");
ImageDestroy ($im);
------------------------------------------------------------------------
Can anyone figure out why this is happening
Link to image
I took a screenshot of the image in IE and then saved it as a gif.