Commit c40d947e by Jon Yurek

Changed ENOENT to NotIdentifiedByImageMagick, which should work with whiny_thumbnails

parent 1b099cda
...@@ -65,6 +65,9 @@ module Paperclip ...@@ -65,6 +65,9 @@ module Paperclip
class PaperclipError < StandardError #:nodoc: class PaperclipError < StandardError #:nodoc:
end end
class NotIdentifiedByImageMagickError < PaperclipError #:nodoc:
end
module ClassMethods module ClassMethods
# +has_attached_file+ gives the class it is called on an attribute that maps to a file. This # +has_attached_file+ gives the class it is called on an attribute that maps to a file. This
# is typically a file stored somewhere on the filesystem and has been uploaded by a user. # is typically a file stored somewhere on the filesystem and has been uploaded by a user.
......
...@@ -189,10 +189,8 @@ module Paperclip ...@@ -189,10 +189,8 @@ module Paperclip
dimensions, dimensions,
format, format,
@whiny_thumnails) @whiny_thumnails)
rescue Errno::ENOENT => e
@errors << "could not be processed because the file does not exist."
rescue PaperclipError => e rescue PaperclipError => e
@errors << e.message @errors << e.message if @whiny_thumbnails
end end
end end
end end
......
...@@ -18,7 +18,7 @@ module Paperclip ...@@ -18,7 +18,7 @@ module Paperclip
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"
parse(`#{Paperclip.path_for_command('identify')} "#{file}"`) || parse(`#{Paperclip.path_for_command('identify')} "#{file}"`) ||
raise(Errno::ENOENT, file) raise NotIdentifiedByImageMagickError, "#{file} is not recognized by the 'identify' command."
end end
# Parses a "WxH" formatted string, where W is the width and H is the height. # Parses a "WxH" formatted string, where W is the width and H is the height.
......
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