Skip to content

Commit

Permalink
Use resize_to_cover instead of resize_to_fit (#618)
Browse files Browse the repository at this point in the history
  • Loading branch information
robbevp authored Aug 10, 2024
1 parent ad5dd33 commit de73dea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions app/serializers/album_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,21 @@ def image100
return nil if object.image.blank?
return nil unless object.image.image.variable?

rails_representation_url(object.image.image.variant(resize_to_limit: [100, 100]), **scope)
rails_representation_url(object.image.image.variant(resize_to_cover: [100, 100]), **scope)
end

def image250
return nil if object.image.blank?
return nil unless object.image.image.variable?

rails_representation_url(object.image.image.variant(resize_to_limit: [250, 250]), **scope)
rails_representation_url(object.image.image.variant(resize_to_cover: [250, 250]), **scope)
end

def image500
return nil if object.image.blank?
return nil unless object.image.image.variable?

rails_representation_url(object.image.image.variant(resize_to_limit: [500, 500]), **scope)
rails_representation_url(object.image.image.variant(resize_to_cover: [500, 500]), **scope)
end

def image_type
Expand Down
6 changes: 3 additions & 3 deletions app/serializers/artist_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@ def image100
return nil if object.image.blank?
return nil unless object.image.image.variable?

rails_representation_url(object.image.image.variant(resize_to_limit: [100, 100]), **scope)
rails_representation_url(object.image.image.variant(resize_to_cover: [100, 100]), **scope)
end

def image250
return nil if object.image.blank?
return nil unless object.image.image.variable?

rails_representation_url(object.image.image.variant(resize_to_limit: [250, 250]), **scope)
rails_representation_url(object.image.image.variant(resize_to_cover: [250, 250]), **scope)
end

def image500
return nil if object.image.blank?
return nil unless object.image.image.variable?

rails_representation_url(object.image.image.variant(resize_to_limit: [500, 500]), **scope)
rails_representation_url(object.image.image.variant(resize_to_cover: [500, 500]), **scope)
end

def image_type
Expand Down

0 comments on commit de73dea

Please sign in to comment.