Sha256: beb1c899d375fe5119c5f074c9dbf2e522f2c029f0f9b04b9a8b12c1a830564c
Contents?: true
Size: 794 Bytes
Versions: 16
Compression:
Stored size: 794 Bytes
Contents
description 'ImageMagick' dependencies 'utils/shell', 'utils/semaphore' class ImageMagick < Shell def self.semaphore @semaphore ||= Semaphore.new end def initialize if (`gm -version` rescue '').include?('GraphicsMagick') @prefix = 'gm' elsif !(`convert -version` rescue '').include?('ImageMagick') raise 'GraphicsMagick or ImageMagick not found' end end def label(text) convert('-pointsize', 16, '-background', 'transparent', "label:#{text}", 'PNG:-').run rescue nil end def method_missing(name, *args, &block) if %w(convert identify).include?(name.to_s) super(@prefix, name, *args, &block) else super end end def self.run(cmd, data) semaphore.synchronize { super } end end Olelo::ImageMagick = ImageMagick
Version data entries
16 entries across 16 versions & 1 rubygems