views:

162

answers:

0

I'm attempting to load a ICM color profile file that is stored with the main ImageMagick config files (colors.xml, etc.) using RMagick. I want to make sure that I always provide the correct path to the file across deployments using slightly different ImageMagick setups and/or versions. Is there a way to find to get this location from ImageMagick (something like Magick-config)?

This is what I have now, but it seems brittle:

MAGICK_PREFIX  = `Magick-config --prefix`.strip!
MAGICK_VERSION = `Magick-config --version`.strip!.split(/\s/).first

RGB_COLOR_PROFILE = "#{MAGICK_PREFIX}/share/ImageMagick-#{MAGICK_VERSION}/config/sRGB.icm"