Commit cbba34c2 by Jon Yurek

Raise an error if we try to identify a file with no name

parent b39a77e9
...@@ -15,6 +15,7 @@ module Paperclip ...@@ -15,6 +15,7 @@ module Paperclip
# File or path. # File or path.
def self.from_file file def self.from_file file
file = file.path if file.respond_to? "path" file = file.path if file.respond_to? "path"
raise(Paperclip::NotIdentifiedByImageMagickError.new("Cannot find the geometry of a file with a blank name")) if file.blank?
geometry = begin geometry = begin
Paperclip.run("identify", "-format %wx%h :file", :file => "#{file}[0]") Paperclip.run("identify", "-format %wx%h :file", :file => "#{file}[0]")
rescue Cocaine::ExitStatusError rescue Cocaine::ExitStatusError
......
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