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. Link to comment https://forums.phpfreaks.com/topic/113096-solved-call-to-undefined-function-imagecreatefromjpeg/ 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. Link to comment https://forums.phpfreaks.com/topic/113096-solved-call-to-undefined-function-imagecreatefromjpeg/#findComment-580940 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. Link to comment https://forums.phpfreaks.com/topic/113096-solved-call-to-undefined-function-imagecreatefromjpeg/#findComment-580941 Share on other sites More sharing options...
jordanwb Posted July 3, 2008 Author Share Posted July 3, 2008 Thanks DarkWater. Link to comment https://forums.phpfreaks.com/topic/113096-solved-call-to-undefined-function-imagecreatefromjpeg/#findComment-580943 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. Link to comment https://forums.phpfreaks.com/topic/113096-solved-call-to-undefined-function-imagecreatefromjpeg/#findComment-580944 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. Link to comment https://forums.phpfreaks.com/topic/113096-solved-call-to-undefined-function-imagecreatefromjpeg/#findComment-580945 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. Link to comment https://forums.phpfreaks.com/topic/113096-solved-call-to-undefined-function-imagecreatefromjpeg/#findComment-581000 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. Link to comment https://forums.phpfreaks.com/topic/113096-solved-call-to-undefined-function-imagecreatefromjpeg/#findComment-581001 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.