Jump to content


Photo

Image Creation Problem


  • Please log in to reply
3 replies to this topic

#1 Maximus

Maximus
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 28 October 2006 - 05:08 AM

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!

<?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);

?>


#2 JasonLewis

JasonLewis
  • Members
  • PipPipPip
  • Advanced Member
  • 3,351 posts
  • LocationVictoria, Australia

Posted 28 October 2006 - 07:05 AM

do you have GD Library enabled because i think that may have an effect on the output...
Good luck with your coding.
Jason / ProjectFear / Jaysonic

#3 Maximus

Maximus
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 28 October 2006 - 08:15 PM

Yes, I checked via phpinfo, everything related to GD is enabled.

#4 Maximus

Maximus
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 29 October 2006 - 06:39 PM

bump




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users