From 7c655c8d61c1210815d024f7945bedf2ae7279fd Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 16 Nov 2017 19:26:56 -0800 Subject: allow svg image previews in cloud browser when using tile mode. --- Zotlabs/Storage/Browser.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'Zotlabs/Storage') diff --git a/Zotlabs/Storage/Browser.php b/Zotlabs/Storage/Browser.php index b5440aacf..ee5a9fef4 100644 --- a/Zotlabs/Storage/Browser.php +++ b/Zotlabs/Storage/Browser.php @@ -197,6 +197,11 @@ class Browser extends DAV\Browser\Plugin { } } + + // generate preview icons for tile view. + // Currently we only handle images, but this could potentially be extended with plugins + // to provide document and video thumbnails + $photo_icon = ''; if(strpos($type,'image/') === 0 && $attachHash) { @@ -206,8 +211,12 @@ class Browser extends DAV\Browser\Plugin { intval(PHOTO_RES_PROFILE_80) ); if($r) { - $photo_icon = $r[0]['resource_id'] . '-' . $r[0]['imgscale']; + $photo_icon = 'photo/' . $r[0]['resource_id'] . '-' . $r[0]['imgscale']; } + if($type === 'image/svg+xml') { + $photo_icon = $fullPath; + } + } $attachIcon = ""; // ""; -- cgit v1.2.3