Jump to content

Archived

This topic is now archived and is closed to further replies.

Maximus

Image Creation Problem

Recommended Posts

Hi, I am trying to create an image via php.  I get "the image cannot be displayed, because it contains errors" message when viewing it. I don't know what I've done wrong, can someone point it out to me?  Thanks!

[code]<?php

header("Content-type: image/png");
$string = $_GET['text'];

$image = imagecreatefrompng("images/image_price.jpg");
$color = imagecolorallocate($image, 255, 255, 250);
$font = "images/font.ttf";

imagestring($image, $font, 0, 0, $string, $color);

imagepng($image);
imagedestroy($image);

?> [/code]

Share this post


Link to post
Share on other sites
do you have GD Library enabled because i think that may have an effect on the output...

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.