Class: Magick::Image

Inherits:
Object show all
Defined in:
lib/airbrush/processors/image/rmagick.rb

Constant Summary collapse

SCT_CMYK_ICC =
File.dirname(__FILE__) + '/profiles/cmyk-profile.icc'
SCT_SRGB_ICC =
File.dirname(__FILE__) + '/profiles/srgb-profile.icc'

Instance Method Summary collapse

Instance Method Details

#ensure_rgb!Object



101
102
103
104
105
106
107
108
109
110
111
# File 'lib/airbrush/processors/image/rmagick.rb', line 101

def ensure_rgb!
  return if rgb?

  if cmyk?
    add_profile SCT_CMYK_ICC if color_profile == nil
    add_profile SCT_SRGB_ICC
    log.debug "Added sRGB profile to image"
  else
    log.warn "Non CMYK/RGB color profile encountered, please install a profile for #{colorspace} and update ensure_rgb! implementation"
  end
end