jordanwb Posted July 3, 2008 Share Posted July 3, 2008 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. Quote Link to comment Share on other sites More sharing options...
DarkWater Posted July 3, 2008 Share Posted July 3, 2008 You don't have GD enabled. If you're using Ubuntu, you need to do: sudo apt-get install php5-gd If you're using Windows, check your PHP.ini for the extension lines and find GD, uncomment it, and restart Apache. Quote Link to comment Share on other sites More sharing options...
TransmogriBenno Posted July 3, 2008 Share Posted July 3, 2008 You need the GD libraries, which are installed in various ways depending on your hosting environment. I compile them in. Quote Link to comment Share on other sites More sharing options...
jordanwb Posted July 3, 2008 Author Share Posted July 3, 2008 Thanks DarkWater. Quote Link to comment Share on other sites More sharing options...
TransmogriBenno Posted July 3, 2008 Share Posted July 3, 2008 Perhaps.. the installer script for the package will probably do it for you, though. Quote Link to comment Share on other sites More sharing options...
DarkWater Posted July 3, 2008 Share Posted July 3, 2008 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. Quote Link to comment Share on other sites More sharing options...
jordanwb Posted July 3, 2008 Author Share Posted July 3, 2008 Well all I did was install it and restart apache and it works just fine for me. Quote Link to comment Share on other sites More sharing options...
DarkWater Posted July 3, 2008 Share Posted July 3, 2008 Yeah. I know. But you won't have imagerotate or imagefilter and some other functions, trust me. If you ever need them, contact me. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.