module Hydra::Works::Derivatives
Public Instance Methods
create_derivatives()
click to toggle source
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.
# 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