Commit 80d699ca by Mike Richards Committed by Jon Yurek

Added conditional for default scaling of images.

(cherry picked from commit 6a0ff6f0f76a92a25c9cbbc315d3d7d11d1d7720)
parent 2826cdb7
......@@ -63,7 +63,8 @@ module Paperclip
# into the thumbnail.
def transformation_command
scale, crop = @current_geometry.transformation_to(@target_geometry, crop?)
trans = "-resize \"#{scale}\""
trans = ""
trans << " -resize \"#{scale}\"" unless scale.blank?
trans << " -crop \"#{crop}\" +repage" if crop
trans << " #{convert_options}" if convert_options?
trans
......
......@@ -178,6 +178,18 @@ class ThumbnailTest < Test::Unit::TestCase
end
end
end
context "being thumbnailed with a blank geometry string" do
setup do
@thumb = Paperclip::Thumbnail.new(@file,
:geometry => "",
:convert_options => "-gravity center -crop \"300x300+0-0\"")
end
should "not get resized by default" do
assert_no_match(/-resize/, @thumb.transformation_command)
end
end
end
context "A multipage PDF" do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment