CodeIgniter Forums
[NEED HELP] imagecreate - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: [NEED HELP] imagecreate (/thread-44088.html)

[NEED HELP] imagecreate - El Forum - 08-02-2011

Hello I try to build a library to create and show an image on my webpage.

here the library code :
class Img_library {
public function  __construct() {

public function img_show_image() {
header("Content-Type: image/png");
$im = @imagecreate(110, 20)
    or die("Impossible d'initialiser la bibliothèque GD");
$background_color = imagecolorallocate($im, 0, 0, 0);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5,  "A Simple Text String", $text_color);


The code works well when I execute it out of codeigniter folders
example : http://localhost/test.php

but when I put it in the ci library folder and call the library to execute the img_show_image()
its said that it cannot load the image because there's some errors...

please help me if you know how to resolve.

[NEED HELP] imagecreate - El Forum - 08-02-2011

Post the exact error you're receiving, and perhaps the contents of your controller.