Skip to content

If preview generation fails for a file there is no fallback mimetype icon #760

Open
@nickvergessen

Description

The activity app is not very forgiving to thumbnail errors. It basically only checks if the mimetype is supported and not whether the actual preview could be generated.

activity/js/script.js

Lines 254 to 257 in cf196a2

var preview = activity.previews[i];
content += ((preview.link) ? '<a href="' + preview.link + '">' + "\n" : '')
+ '<img class="preview' + ((preview.isMimeTypeIcon) ? ' preview-mimetype-icon' : '') + '" src="' + preview.source + '" alt="' + t('activity', 'Open {filename}', preview) + '" />' + "\n"
+ ((preview.link) ? '</a>' + "\n" : '')

} elseif ($this->preview->isAvailable($fileInfo)) {
$preview['source'] = $this->urlGenerator->linkToRouteAbsolute('core.Preview.getPreview', [
'file' => $info['path'],
'c' => $this->view->getETag($info['path']),
'x' => 150,
'y' => 150,
]);
$preview['mimeType'] = $fileInfo->getMimetype() ?: 'application/octet-stream';
$preview['isMimeTypeIcon'] = false;

I guess it should do something like:
https://github.com/nextcloud/spreed/blob/2463190ded52085a0f317dc5b057253aadaa5be4/src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.vue#L404-L412

_Originally posted by @nickvergessen in nextcloud/server#36304

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions