diff --git a/app/models/alchemy/picture.rb b/app/models/alchemy/picture.rb index 7b3e685735..837e70d686 100644 --- a/app/models/alchemy/picture.rb +++ b/app/models/alchemy/picture.rb @@ -22,8 +22,6 @@ module Alchemy class Picture < BaseRecord - THUMBNAIL_QUALITY = 90 - THUMBNAIL_SIZES = { small: "80x60", medium: "160x120", @@ -197,16 +195,14 @@ def url(options = {}) # Returns an url for the thumbnail representation of the picture # # @param [String] size - The size of the thumbnail - # @param [Integer] quality - The quality of the thumbnail # # @return [String] - def thumbnail_url(size: "160x120", quality: THUMBNAIL_QUALITY) + def thumbnail_url(size: "160x120") return if image_file.nil? url( flatten: true, format: image_file_format || "jpg", - quality: quality, size: size ) end diff --git a/app/models/concerns/alchemy/picture_thumbnails.rb b/app/models/concerns/alchemy/picture_thumbnails.rb index 16bc25f29a..ef3a234e81 100644 --- a/app/models/concerns/alchemy/picture_thumbnails.rb +++ b/app/models/concerns/alchemy/picture_thumbnails.rb @@ -84,8 +84,7 @@ def thumbnail_url_options crop_from: crop && crop_from.presence || default_crop_from&.join("x"), crop_size: crop && crop_size.presence || default_crop_size&.join("x"), flatten: true, - format: picture&.image_file_format || "jpg", - quality: Alchemy::Picture::THUMBNAIL_QUALITY + format: picture&.image_file_format || "jpg" } end diff --git a/lib/alchemy/test_support/having_picture_thumbnails_examples.rb b/lib/alchemy/test_support/having_picture_thumbnails_examples.rb index 737e3d93ae..f15af61e0a 100644 --- a/lib/alchemy/test_support/having_picture_thumbnails_examples.rb +++ b/lib/alchemy/test_support/having_picture_thumbnails_examples.rb @@ -382,7 +382,6 @@ crop_size: nil, flatten: true, format: "jpg", - quality: Alchemy::Picture::THUMBNAIL_QUALITY, size: "160x120" ) end @@ -402,7 +401,6 @@ crop_size: nil, flatten: true, format: "jpg", - quality: Alchemy::Picture::THUMBNAIL_QUALITY, size: "160x120" ) end diff --git a/spec/models/alchemy/picture_spec.rb b/spec/models/alchemy/picture_spec.rb index d3c6c91f4e..8ee9f7b6e9 100644 --- a/spec/models/alchemy/picture_spec.rb +++ b/spec/models/alchemy/picture_spec.rb @@ -335,7 +335,6 @@ module Alchemy expect(picture).to receive(:url).with( flatten: true, format: "png", - quality: Alchemy::Picture::THUMBNAIL_QUALITY, size: "160x120" ) thumbnail_url @@ -348,26 +347,11 @@ module Alchemy expect(picture).to receive(:url).with( flatten: true, format: "png", - quality: Alchemy::Picture::THUMBNAIL_QUALITY, size: "800x600" ) thumbnail_url end end - - context "with quality given" do - subject(:thumbnail_url) { picture.thumbnail_url(quality: 50) } - - it "returns the url to the thumbnail" do - expect(picture).to receive(:url).with( - flatten: true, - format: "png", - quality: 50, - size: "160x120" - ) - thumbnail_url - end - end end end