Jump to content

Image Creation Problem


Maximus

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]
Link to comment
https://forums.phpfreaks.com/topic/25378-image-creation-problem/
Share on other sites

Archived

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

×
×
  • Create New...

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.