aboutsummaryrefslogtreecommitdiffstats
path: root/include/photo/photo_driver.php
diff options
context:
space:
mode:
authorAndrzej Budziński <andrzej@budzinski.ovh>2021-02-03 15:00:24 +0100
committerAndrzej Budziński <andrzej@budzinski.ovh>2021-02-03 15:00:24 +0100
commitba73845badef5c653c05c70ca27a5b37e2f25f97 (patch)
tree6b22545076df5f80b8714f07e92a518af24f0dc5 /include/photo/photo_driver.php
parent7ece28b9814e6bc7ea2879335520641561dc0ba5 (diff)
parent34b28cd8d36c7805e65c442ff1588ccf5165387a (diff)
downloadvolse-hubzilla-ba73845badef5c653c05c70ca27a5b37e2f25f97.tar.gz
volse-hubzilla-ba73845badef5c653c05c70ca27a5b37e2f25f97.tar.bz2
volse-hubzilla-ba73845badef5c653c05c70ca27a5b37e2f25f97.zip
Merge branch 'dev' into translation-pl
Diffstat (limited to 'include/photo/photo_driver.php')
-rw-r--r--include/photo/photo_driver.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php
index 97871e139..87b1d96fe 100644
--- a/include/photo/photo_driver.php
+++ b/include/photo/photo_driver.php
@@ -69,7 +69,7 @@ function photo_factory($data, $type = null) {
* @return null|string Guessed mimetype
*/
function guess_image_type($filename, $data = '') {
-
+
if($data)
$headers = (is_array($data) ? $data['header'] : $data);
@@ -135,9 +135,10 @@ function guess_image_type($filename, $data = '') {
}
}
- if(is_null($type) && strpos($filename, 'http') === false) {
+ if(is_null($type) && strpos($filename, 'http') === 0) {
$size = getimagesize($filename);
- $type = ((array_key_exists($size['mime'], $types)) ? $size['mime'] : 'image/jpeg');
+ if (array_key_exists($size['mime'], $types))
+ $type = $size['mime'];
}
if(is_null($type)) {