diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2018-07-28 03:33:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-28 03:33:00 +0200 |
commit | 0fb0037ca7ea9910b490818a1cc13f4005ba6134 (patch) | |
tree | 14e6979b62c92c46d81f8d20315baf9686f3fa17 /app/models | |
parent | 3c35b34b612c210c97ce8cffda33798ffa8f22e8 (diff) |
Resize images by area instead of fixed dimensions (#8083)
To improve the way super tall or super ride images are treated, the numbers remain the same, 1280x1280 and 400x400, but if an image is less in one dimension than the other, the other can become larger Thanks to @WAHa_06x36@mastodon.social for the tip
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/media_attachment.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/media_attachment.rb b/app/models/media_attachment.rb index f9a8f322e..63c6d5af8 100644 --- a/app/models/media_attachment.rb +++ b/app/models/media_attachment.rb @@ -32,12 +32,12 @@ class MediaAttachment < ApplicationRecord IMAGE_STYLES = { original: { - geometry: '1280x1280>', + pixels: 1_638_400, # 1280x1280px file_geometry_parser: FastGeometryParser, }, small: { - geometry: '400x400>', + pixels: 160_000, # 400x400px file_geometry_parser: FastGeometryParser, }, }.freeze @@ -152,7 +152,7 @@ class MediaAttachment < ApplicationRecord elsif VIDEO_MIME_TYPES.include? f.file_content_type [:video_transcoder] else - [:thumbnail] + [:lazy_thumbnail] end end end |