From ba2452a076c0635e94c6a0967b778df0df14eca7 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 7 Jun 2012 16:02:56 -0700 Subject: png support for embedded private photos --- include/items.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/items.php') diff --git a/include/items.php b/include/items.php index 15c043e92..fc6819738 100755 --- a/include/items.php +++ b/include/items.php @@ -2952,7 +2952,7 @@ function fix_private_photos($s,$uid, $item = null, $cid = 0) { if(stristr($image , $site . '/photo/')) { $replace = false; $i = basename($image); - $i = str_replace('.jpg','',$i); + $i = str_replace(array('.jpg','.png'),array('',''),$i); $x = strpos($i,'-'); if($x) { $res = substr($i,$x+1); @@ -2994,7 +2994,7 @@ function fix_private_photos($s,$uid, $item = null, $cid = 0) { } if($replace) { logger('fix_private_photos: replacing photo', LOGGER_DEBUG); - $s = str_replace($image, 'data:image/jpg;base64,' . base64_encode($r[0]['data']), $s); + $s = str_replace($image, 'data:' . $r[0]['type'] . ';base64,' . base64_encode($r[0]['data']), $s); logger('fix_private_photos: replaced: ' . $s, LOGGER_DATA); } } -- cgit v1.2.3