app/models/refinery/image.rb in refinerycms-images-2.0.1 vs app/models/refinery/image.rb in refinerycms-images-2.0.2
- old
+ new
@@ -48,10 +48,10 @@
# Intelligently works out dimensions for a thumbnail of this image based on the Dragonfly geometry string.
def thumbnail_dimensions(geometry)
geometry = geometry.to_s
width = original_width = self.image_width.to_f
height = original_height = self.image_height.to_f
- geometry_width, geometry_height = geometry.to_s.split(%r{\#{1,2}|\+|>|!|x}im)[0..1].map(&:to_f)
+ geometry_width, geometry_height = geometry.split(%r{\#{1,2}|\+|>|!|x}im)[0..1].map(&:to_f)
if (original_width * original_height > 0) && geometry =~ ::Dragonfly::ImageMagick::Processor::THUMB_GEOMETRY
if geometry =~ ::Dragonfly::ImageMagick::Processor::RESIZE_GEOMETRY
if geometry !~ %r{\d+x\d+>} || (geometry =~ %r{\d+x\d+>} && (width > geometry_width.to_f || height > geometry_height.to_f))
# Try scaling with width factor first. (wf = width factor)
wf_width = (original_width * (geometry_width / width)).ceil