UseFileAsThumbnailException (helps support GIFs)

This commit is contained in:
Mikael Nordfeldth
2014-06-17 11:54:05 +02:00
parent 19e80a60df
commit 5a3d74d9a8
5 changed files with 60 additions and 1 deletions

View File

@@ -115,6 +115,8 @@ class AttachmentListItem extends Widget
try {
$thumb = $this->attachment->getThumbnail();
$this->out->element('img', array('src' => $thumb->getUrl(), 'alt' => ''));
} catch (UseFileAsThumbnailException $e) {
$this->out->element('img', array('src' => $e->file->getUrl(), 'alt' => $e->file->title));
} catch (UnsupportedMediaException $e) {
// FIXME: Show a good representation of unsupported/unshowable images
}