Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

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

  • BTB300
  • BTB300's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Posts: 415
  • Thank you received: 132
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

Please Log in or Create an account to join the conversation.

Last edit: by BTB300.

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

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
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!!!

Please Log in or Create an account to join the conversation.

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

  • BTB300
  • BTB300's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Posts: 415
  • Thank you received: 132
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

Please Log in or Create an account to join the conversation.

Last edit: by BTB300.

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

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
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

Please Log in or Create an account to join the conversation.

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

  • BTB300
  • BTB300's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Posts: 415
  • Thank you received: 132
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

Please Log in or Create an account to join the conversation.

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

  • BTB300
  • BTB300's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Posts: 415
  • Thank you received: 132
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
The following user(s) said Thank You: admin, JoomGuy

Please Log in or Create an account to join the conversation.

Last edit: by BTB300.
  • Page:
  • 1
Time to create page: 0.092 seconds

I jumped and started to work on a demo component... but 2 days later this demo component became the real component. I just showed today the end result to my customer and he turned to me and said... "this is more than I expected"... All of this is because Cook did cut about 70% of my work and provided me more ways to improve the usability of the component. The end result was 17 tables all related between than to generate a full dashboard for the travel agents. Thanks for Cook developers for such great tool. This component would not be possible to be done at short time with all the features in it
Griiettner (Forum)  

Get Started