Merge pull request #645 from git-marijus/dev

do not choke if photo_factory() returns null
This commit is contained in:
zotlabs 2017-01-16 18:31:09 +11:00 committed by GitHub
commit 8478ecc675
2 changed files with 7 additions and 1 deletions

View File

@ -714,6 +714,10 @@ function scale_external_images($s, $include_link = true, $scale_replace = false)
if($i['success']) {
$ph = photo_factory($i['body'], $type);
if(! is_object($ph))
continue;
if($ph->is_valid()) {
$orig_width = $ph->getWidth();
$orig_height = $ph->getHeight();

View File

@ -11,8 +11,10 @@ function photo_factory($data, $type = null) {
'image/svg+xml'
);
if($type && in_array(strtolower($type),$unsupported_types))
if($type && in_array(strtolower($type),$unsupported_types)) {
logger('photo_factory: unsupported image type');
return null;
}
$ignore_imagick = get_config('system', 'ignore_imagick');