- // The tests are failing with an read error. This can be caused by memory shortage
- // See https://stackoverflow.com/questions/10175758/getimagesize-read-error
- // So we use the alternate method instead
- //if (function_exists("getimagesizefromstring")) {
- // $data = getimagesizefromstring($img_str);
- //} else {
- $tempfile = tempnam(get_temppath(), "cache");
+ try {
+ if (function_exists("getimagesizefromstring")) {
+ $data = @getimagesizefromstring($img_str);
+ } else {
+ $tempfile = tempnam(get_temppath(), "cache");