imagecreatefrompng - Why am I getting the "Page cannot be displayed"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Olivierp
    New Member
    • Aug 2010
    • 2

    #1

    imagecreatefrompng - Why am I getting the "Page cannot be displayed"

    Hi folks,

    I've been scratching my head for the past hours regarding the GD function imagecreatefrom png.

    I had this script working on my test server:
    Code:
    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);
    I moved that script to another server, very similar in configuration.

    The script stopped working.

    The png image "bubble.png " is in the same directory as the script above (generate_img.p hp) and the font file (ARIAL.TTF) also is in the same directory.

    When running the script above, (accessing the generate_img.ph p 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
  • Olivierp
    New Member
    • Aug 2010
    • 2

    #2
    Update

    Hi,

    Providing an update on the issue I'm experiencing. As you probably guessed, I'm still not able to get this to work.

    Here's an error I dug out of the Apache error log:

    Code:
    gd-png:  fatal libpng error: Incompatible libpng version in application and library
    [3301] EACCELERATOR: PHP crashed on opline 5 of imagecreatefrompng() at /export/data/apache/htdocs/pssonline/realestate/generate_img.php:5
    I have the following GD version installed:
    Code:
    GD Support  enabled  
    GD Version  2.0 or higher  
    GIF Read Support  enabled  
    GIF Create Support  enabled  
    JPG Support  enabled  
    PNG Support  enabled  
    WBMP Support  enabled
    Should I have PNG Create Support enabled?

    Thaks for your help.

    Comment

    Working...