- try {
- // Tell getThumbnail that we can show an animated image if it has one (4th arg, "force_still")
- $thumb = $this->attachment->getThumbnail(null, null, false, false);
- $this->out->element('img', array('class'=>'u-photo', 'src' => $thumb->getUrl(), 'alt' => ''));
- } catch (UseFileAsThumbnailException $e) {
- $this->out->element('img', array('class'=>'u-photo', 'src' => $e->file->getUrl(), 'alt' => $e->file->title));
- } catch (UnsupportedMediaException $e) {
- // FIXME: Show a good representation of unsupported/unshowable images
+ if ($thumb instanceof File_thumbnail) {
+ $this->out->element('img', $thumb->getHtmlAttrs(['class'=>'u-photo', 'alt' => '']));
+ } else {
+ $this->out->element('img', array('class'=>'u-photo', 'src' => $this->attachment->getUrl(), 'alt' => $this->attachment->getTitle()));