Welcome, Guest
Username: Password: Remember me

TOPIC: [SOLVED] Fatal error: Call to undefined function imagecreate()

[SOLVED] Fatal error: Call to undefined function imagecreate() 11 Dec 2012 00:05 #6002

  • BTB300
  • BTB300's Avatar
  • Offline
  • Moderator
  • Posts: 415
  • Thank you received: 132
  • Karma: 47
Hi there
im getting the following when viewing a collection view when an image that has been uploaded

Fatal error: Call to undefined function imagecreatefrompng() in .... \administrator\components\com_mycom\classes\images.php on line 338

snippet below
function load($file = null)
	{

		if (!$file)
			$file = $this->file;

		if (!$this->type)
			$this->type = $this->typeFromMime(self::getMime($file));

		if($this->type=='jpeg') 
			$image = imagecreatefromjpeg($file);
			
        if($this->type=='png') 
			$image = imagecreatefrompng($file);
			
		if($this->type=='bmp') 
			$image = imagecreatefromwbmp($file);

        if($this->type=='gif')
        {
        	$data = file_get_contents($file);
        	$image = imagecreatefromstring($data);
        }

        return $image;
	}

- New / Fresh component that i started building over weekend
- have tried for jpeg as well but still fails
- when there is no file defined layout displays normally without error (for obvious reasons)
- Have done search on the admin side of com_mycomponent and no such function is found

Config 2.0 build - jquery - embedded - exploded - reduced - model

Thanks in advance
Last Edit: 11 Dec 2012 00:06 by BTB300.
The administrator has disabled public write access.

[SOLVED] Fatal error: Call to undefined function imagecreate() 11 Dec 2012 07:25 #6003

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
  • Karma: 64
Have you searched another component for the function?

Could this be related to reduced features? I know that it shouldn't but would be worth checking another component with all features maybe.

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
The administrator has disabled public write access.

[SOLVED] Fatal error: Call to undefined function imagecreate() 11 Dec 2012 09:34 #6004

  • BTB300
  • BTB300's Avatar
  • Offline
  • Moderator
  • Posts: 415
  • Thank you received: 132
  • Karma: 47
thanks Audibleid,
checked another recent component and imagecreatefrompng() is only found once on the administrator side - the two components are the same configuration
- checked another older one - 15/11/2012 still only found once no function definition
- code snippet the same :(
- have not had this issue before but its been a while since i used / tested it...
- its sort of like one of those functionalities you set and forget i guess

- I have 9 components with it only found once oldest build is 4/11/2012 - there is a chance that everyone of them has the reduced functionality

- will test with max and work my way down
- Jquery-embeded-exploded-maximum-no Model-20

Thanks again
Last Edit: 11 Dec 2012 10:20 by BTB300.
The administrator has disabled public write access.

[SOLVED] Fatal error: Call to undefined function imagecreate() 11 Dec 2012 17:59 #6019

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
A problem in your PHP.

Did you tried on another server ?
This function is a PHP native. Maybe deprecated recently. Do not seems...
php.net/manual/fr/function.imagecreatefrompng.php


In your previous tests, was you trying to upload PNG ? Because others formats are calling other functions (same style : imagecreatefromjpeg() ...)
Coding is now a piece of cake
The administrator has disabled public write access.

[SOLVED] Fatal error: Call to undefined function imagecreate() 12 Dec 2012 11:24 #6027

  • BTB300
  • BTB300's Avatar
  • Offline
  • Moderator
  • Posts: 415
  • Thank you received: 132
  • Karma: 47
Thanks Admin,
My php version is 5.4.7 on Apache 2.2.19 Joomla 2.5.8
Will test on another server over the next few days
Yes - tried .jpg same result
The administrator has disabled public write access.

[SOLVED] Fatal error: Call to undefined function imagecreate() 13 Dec 2012 10:12 #6038

  • BTB300
  • BTB300's Avatar
  • Offline
  • Moderator
  • Posts: 415
  • Thank you received: 132
  • Karma: 47
SOLVED - So Simple

For those that may experience a Fatal error: Call to undefined function imagecreate()

Check your PHP ini file
under dynamic extensions make sure that the following extension is enabled

extension=php_gd2.dll

Thanks to Audibleid and Admin for the assistance

MOVED TOPIC: to trouble shooting
Last Edit: 13 Dec 2012 10:12 by BTB300.
The administrator has disabled public write access.
The following user(s) said Thank You: admin, JoomGuy
Time to create page: 0.234 seconds

Get Started