Jump to content

[SOLVED] Call to undefined function imagecreatefromjpeg()


jordanwb

Recommended Posts

I'm trying to use the class given http://www.white-hat-web-design.co.uk/articles/php-image-resizing.php to resize a picture. But when I call the load function I get the error:

 

Fatal error: Call to undefined function imagecreatefromjpeg() in /var/www/photos/system/photo_resize.php on line 31

 

Now I think I have to include some module, but I don't know what to do regarding that.

Link to comment
Share on other sites

sudo apt-get install php5-gd

sudo /etc/init.d/apache2 restart

php5 -m | grep 'gd'

 

But now, there's a catch.  Ubuntu doesn't use the bundled GD library, they actually use the system's GD library, which lacks the imagerotate and imagefilter (and some other) functions.  If you need them, you need to change the package and reconfigure it which can take a good hour or hour and a half because it's a HUGE package.  If you need those functions, send me a PM.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.