From 15955acde82b29ad712df8b4f11970233695774d Mon Sep 17 00:00:00 2001 From: Clemens Kofler Date: Thu, 10 Jul 2008 13:57:15 +0200 Subject: [PATCH] slight refactoring in geometry.rb to - only calculate transformation ratio if image needs to be cropped --- lib/paperclip/geometry.rb | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/lib/paperclip/geometry.rb b/lib/paperclip/geometry.rb index 05b66f1..003028b 100644 --- a/lib/paperclip/geometry.rb +++ b/lib/paperclip/geometry.rb @@ -76,9 +76,8 @@ module Paperclip # overhanging image would be cropped. Useful for square thumbnail images. The cropping # is weighted at the center of the Geometry. def transformation_to dst, crop = false - ratio = Geometry.new( dst.width / self.width, dst.height / self.height ) - if crop + ratio = Geometry.new( dst.width / self.width, dst.height / self.height ) scale_geometry, scale = scaling(dst, ratio) crop_geometry = cropping(dst, ratio, scale) else -- 1.5.2.4