diff options
author | Christian Vogeley <christian.vogeley@hotmail.de> | 2013-12-22 14:31:27 +0100 |
---|---|---|
committer | Christian Vogeley <christian.vogeley@hotmail.de> | 2013-12-22 14:31:27 +0100 |
commit | 870df76463a1cc9823b364db0bfb387f3f46664f (patch) | |
tree | a8c7391bfe799703aa0a8f26b9ee788f1204e8be /include/photo | |
parent | 25a533bd72c34e9775af71c010a39db6caf7b633 (diff) | |
parent | 7e7b5bfa4930493a8feae10b0550e29797956c70 (diff) | |
download | volse-hubzilla-870df76463a1cc9823b364db0bfb387f3f46664f.tar.gz volse-hubzilla-870df76463a1cc9823b364db0bfb387f3f46664f.tar.bz2 volse-hubzilla-870df76463a1cc9823b364db0bfb387f3f46664f.zip |
Merge remote-tracking branch 'upstream/master' into bootstrap
Conflicts:
view/php/theme_init.php
Diffstat (limited to 'include/photo')
-rw-r--r-- | include/photo/photo_driver.php | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php index 38210ba26..3d8ee2196 100644 --- a/include/photo/photo_driver.php +++ b/include/photo/photo_driver.php @@ -473,19 +473,19 @@ abstract class photo_driver { * @arg $fromcurl boolean Check Content-Type header from curl request */ -function guess_image_type($filename, $fromcurl=false) { +function guess_image_type($filename, $headers = '') { logger('Photo: guess_image_type: '.$filename . ($fromcurl?' from curl headers':''), LOGGER_DEBUG); $type = null; - if ($fromcurl) { + if ($headers) { $a = get_app(); - $headers=array(); - $h = explode("\n",$a->get_curl_headers()); + $hdrs=array(); + $h = explode("\n",$headers); foreach ($h as $l) { list($k,$v) = array_map("trim", explode(":", trim($l), 2)); - $headers[$k] = $v; + $hdrs[$k] = $v; } - if (array_key_exists('Content-Type', $headers)) - $type = $headers['Content-Type']; + if (array_key_exists('Content-Type', $hdrs)) + $type = $hdrs['Content-Type']; } if (is_null($type)){ // FIXME!!!! @@ -576,9 +576,9 @@ function import_profile_photo($photo,$xchan) { $photo_failure = true; } if($photo_failure) { - $photo = $a->get_baseurl() . '/images/person-175.jpg'; - $thumb = $a->get_baseurl() . '/images/person-80.jpg'; - $micro = $a->get_baseurl() . '/images/person-48.jpg'; + $photo = $a->get_baseurl() . '/' . get_default_profile_photo(); + $thumb = $a->get_baseurl() . '/' . get_default_profile_photo(80); + $micro = $a->get_baseurl() . '/' . get_default_profile_photo(48); $type = 'image/jpeg'; } |