mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-02 15:34:15 +08:00
Previous to this change when we used to specify format it could get an image in the incorrect format. Also... allows image magick to decode svg --- There remains a bug where the crop / resize information is not stored in optimized images this means that sometimes when asking for a cropped image you may get a resized one.
17 lines
624 B
Ruby
17 lines
624 B
Ruby
# frozen_string_literal: true
|
|
class OptimizedImageFormatIndex < ActiveRecord::Migration[7.2]
|
|
def up
|
|
remove_index :optimized_images, name: "index_optimized_images_on_upload_id_and_width_and_height"
|
|
add_index :optimized_images,
|
|
%i[upload_id width height extension],
|
|
name: "index_optimized_images_unique",
|
|
unique: true
|
|
end
|
|
|
|
def down
|
|
remove_index :optimized_images, name: "index_optimized_images_unique"
|
|
add_index :optimized_images,
|
|
%i[upload_id width height],
|
|
name: "index_optimized_images_on_upload_id_and_width_and_height"
|
|
end
|
|
end
|