From 0fb0037ca7ea9910b490818a1cc13f4005ba6134 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sat, 28 Jul 2018 03:33:00 +0200 Subject: 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 --- spec/models/media_attachment_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'spec/models/media_attachment_spec.rb') diff --git a/spec/models/media_attachment_spec.rb b/spec/models/media_attachment_spec.rb index d2230b6d0..cb1cee518 100644 --- a/spec/models/media_attachment_spec.rb +++ b/spec/models/media_attachment_spec.rb @@ -129,9 +129,9 @@ RSpec.describe MediaAttachment, type: :model do expect(media.file.meta["original"]["width"]).to eq 600 expect(media.file.meta["original"]["height"]).to eq 400 expect(media.file.meta["original"]["aspect"]).to eq 1.5 - expect(media.file.meta["small"]["width"]).to eq 400 - expect(media.file.meta["small"]["height"]).to eq 267 - expect(media.file.meta["small"]["aspect"]).to eq 400.0/267 + expect(media.file.meta["small"]["width"]).to eq 490 + expect(media.file.meta["small"]["height"]).to eq 327 + expect(media.file.meta["small"]["aspect"]).to eq 490.0/327 end end -- cgit