Add color extraction for audio thumbnails (#14209)
This commit is contained in:
parent
2f2ab48b75
commit
99f3a55540
16 changed files with 284 additions and 243 deletions
14
lib/paperclip/transcoder_extensions.rb
Normal file
14
lib/paperclip/transcoder_extensions.rb
Normal file
|
@ -0,0 +1,14 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Paperclip
|
||||
module TranscoderExtensions
|
||||
# Prevent the transcoder from modifying our meta hash
|
||||
def initialize(file, options = {}, attachment = nil)
|
||||
meta_value = attachment&.instance_read(:meta)
|
||||
super
|
||||
attachment&.instance_write(:meta, meta_value)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Paperclip::Transcoder.prepend(Paperclip::TranscoderExtensions)
|
Loading…
Add table
Add a link
Reference in a new issue