aboutsummaryrefslogtreecommitdiffstats
path: root/include/photo
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-02-17 14:30:02 -0800
committerfriendica <info@friendica.com>2014-02-17 14:30:02 -0800
commit08b571c9d0843b19115bd9bb892cb141c508ea3b (patch)
treeb713024b783dcdcef264167822e7004c254e8689 /include/photo
parentf38ab0904101366bf536d46ab460dcd5cf4f60ca (diff)
downloadvolse-hubzilla-08b571c9d0843b19115bd9bb892cb141c508ea3b.tar.gz
volse-hubzilla-08b571c9d0843b19115bd9bb892cb141c508ea3b.tar.bz2
volse-hubzilla-08b571c9d0843b19115bd9bb892cb141c508ea3b.zip
project "snakebite"
Diffstat (limited to 'include/photo')
-rw-r--r--include/photo/photo_driver.php16
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()) {