• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

PHP Image Generation problem

777php

Diamond Member
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.
 
What version of IE, and have you tried any other, similar PNG images with it? Microsoft wasn't (isn't?) a big supporter of PNG and up through (4.0?) didn't display PNG files at all. The next version (5.0?) had only partial support and I'm not sure if they've ever fully implemented the spec.
 
I've used the code to create other images and they seem to come out fine, just when I use these exact coordinates, perhaps I should try another font.
 
Back
Top