Sha256: df0742106b8af1fbb0be6b053b7ef9d46eadbda1a2364339a533b6ba1c6e52e7

Contents?: true

Size: 349 Bytes

Versions: 18

Compression:

Stored size: 349 Bytes

Contents

require 'image_voodoo'

# reads in the image at ARGV[0], transforms it into a 32-pixel thumbnail in-memory,
# and writes it back out as a png to the file specified by ARGV[1]
ImageVoodoo.with_bytes(File.read(ARGV[0])) do |img|
  img.thumbnail(32) do |img2|
    File.open(ARGV[1], 'w') do |file|
      file.write(img2.bytes('png'))
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
image_voodoo-0.9.0 samples/in_memory.rb
image_voodoo-0.8.9 samples/in_memory.rb
image_voodoo-0.8.8 samples/in-memory.rb
image_voodoo-0.8.7 samples/in-memory.rb
image_voodoo-0.8.6 samples/in-memory.rb
image_voodoo-0.8.5 samples/in-memory.rb
image_voodoo-0.8.4 samples/in-memory.rb
image_voodoo-0.8.3 samples/in-memory.rb
image_voodoo-0.8.2 samples/in-memory.rb
image_voodoo-0.8.1 samples/in-memory.rb
image_voodoo-0.8.0 samples/in-memory.rb
image_voodoo-0.7 samples/in-memory.rb
image_voodoo-0.6 samples/in-memory.rb
image_voodoo-0.4 samples/in-memory.rb
image_voodoo-0.2 samples/in-memory.rb
image_voodoo-0.1 samples/in-memory.rb
image_voodoo-0.3 samples/in-memory.rb
image_voodoo-0.5 samples/in-memory.rb