diff --git a/app/models/concerns/account_avatar.rb b/app/models/concerns/account_avatar.rb index 2d5ebfca35aea67c09a2d5bb1862e2ee5cb8a1d1..753531a78f5f4cb2b72095a73ea53a9711c25c0d 100644 --- a/app/models/concerns/account_avatar.rb +++ b/app/models/concerns/account_avatar.rb @@ -18,7 +18,7 @@ module AccountAvatar included do # Avatar upload - has_attached_file :avatar, styles: ->(f) { avatar_styles(f) }, convert_options: { all: '-strip' }, processors: [:lazy_thumbnail] + has_attached_file :avatar, styles: ->(f) { avatar_styles(f) }, convert_options: { all: '+profile exif' }, processors: [:lazy_thumbnail] validates_attachment_content_type :avatar, content_type: IMAGE_MIME_TYPES validates_attachment_size :avatar, less_than: LIMIT remotable_attachment :avatar, LIMIT diff --git a/app/models/concerns/account_header.rb b/app/models/concerns/account_header.rb index 067e166eb6ce5e340a86489c1c12d525c2c24dfd..aed2baddc22469cb422beff8f9b2ab2134f677d6 100644 --- a/app/models/concerns/account_header.rb +++ b/app/models/concerns/account_header.rb @@ -19,7 +19,7 @@ module AccountHeader included do # Header upload - has_attached_file :header, styles: ->(f) { header_styles(f) }, convert_options: { all: '-strip' }, processors: [:lazy_thumbnail] + has_attached_file :header, styles: ->(f) { header_styles(f) }, convert_options: { all: '+profile exif' }, processors: [:lazy_thumbnail] validates_attachment_content_type :header, content_type: IMAGE_MIME_TYPES validates_attachment_size :header, less_than: LIMIT remotable_attachment :header, LIMIT diff --git a/app/models/custom_emoji.rb b/app/models/custom_emoji.rb index 0dacaf654bc7c4f78cf074a9b592fc271aba6d59..b42fac1044fa83ebb41feef2ad86c63832992992 100644 --- a/app/models/custom_emoji.rb +++ b/app/models/custom_emoji.rb @@ -33,7 +33,7 @@ class CustomEmoji < ApplicationRecord belongs_to :category, class_name: 'CustomEmojiCategory', optional: true has_one :local_counterpart, -> { where(domain: nil) }, class_name: 'CustomEmoji', primary_key: :shortcode, foreign_key: :shortcode - has_attached_file :image, styles: { static: { format: 'png', convert_options: '-coalesce -strip' } } + has_attached_file :image, styles: { static: { format: 'png', convert_options: '-coalesce +profile exif' } } before_validation :downcase_domain diff --git a/app/models/media_attachment.rb b/app/models/media_attachment.rb index 6468d104d253c2837d8fe02c0dad140c53058f57..b2602860c314a40bd7af638eb4681381b9ce94d4 100644 --- a/app/models/media_attachment.rb +++ b/app/models/media_attachment.rb @@ -132,7 +132,7 @@ class MediaAttachment < ApplicationRecord has_attached_file :file, styles: ->(f) { file_styles f }, processors: ->(f) { file_processors f }, - convert_options: { all: '-quality 90 -strip +set modify-date +set create-date' } + convert_options: { all: '-quality 90 +profile exif +set modify-date +set create-date' } validates_attachment_content_type :file, content_type: IMAGE_MIME_TYPES + VIDEO_MIME_TYPES + AUDIO_MIME_TYPES validates_attachment_size :file, less_than: IMAGE_LIMIT, unless: :larger_media_format? diff --git a/app/models/preview_card.rb b/app/models/preview_card.rb index 4e89fbf8510f9a33783aca9aa695d4b1580eb0c3..107ba433c383838998871c2a4a05cc5317eeba8c 100644 --- a/app/models/preview_card.rb +++ b/app/models/preview_card.rb @@ -34,7 +34,7 @@ class PreviewCard < ApplicationRecord has_and_belongs_to_many :statuses - has_attached_file :image, styles: ->(f) { image_styles(f) }, convert_options: { all: '-quality 80 -strip' } + has_attached_file :image, styles: ->(f) { image_styles(f) }, convert_options: { all: '-quality 80 +profile exif' } include Attachmentable @@ -66,7 +66,7 @@ class PreviewCard < ApplicationRecord original: { geometry: '400x400>', file_geometry_parser: FastGeometryParser, - convert_options: '-coalesce -strip', + convert_options: '-coalesce +profile exif', }, }