Skip to content

Commit

Permalink
Raise an error if we try to identify a file with no name
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Yurek committed Jun 9, 2011
1 parent b39a77e commit cbba34c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/paperclip/geometry.rb
Expand Up @@ -15,6 +15,7 @@ def initialize width = nil, height = nil, modifier = nil
# File or path.
def self.from_file file
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
Paperclip.run("identify", "-format %wx%h :file", :file => "#{file}[0]")
rescue Cocaine::ExitStatusError
Expand Down

0 comments on commit cbba34c

Please sign in to comment.