Commit 8925ef9ab8c32d0abdc9c191564e9c8d4fb66ed0
1 parent
f231e19b
Exists in
master
and in
11 other branches
rails4: Select RMagick processor for attachment_fu
Showing
5 changed files
with
11 additions
and
6 deletions
Show diff stats
app/models/image.rb
| ... | ... | @@ -6,8 +6,8 @@ class Image < ActiveRecord::Base |
| 6 | 6 | |
| 7 | 7 | sanitize_filename |
| 8 | 8 | |
| 9 | - has_attachment :content_type => :image, | |
| 10 | - :storage => :file_system, | |
| 9 | + has_attachment :content_type => :image, | |
| 10 | + :storage => :file_system, | |
| 11 | 11 | :path_prefix => 'public/image_uploads', |
| 12 | 12 | :resize_to => '800x600>', |
| 13 | 13 | :thumbnails => { :big => '150x150', |
| ... | ... | @@ -15,7 +15,8 @@ class Image < ActiveRecord::Base |
| 15 | 15 | :portrait => '64x64', |
| 16 | 16 | :minor => '50x50>', |
| 17 | 17 | :icon => '20x20!' }, |
| 18 | - :max_size => 5.megabytes # remember to update validate message below | |
| 18 | + :max_size => 5.megabytes, # remember to update validate message below | |
| 19 | + processor: 'Rmagick' | |
| 19 | 20 | |
| 20 | 21 | validates_attachment :size => N_("{fn} of uploaded file was larger than the maximum size of 5.0 MB").fix_i18n |
| 21 | 22 | ... | ... |
app/models/reported_image.rb
app/models/thumbnail.rb
app/models/uploaded_file.rb
| ... | ... | @@ -63,7 +63,8 @@ class UploadedFile < Article |
| 63 | 63 | has_attachment :storage => :file_system, |
| 64 | 64 | :thumbnails => { :icon => [24,24], :bigicon => [50,50], :thumb => '130x130>', :slideshow => '320x240>', :display => '640X480>' }, |
| 65 | 65 | :thumbnail_class => Thumbnail, |
| 66 | - :max_size => self.max_size | |
| 66 | + :max_size => self.max_size, | |
| 67 | + processor: 'Rmagick' | |
| 67 | 68 | |
| 68 | 69 | validates_attachment :size => N_("{fn} of uploaded file was larger than the maximum size of %{size}").sub('%{size}', self.max_size.to_humanreadable).fix_i18n |
| 69 | 70 | ... | ... |