This commit is contained in:
anastasiya.kachalova
2024-12-11 15:57:47 +03:00
parent 6043fc3781
commit 2b4d057c5d

View File

@@ -155,19 +155,7 @@ module Paperclip
@dirty = true
if post_processing && valid?
post_process
# Reset the file size and image sizes if the original file was reprocessed.
if queued_for_write.dig(:original) && instance_read(:file_size) != queued_for_write[:original].size.to_i
instance_write(:file_size, queued_for_write[:original].size.to_i)
sizes = FastImage.size(queued_for_write[:original])
if sizes && sizes[0] && sizes[1]
instance_write(:width, sizes[0])
instance_write(:height, sizes[1])
end
end
end
post_process if post_processing && valid?
updater = :"#{name}_file_name_will_change!"
instance.send updater if instance.respond_to? updater