mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-03 03:15:31 -04:00
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
|
thumbnail = ImageSize.resize img.data, height: 300
|
||||||
end
|
end
|
||||||
img.data = thumbnail
|
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
|
Storage.default.save_thumbnail @id, img
|
||||||
rescue e
|
rescue e
|
||||||
Logger.warn "Failed to generate thumbnail for entry " \
|
Logger.warn "Failed to generate thumbnail for entry " \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user