Thanks to all for viewing.
As CBroe says, imagecreatefromstring() does not throw exceptions.
I found somewhere to add these lines to the code
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
and now I get the following error...
Fatal error: imagecreatefromstring(): gd-jpeg: JPEG library reports unrecoverable error: Bogus DQT index 4 in...
So the program bombs out without warning
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…