diff options
Diffstat (limited to 'include/photo')
-rw-r--r-- | include/photo/photo_driver.php | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php index c2eeafa54..484550cb7 100644 --- a/include/photo/photo_driver.php +++ b/include/photo/photo_driver.php @@ -538,14 +538,20 @@ function import_profile_photo($photo,$xchan,$thing = false) { } $photo_failure = false; + $img_str = ''; + if($photo) { + $filename = basename($photo); + $type = guess_image_type($photo,true); - $filename = basename($photo); - $type = guess_image_type($photo,true); - $result = z_fetch_url($photo,true); + if(! $type) + $type = 'image/jpeg'; - if($result['success']) - $img_str = $result['body']; + $result = z_fetch_url($photo,true); + + if($result['success']) + $img_str = $result['body']; + } $img = photo_factory($img_str, $type); if($img->is_valid()) { |