Module: Hydra::Derivatives
- Extended by:
- ActiveSupport::Autoload, ActiveSupport::Concern
- Defined in:
- lib/hydra/derivatives.rb,
lib/hydra/derivatives/audio.rb,
lib/hydra/derivatives/image.rb,
lib/hydra/derivatives/video.rb,
lib/hydra/derivatives/config.rb,
lib/hydra/derivatives/ffmpeg.rb,
lib/hydra/derivatives/logger.rb,
lib/hydra/derivatives/document.rb,
lib/hydra/derivatives/processor.rb,
lib/hydra/derivatives/jpeg2k_image.rb,
lib/hydra/derivatives/extract_metadata.rb,
lib/hydra/derivatives/shell_based_processor.rb
Defined Under Namespace
Modules: ClassMethods, ExtractMetadata, Ffmpeg, ShellBasedProcessor Classes: Audio, Config, Document, Image, Jpeg2kImage, Logger, Processor, Video
Class Method Summary collapse
Instance Method Summary collapse
-
#create_derivatives ⇒ Object
Runs all of the transformations immediately.
-
#transform_datastream(datastream_name, transform_directives, opts = {}) ⇒ Object
Create derivatives from a datastream according to transformation directives.
Class Method Details
.config ⇒ Object
21 22 23 |
# File 'lib/hydra/derivatives.rb', line 21 def self.config @config ||= reset_config! end |
.reset_config! ⇒ Object
25 26 27 |
# File 'lib/hydra/derivatives.rb', line 25 def self.reset_config! @config = Config.new end |
Instance Method Details
#create_derivatives ⇒ Object
Runs all of the transformations immediately. You may want to run this job in the background as it may take a long time.
47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/hydra/derivatives.rb', line 47 def create_derivatives if transformation_schemes.present? transformation_schemes.each do |transform_scheme| if transform_scheme.instance_of?(Proc) transform_scheme.call(self) else send(transform_scheme) end end else logger.warn "`create_derivatives' was called on an instance of #{self.class}, but no derivatives have been requested" end end |
#transform_datastream(datastream_name, transform_directives, opts = {}) ⇒ Object
Create derivatives from a datastream according to transformation directives
79 80 81 82 |
# File 'lib/hydra/derivatives.rb', line 79 def transform_datastream(datastream_name, transform_directives, opts={}) processor = opts[:processor] ? opts[:processor] : :image "Hydra::Derivatives::#{processor.to_s.classify}".constantize.new(self, datastream_name, transform_directives).process end |