Sha256: dba3d5705ae415864f36dca4f5b918e7e984505328eccfc2598d4f3077d6d2a2

Contents?: true

Size: 479 Bytes

Versions: 4

Compression:

Stored size: 479 Bytes

Contents

#!/usr/bin/ruby

require 'vips'

file = File.open ARGV[0], "rb"
source = Vips::SourceCustom.new
source.on_read { |length| file.read length }
# this method is optional
# source.on_seek { |offset, whence| file.seek(offset, whence) }

dest = File.open ARGV[1], "wb"
target = Vips::TargetCustom.new
target.on_write { |chunk| dest.write(chunk) }
target.on_finish { dest.close }

image = Vips::Image.new_from_source source, "", access: :sequential
image.write_to_target target, ".png"

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
vips-8.11.3 example/connection.rb
vips-8.10.5 example/connection.rb
vips-8.9.1 example/connection.rb
ruby-vips-2.0.17 example/connection.rb