Commit 91c23385 by yar Committed by Jon Yurek

post-processing can be switched on and off at any time

parent 338fc353
...@@ -25,6 +25,7 @@ module Paperclip ...@@ -25,6 +25,7 @@ module Paperclip
end end
attr_reader :name, :instance, :default_style, :convert_options, :queued_for_write, :whiny, :options attr_reader :name, :instance, :default_style, :convert_options, :queued_for_write, :whiny, :options
attr_accessor :post_processing
# Creates an Attachment object. +name+ is the name of the attachment, # Creates an Attachment object. +name+ is the name of the attachment,
# +instance+ is the ActiveRecord object instance it's attached to, and # +instance+ is the ActiveRecord object instance it's attached to, and
...@@ -53,6 +54,7 @@ module Paperclip ...@@ -53,6 +54,7 @@ module Paperclip
@convert_options = options[:convert_options] @convert_options = options[:convert_options]
@processors = options[:processors] @processors = options[:processors]
@options = options @options = options
@post_processing = true
@queued_for_delete = [] @queued_for_delete = []
@queued_for_write = {} @queued_for_write = {}
@errors = {} @errors = {}
...@@ -105,7 +107,7 @@ module Paperclip ...@@ -105,7 +107,7 @@ module Paperclip
@dirty = true @dirty = true
post_process post_process if @post_processing
# Reset the file size if the original file was reprocessed. # Reset the file size if the original file was reprocessed.
instance_write(:file_size, @queued_for_write[:original].size.to_i) instance_write(:file_size, @queued_for_write[:original].size.to_i)
......
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