Commit 08d9b749 by Jon Yurek

Added [0] to src path for getting the first page of multipage documents. Changed…

Added [0] to src path for getting the first page of multipage documents. Changed -scale to -resize in thumbnailer.
parent a1adaf31
......@@ -43,7 +43,7 @@ module Paperclip
command = <<-end_command
#{ Paperclip.path_for_command('convert') }
"#{ File.expand_path(src.path) }"
"#{ File.expand_path(src.path) }[0]"
#{ transformation_command }
"#{ File.expand_path(dst.path) }"
end_command
......@@ -60,7 +60,7 @@ module Paperclip
# into the thumbnail.
def transformation_command
scale, crop = @current_geometry.transformation_to(@target_geometry, crop?)
trans = "-scale \"#{scale}\""
trans = "-resize \"#{scale}\""
trans << " -crop \"#{crop}\" +repage" if crop
trans << " #{convert_options}" if convert_options
trans
......
......@@ -93,7 +93,7 @@ class ThumbnailTest < Test::Unit::TestCase
should "send the right command to convert when sent #make" do
@thumb.expects(:system).with do |arg|
arg.match %r{convert\s+"#{File.expand_path(@thumb.file.path)}"\s+-scale\s+\"x50\"\s+-crop\s+\"100x50\+114\+0\"\s+\+repage\s+".*?"}
arg.match %r{convert\s+"#{File.expand_path(@thumb.file.path)}\[0\]"\s+-resize\s+\"x50\"\s+-crop\s+\"100x50\+114\+0\"\s+\+repage\s+".*?"}
end
@thumb.make
end
......
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