[Embed] Fix plugin. Only attempt to show an image, if we have one

This commit is contained in:
2021-04-28 15:03:17 +00:00
parent 2adb3c3521
commit 30107de079
5 changed files with 112 additions and 43 deletions

View File

@@ -142,7 +142,9 @@ class AttachmentThumbnail extends Entity
public function getFilename()
{
return $this->getAttachment()->getFileHash() . "-{$this->width}x{$this->height}.webp";
// TODO only for images
$ext = image_type_to_extension(IMAGETYPE_WEBP, include_dot: true);
return $this->getAttachment()->getFileHash() . "-{$this->width}x{$this->height}{$ext}";
}
public function getPath()