PHP Function ImagecreateFromJPEG Causing Fatal Error
Article
php function imagecreatefromjpeg causing fatal error
If your script is throwing this error in a gd environment then you may be running into the issue that GD library doesn't have enough memory to run the function or even the rest of the program. This might be because your host sets a low memory limit for PHP and you need to increase it before any GD related function works.
In such a case you can try using ImageMagick instead of gd. It might be able to estimate how much memory will be needed so that it can abort the operation if it is going to be higher than your memory limit. It also might be able to do the work in a more memory friendly way if resizing is the only thing that is needed.
Another possibility is that your GD version does not support JPEG. This is most likely the case if your PHP version is older than 1.8 and you haven't installed and enabled the libjpeg extension. You should install a newer version of GD in order to enable JPEG support in PHP.