Wojciech Duda
asked on
imagecreatefromstring undefinded?
Hi,
can someone tell me why this piece of code:
/**
* Loads an image from a string (e.g. database)
* @param string the image
* @param mime mime type of the image
* @return boolean
* @access public
*/
function loadData ($image,$mime) {
if ( in_array($mime,$this->type s) ) {
$this->source=imagecreatef romstring( $image);
$this->sourceWidth=imagesx ($this->so urce);
$this->sourceHeight=images y($this->s ource);
$this->sourceMime=$mime;
$this->initThumb();
return true;
} else {
trigger_error('Image MIME type '.$mime.' not supported');
return false;
}
}
produces an error telling me imagecreatefromstring is not defined? Urgent.
can someone tell me why this piece of code:
/**
* Loads an image from a string (e.g. database)
* @param string the image
* @param mime mime type of the image
* @return boolean
* @access public
*/
function loadData ($image,$mime) {
if ( in_array($mime,$this->type
$this->source=imagecreatef
$this->sourceWidth=imagesx
$this->sourceHeight=images
$this->sourceMime=$mime;
$this->initThumb();
return true;
} else {
trigger_error('Image MIME type '.$mime.' not supported');
return false;
}
}
produces an error telling me imagecreatefromstring is not defined? Urgent.
What version of php are you using?
Hi mcwojtekk,
The piece of code you have there is a part of a class, which I don't know if you have. On the row:
$this->source=imagecreatef romstring( $image);
You are namely calling an function called: "imagecreatefromstring" with a parameter $image. This function must be defined somewhere and it isn't in the piece of code you have provided. If you have the function in the class try to put $this-> infront of so that you get:
$this->source=$this->image createfrom string($im age);
Good luck!
//madwax
Cheers!
The piece of code you have there is a part of a class, which I don't know if you have. On the row:
$this->source=imagecreatef
You are namely calling an function called: "imagecreatefromstring" with a parameter $image. This function must be defined somewhere and it isn't in the piece of code you have provided. If you have the function in the class try to put $this-> infront of so that you get:
$this->source=$this->image
Good luck!
//madwax
Cheers!
ASKER
I have installed EasyPHP 1.7. I have the full class but it was coded by someone else. Now if I try to view the page this error comes up:
Fatal error: Call to undefined function: imagecreatefromstring() in c:\program files\easyphp1-7\www\***** **_intrane t\includes \lib\thumb nail.php on line 174
From what I understand this function is part of php, why the 'undefined' error?
Fatal error: Call to undefined function: imagecreatefromstring() in c:\program files\easyphp1-7\www\*****
From what I understand this function is part of php, why the 'undefined' error?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Editing the php.ini helped. Thanks a lot.