Sha256: 616ae25b4947be8f932d60a38a361efe989e12d3575e63409fbef4f864c49a95

Contents?: true

Size: 740 Bytes

Versions: 3

Compression:

Stored size: 740 Bytes

Contents

if PLATFORM == 'java'
  require File.join(File.dirname(__FILE__), '..', '..', '..','lib','RMagick')
else
  require "rubygems"
  require "RMagick"
end

class Float

	def to_threshold
		self/255 * Magick::QuantumRange
	end
end

class Magick::Image
  alias_method :old_write, :write
  
  def self.load(filename, &add)
    file = File.join(File.expand_path(File.dirname(__FILE__)), '..', '..', 'images', filename)
    self.read file, &add
  end

  def write(filename)
    engine = (PLATFORM == 'java' ? 'jruby' : 'mri')
    new_filename = filename.sub(/(\.[^\.]*)$/, '.' + engine + '\1')
    change_geometry('300x300') do |columns, rows, image|
      image.resize!(columns, rows)
    end
    old_write File.join(ARGV[0],new_filename)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rmagick4j-0.3.9-java test/eyetests/tests/new_image.rb
rmagick4j-0.3.8 test/eyetests/tests/new_image.rb
rmagick4j-0.3.7 test/eyetests/tests/new_image.rb