Class: Hydra::Derivatives::Image

Inherits:
Processor show all
Defined in:
lib/hydra/derivatives/image.rb

Instance Attribute Summary

Attributes inherited from Processor

#directives, #object, #source_name

Instance Method Summary collapse

Methods inherited from Processor

#initialize, #output_datastream, #output_datastream_id, #source_datastream

Constructor Details

This class inherits a constructor from Hydra::Derivatives::Processor

Instance Method Details

#processObject



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/hydra/derivatives/image.rb', line 4

def process
  directives.each do |name, args| 
    size = args
    output_datastream_name = output_datastream_id(name)
    if args.kind_of? Hash
      size = args[:size]
      output_datastream_name = args[:datastream] if args[:datastream]
    end
    create_resized_image(output_datastream_name, size, new_mime_type)
  end
end