Sha256: 80fb3100233d00b6f0f5fb92fea0a4ecfa7be3396a7e95ad9e51e37d38cb130e

Contents?: true

Size: 711 Bytes

Versions: 12

Compression:

Stored size: 711 Bytes

Contents

#!/usr/bin/ruby

require "vips"

image = Vips::Image.black 1, 100000
image.set_progress true

def progress_to_s(name, progress)
  puts "#{name}:"
  puts "    progress.run = #{progress[:run]}"
  puts "    progress.eta = #{progress[:eta]}"
  puts "    progress.tpels = #{progress[:tpels]}"
  puts "    progress.npels = #{progress[:npels]}"
  puts "    progress.percent = #{progress[:percent]}"
end

image.signal_connect :preeval do |progress|
  progress_to_s("preeval", progress)
end

image.signal_connect :eval do |progress|
  progress_to_s("eval", progress)
  image.set_kill(true) if progress[:percent] > 50
end

image.signal_connect :posteval do |progress|
  progress_to_s("posteval", progress)
end

image.avg

Version data entries

12 entries across 12 versions & 3 rubygems

Version Path
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/ruby-vips-2.2.1/example/progress.rb
ruby-vips-2.2.2 example/progress.rb
ruby-vips-2.2.1 example/progress.rb
vips-8.15.1 example/progress.rb
ruby-vips-2.2.0 example/progress.rb
vips-8.12.2 example/progress.rb
vips-8.12.1 example/progress.rb
ruby-vips-2.1.4 example/progress.rb
ruby-vips-2.1.3 example/progress.rb
ruby-vips-2.1.2 example/progress.rb
ruby-vips-2.1.1 example/progress.rb
ruby-vips-2.1.0 example/progress.rb