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

handle nil dimensions

parent cc20fee5
No related branches found
No related tags found
No related merge requests found
......@@ -43,7 +43,7 @@ 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] && dimensions[1] <= blob_size[1]
crop_dimensions_are_valid = 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