mirror of https://github.com/getmango/Mango.git
Set thumbnail size and mimetype
This commit is contained in:
parent
54eb041fe4
commit
18834ac28e
|
@ -220,6 +220,11 @@ class Entry
|
|||
thumbnail = ImageSize.resize img.data, height: 300
|
||||
end
|
||||
img.data = thumbnail
|
||||
img.size = thumbnail.size
|
||||
unless img.mime == "image/webp"
|
||||
# image_size.cr resizes non-webp images to jpg
|
||||
img.mime = "image/jpeg"
|
||||
end
|
||||
Storage.default.save_thumbnail @id, img
|
||||
rescue e
|
||||
Logger.warn "Failed to generate thumbnail for entry " \
|
||||
|
|
Loading…
Reference in New Issue