Module: Hydra::Works::Derivatives
- Extended by:
- ActiveSupport::Concern
- Includes:
- Derivatives
- Defined in:
- lib/hydra/works/models/concerns/file_set/derivatives.rb
Instance Method Summary collapse
-
#create_derivatives ⇒ Object
Note, these derivatives are being fetched from Fedora, so there may be more network traffic than necessary.
Instance Method Details
#create_derivatives ⇒ Object
Note, these derivatives are being fetched from Fedora, so there may be more network traffic than necessary. If you want to avoid this, set up a source_file_service that fetches the files locally, as is done in CurationConcerns.
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/hydra/works/models/concerns/file_set/derivatives.rb', line 14 def create_derivatives case original_file.mime_type when *self.class.pdf_mime_types Hydra::Derivatives::PdfDerivatives.create(self, source: :original_file, outputs: [{ label: :thumbnail, format: 'jpg', size: '338x493', object: self }]) when *self.class.office_document_mime_types Hydra::Derivatives::DocumentDerivatives.create(self, source: :original_file, outputs: [{ label: :thumbnail, format: 'jpg', size: '200x150>', object: self }]) when *self.class.video_mime_types Hydra::Derivatives::VideoDerivatives.create(self, source: :original_file, outputs: [{ label: :thumbnail, format: 'jpg', object: self }]) when *self.class.image_mime_types Hydra::Derivatives::ImageDerivatives.create(self, source: :original_file, outputs: [{ label: :thumbnail, format: 'jpg', size: '200x150>', object: self }]) end end |