Commit a6095d0c by Damian Janowski Committed by Jon Yurek

Make Thumbnail work without ActiveSupport.

(cherry picked from commit 43946120a6231be06d59c8f28969946c213e6872)
parent b8c85cdf
...@@ -33,7 +33,7 @@ module Paperclip ...@@ -33,7 +33,7 @@ module Paperclip
# Returns true if the image is meant to make use of additional convert options. # Returns true if the image is meant to make use of additional convert options.
def convert_options? def convert_options?
not @convert_options.blank? !@convert_options.nil? && !@convert_options.empty?
end end
# Performs the conversion of the +file+ into a thumbnail. Returns the Tempfile # Performs the conversion of the +file+ into a thumbnail. Returns the Tempfile
...@@ -64,7 +64,7 @@ module Paperclip ...@@ -64,7 +64,7 @@ module Paperclip
def transformation_command def transformation_command
scale, crop = @current_geometry.transformation_to(@target_geometry, crop?) scale, crop = @current_geometry.transformation_to(@target_geometry, crop?)
trans = "" trans = ""
trans << " -resize \"#{scale}\"" unless scale.blank? trans << " -resize \"#{scale}\"" unless scale.nil? || scale.empty?
trans << " -crop \"#{crop}\" +repage" if crop trans << " -crop \"#{crop}\" +repage" if crop
trans << " #{convert_options}" if convert_options? trans << " #{convert_options}" if convert_options?
trans trans
......
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