class Poleica::Converters::GraphicsMagick

The GraphicsMagick converter, use the ‘gm’ command to convert images and documents

Constants

COMPATIBLE_TYPES
DEFAULT_MEASURE

Attributes

polei[R]

Public Class Methods

new(polei) click to toggle source
# File lib/poleica/converters/graphics_magick/graphics_magick.rb, line 17
def initialize(polei)
  @polei = polei
end

Public Instance Methods

to_png(options = {}) click to toggle source
# File lib/poleica/converters/graphics_magick/graphics_magick.rb, line 21
def to_png(options = {})
  opts_gen = ConvertOptionsGenerator.new(polei, options)
  exec_with_timeout(bin_path, opts_gen.generate)
  expected_file_path = opts_gen.output_path
  File.exist?(expected_file_path) ? expected_file_path : nil
end
to_thumbnail(options = {}) click to toggle source
# File lib/poleica/converters/graphics_magick/graphics_magick.rb, line 28
def to_thumbnail(options = {})
  opts_gen = ThumbnailOptionsGenerator.new(polei, options)
  exec_with_timeout(bin_path, opts_gen.generate)
  expected_file_path = opts_gen.output_path
  File.exist?(expected_file_path) ? expected_file_path : nil
end