File: example3.rb

package info (click to toggle)
ruby-vips 2.1.4-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 5,164 kB
  • sloc: ruby: 3,530; makefile: 3
file content (19 lines) | stat: -rwxr-xr-x 382 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/ruby

require "vips"

# this makes vips keep a list of all active objects
Vips.leak_set true

# disable the operation cache
# Vips::cache_set_max 0

# turn on debug logging
GLib.logger.level = Logger::DEBUG

10.times do |i|
  puts "loop #{i} ..."
  im = Vips::Image.new_from_file ARGV[0]
  im = im.embed 100, 100, 3000, 3000, extend: :mirror
  im.write_to_file "x.v"
end