Skip to content

Commit

Permalink
Merge pull request mastodon#124 from CrossGate-Pawoo/remove_webp_support
Browse files Browse the repository at this point in the history
Remove WebP support (mastodon#11589)
  • Loading branch information
abcang authored Aug 27, 2020
2 parents 50b9aa3 + 1ba9ad5 commit 6d170f2
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/javascript/mastodon/utils/resize_image.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const loadImage = inputFile => new Promise((resolve, reject) => {
});

const getOrientation = (img, type = 'image/png') => new Promise(resolve => {
if (!['image/jpeg', 'image/webp'].includes(type)) {
if (type !== 'image/jpeg') {
resolve(1);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion app/models/concerns/account_avatar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module AccountAvatar
extend ActiveSupport::Concern

IMAGE_MIME_TYPES = ['image/jpeg', 'image/png', 'image/gif', 'image/webp'].freeze
IMAGE_MIME_TYPES = ['image/jpeg', 'image/png', 'image/gif'].freeze
LIMIT = 2.megabytes

class_methods do
Expand Down
2 changes: 1 addition & 1 deletion app/models/concerns/account_header.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module AccountHeader
extend ActiveSupport::Concern

IMAGE_MIME_TYPES = ['image/jpeg', 'image/png', 'image/gif', 'image/webp'].freeze
IMAGE_MIME_TYPES = ['image/jpeg', 'image/png', 'image/gif'].freeze
LIMIT = 2.megabytes
MAX_PIXELS = 750_000 # 1500x500px

Expand Down
2 changes: 1 addition & 1 deletion app/models/custom_emoji.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class CustomEmoji < ApplicationRecord
:(#{SHORTCODE_RE_FRAGMENT}):
(?=[^[:alnum:]:]|$)/x

IMAGE_MIME_TYPES = %w(image/png image/gif image/webp).freeze
IMAGE_MIME_TYPES = %w(image/png image/gif).freeze

has_one :local_counterpart, -> { where(domain: nil) }, class_name: 'CustomEmoji', primary_key: :shortcode, foreign_key: :shortcode

Expand Down
4 changes: 2 additions & 2 deletions app/models/media_attachment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ class MediaAttachment < ApplicationRecord

enum type: [:image, :gifv, :video, :unknown, :audio]

IMAGE_FILE_EXTENSIONS = ['.jpg', '.jpeg', '.png', '.gif', '.webp'].freeze
IMAGE_FILE_EXTENSIONS = ['.jpg', '.jpeg', '.png', '.gif'].freeze
VIDEO_FILE_EXTENSIONS = ['.webm', '.mp4', '.m4v', '.mov'].freeze
AUDIO_FILE_EXTENSIONS = ['.ogg', '.oga', '.mp3', '.wav', '.flac', '.opus'].freeze

IMAGE_MIME_TYPES = ['image/jpeg', 'image/png', 'image/gif', 'image/webp'].freeze
IMAGE_MIME_TYPES = ['image/jpeg', 'image/png', 'image/gif'].freeze
VIDEO_MIME_TYPES = ['video/webm', 'video/mp4', 'video/quicktime', 'video/ogg'].freeze
VIDEO_CONVERTIBLE_MIME_TYPES = ['video/webm', 'video/quicktime'].freeze
AUDIO_MIME_TYPES = ['audio/wave', 'audio/wav', 'audio/x-wav', 'audio/x-pn-wave', 'audio/ogg', 'audio/mpeg', 'audio/mp3', 'audio/webm', 'audio/flac'].freeze
Expand Down
2 changes: 1 addition & 1 deletion app/models/preview_card.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#

class PreviewCard < ApplicationRecord
IMAGE_MIME_TYPES = ['image/jpeg', 'image/png', 'image/gif', 'image/webp'].freeze
IMAGE_MIME_TYPES = ['image/jpeg', 'image/png', 'image/gif'].freeze
LIMIT = 1.megabytes

self.inheritance_column = false
Expand Down

0 comments on commit 6d170f2

Please sign in to comment.