From d0ba77047e539b7ae102296d096fcfd668a2ec92 Mon Sep 17 00:00:00 2001
From: Eugen Rochko <eugen@zeonfederated.com>
Date: Tue, 1 Nov 2022 13:01:39 +0100
Subject: [PATCH] Change max. thumbnail dimensions to 640x360px (360p) (#19619)

---
 app/models/media_attachment.rb       | 2 +-
 spec/models/media_attachment_spec.rb | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/app/models/media_attachment.rb b/app/models/media_attachment.rb
index a24fb857b..4a1948380 100644
--- a/app/models/media_attachment.rb
+++ b/app/models/media_attachment.rb
@@ -72,7 +72,7 @@ class MediaAttachment < ApplicationRecord
     }.freeze,
 
     small: {
-      pixels: 160_000, # 400x400px
+      pixels: 230_400, # 640x360px
       file_geometry_parser: FastGeometryParser,
       blurhash: BLURHASH_OPTIONS,
     }.freeze,
diff --git a/spec/models/media_attachment_spec.rb b/spec/models/media_attachment_spec.rb
index cbd9a09c5..29fd313ae 100644
--- a/spec/models/media_attachment_spec.rb
+++ b/spec/models/media_attachment_spec.rb
@@ -157,9 +157,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 490
-      expect(media.file.meta["small"]["height"]).to eq 327
-      expect(media.file.meta["small"]["aspect"]).to eq 490.0 / 327
+      expect(media.file.meta["small"]["width"]).to eq 588
+      expect(media.file.meta["small"]["height"]).to eq 392
+      expect(media.file.meta["small"]["aspect"]).to eq 1.5
     end
 
     it 'gives the file a random name' do