allow svg image previews in cloud browser when using tile mode.

This commit is contained in:
zotlabs 2017-11-16 19:26:56 -08:00
parent 7386fa57c8
commit 7c655c8d61
2 changed files with 11 additions and 2 deletions

View file

@ -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 = ""; // "<a href=\"attach/".$attachHash."\" title=\"".$displayName."\"><i class=\"fa fa-arrow-circle-o-down\"></i></a>";

View file

@ -16,7 +16,7 @@
<div class="cloud-container">
<div class="cloud-icon"><a href="{{$item.fullPath}}">
{{if $item.photo_icon}}
<img src="photo/{{$item.photo_icon}}" title="{{$item.type}}" >
<img src="{{$item.photo_icon}}" title="{{$item.type}}" >
{{else}}
<i class="fa fa-fw {{$item.iconFromType}}" title="{{$item.type}}"></i>
{{/if}}