aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-06-07 15:44:56 -0700
committerfriendica <info@friendica.com>2012-06-07 15:44:56 -0700
commitf4a80fcf2474a13b2d733f59f1a928b40841d83c (patch)
tree27c32cdfbaa3a63877b118609b5177c705ff747a /include/items.php
parentfcf8f301e595444620f07ea0e01994ea99ee961b (diff)
parent2438c6e45d47ca194b51f99ddf113112fbb6ccb9 (diff)
downloadvolse-hubzilla-f4a80fcf2474a13b2d733f59f1a928b40841d83c.tar.gz
volse-hubzilla-f4a80fcf2474a13b2d733f59f1a928b40841d83c.tar.bz2
volse-hubzilla-f4a80fcf2474a13b2d733f59f1a928b40841d83c.zip
Merge pull request #328 from fabrixxm/master
PNG with alpha channel
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/include/items.php b/include/items.php
index 66e219ddf..15c043e92 100755
--- a/include/items.php
+++ b/include/items.php
@@ -1346,7 +1346,11 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
}
$img_str = fetch_url($photo_url,true);
- $img = new Photo($img_str);
+ // guess mimetype from headers or filename
+ $type = guess_image_type($photo_url,true);
+
+
+ $img = new Photo($img_str, $type);
if($img->is_valid()) {
if($have_photo) {
q("DELETE FROM `photo` WHERE `resource-id` = '%s' AND `contact-id` = %d AND `uid` = %d",
@@ -1372,9 +1376,9 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
q("UPDATE `contact` SET `avatar-date` = '%s', `photo` = '%s', `thumb` = '%s', `micro` = '%s'
WHERE `uid` = %d AND `id` = %d LIMIT 1",
dbesc(datetime_convert()),
- dbesc($a->get_baseurl() . '/photo/' . $hash . '-4.jpg'),
- dbesc($a->get_baseurl() . '/photo/' . $hash . '-5.jpg'),
- dbesc($a->get_baseurl() . '/photo/' . $hash . '-6.jpg'),
+ dbesc($a->get_baseurl() . '/photo/' . $hash . '-4.'.$img->getExt()),
+ dbesc($a->get_baseurl() . '/photo/' . $hash . '-5.'.$img->getExt()),
+ dbesc($a->get_baseurl() . '/photo/' . $hash . '-6.'.$img->getExt()),
intval($contact['uid']),
intval($contact['id'])
);