I've been scratching my head for the past hours regarding the GD function imagecreatefrompng.
I had this script working on my test server:
Expand|Select|Wrap|Line Numbers
- header("Cache-Control: no-cache, must-revalidate");
- header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
- $img = imagecreatefrompng("bubble.png") or die("error");
- $new_text = $_GET[text];
- $font = "ARIAL.TTF";
- $white = imagecolorallocate($img,255,255,255);
- $black = imagecolorallocate($img,0,0,0);
- $purple = imagecolorallocate($img,73,22,109);
- imageAlphaBlending($img, true);
- imageSaveAlpha($img, true);
- imagettftext($img,22,0,11,30,$purple,$font,$new_text);
- header('Content-Type: image/png');
- imagepng($img);
- imagedestroy($img);
The script stopped working.
The png image "bubble.png" is in the same directory as the script above (generate_img.php) and the font file (ARIAL.TTF) also is in the same directory.
When running the script above, (accessing the generate_img.php page), IE 6 returns the broken link error: Page cannot be displayed.
I tried different ways to access the png image such as using the full path, http://... and adding / before the png file name. The result of modifying the path to an invalid path is the "die" part of the function (error).
I do not know how to approach this problem anymore, any help will be greatly apreciated.
Olivier