public
Description: Paperclip File Management Plugin
Homepage: http://www.thoughtbot.com/projects/paperclip
Clone URL: git://github.com/thoughtbot/paperclip.git
Changed ENOENT to NotIdentifiedByImageMagick, which should work with 
whiny_thumbnails
jyurek (author)
Wed May 07 10:36:31 -0700 2008
commit  c40d947e98fbb11c322a4db875ed4accd16c3947
tree    0b9a2030c4961882e313f0c8b958b7e015bdd2f9
parent  1b099cda9e7ca67715dee7023ea3f9f7ab489dc1
...
65
66
67
 
 
 
68
69
70
...
65
66
67
68
69
70
71
72
73
0
@@ -65,6 +65,9 @@ module Paperclip
0
   class PaperclipError < StandardError #:nodoc:
0
   end
0
 
0
+ class NotIdentifiedByImageMagickError < PaperclipError #:nodoc:
0
+ end
0
+
0
   module ClassMethods
0
     # +has_attached_file+ gives the class it is called on an attribute that maps to a file. This
0
     # is typically a file stored somewhere on the filesystem and has been uploaded by a user.
...
189
190
191
192
193
194
195
 
196
197
198
...
189
190
191
 
 
192
 
193
194
195
196
0
@@ -189,10 +189,8 @@ module Paperclip
0
                                                    dimensions,
0
                                                    format,
0
                                                    @whiny_thumnails)
0
- rescue Errno::ENOENT => e
0
- @errors << "could not be processed because the file does not exist."
0
         rescue PaperclipError => e
0
- @errors << e.message
0
+ @errors << e.message if @whiny_thumbnails
0
         end
0
       end
0
     end
...
18
19
20
21
 
22
23
24
...
18
19
20
 
21
22
23
24
0
@@ -18,7 +18,7 @@ module Paperclip
0
     def self.from_file file
0
       file = file.path if file.respond_to? "path"
0
       parse(`#{Paperclip.path_for_command('identify')} "#{file}"`) ||
0
- raise(Errno::ENOENT, file)
0
+ raise NotIdentifiedByImageMagickError, "#{file} is not recognized by the 'identify' command."
0
     end
0
 
0
     # Parses a "WxH" formatted string, where W is the width and H is the height.

Comments

    No one has commented yet.