Merge pull request #645 from git-marijus/dev
do not choke if photo_factory() returns null
This commit is contained in:
commit
8478ecc675
@ -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();
|
||||
|
@ -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');
|
||||
|
||||
|
Reference in New Issue
Block a user