Hopefully this fixes the tests

This commit is contained in:
Michael 2018-07-08 05:10:45 +00:00
parent 74d5eec571
commit 271b6cb8f9
1 changed files with 7 additions and 4 deletions

View File

@ -781,9 +781,12 @@ class Image
$img_str = Network::fetchUrl($url, true, $redirects, 4); $img_str = Network::fetchUrl($url, true, $redirects, 4);
$filesize = strlen($img_str); $filesize = strlen($img_str);
if (function_exists("getimagesizefromstring")) { // The tests are failing with an read error. This can be caused by memory shortage
$data = getimagesizefromstring($img_str); // See https://stackoverflow.com/questions/10175758/getimagesize-read-error
} else { // So we use the alternate method instead
//if (function_exists("getimagesizefromstring")) {
// $data = getimagesizefromstring($img_str);
//} else {
$tempfile = tempnam(get_temppath(), "cache"); $tempfile = tempnam(get_temppath(), "cache");
$a = get_app(); $a = get_app();
@ -793,7 +796,7 @@ class Image
$data = getimagesize($tempfile); $data = getimagesize($tempfile);
unlink($tempfile); unlink($tempfile);
} //}
if ($data) { if ($data) {
$data["size"] = $filesize; $data["size"] = $filesize;