Module: Hydra::Derivatives::ImageService

Defined in:
lib/hydra/derivatives/services/image_service.rb

Class Method Summary collapse

Class Method Details

.default_processorObject



4
5
6
# File 'lib/hydra/derivatives/services/image_service.rb', line 4

def self.default_processor
  :imagemagick
end

.processorObject



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/hydra/derivatives/services/image_service.rb', line 8

def self.processor
  case ENV['IMAGE_PROCESSOR']
  when 'imagemagick'
    Hydra::Derivatives::Logger.debug('[ImageProcessor] Using ImageMagick as image processor')
    :imagemagick
  when 'graphicsmagick'
    Hydra::Derivatives::Logger.debug('[ImageProcessor] Using GraphicsMagick as image processor')
    :graphicsmagick
  else
    Hydra::Derivatives::Logger.debug("[ImageProcessor] The environment variable IMAGE_PROCESSOR should be set to either 'imagemagick' or 'graphicsmagick'. It is currently set to: #{ENV['IMAGE_PROCESSOR']}. Defaulting to using #{default_processor}")
    default_processor
  end
end