Skip to content
Snippets Groups Projects
Unverified Commit 6b17ef00 authored by Sébastien Gaya's avatar Sébastien Gaya
Browse files

fix variant_service

parent 5bb59814
No related branches found
Tags v2.1.0
No related merge requests found
......@@ -55,7 +55,10 @@ class VariantService
end
dimensions.map! { |dimension| dimension * params[:scale].to_i if dimension.is_a?(Integer) } if params[:scale].present?
# If one of the dimensions is greater than the original one, no crop and resize to limit
crop_dimensions_are_valid = dimensions.all?(&:present?) && dimensions[0] <= blob_size[0].to_i && dimensions[1] <= blob_size[1].to_i
crop_dimensions_are_valid = dimensions.size == 2 &&
dimensions.all?(&:present?) &&
dimensions[0] <= blob_size[0].to_i &&
dimensions[1] <= blob_size[1].to_i
# Resize and/or crop unless original size
unless dimensions == blob_size
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment