From 88e737c378c1e53e162b48527a94eebe0221e1dd Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Mon, 1 Nov 2021 16:39:14 +0000 Subject: [PATCH 01/50] improve deprecated arg handling --- lib/vips/image.rb | 8 ++------ lib/vips/operation.rb | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/lib/vips/image.rb b/lib/vips/image.rb index 823e7ffb..50b1b6b5 100644 --- a/lib/vips/image.rb +++ b/lib/vips/image.rb @@ -1632,8 +1632,8 @@ def self.generate_operation introspect method_args = introspect.method_args required_output = introspect.required_output - optional_input = introspect.optional_input - optional_output = introspect.optional_output + optional_input = introspect.doc_optional_input + optional_output = introspect.doc_optional_output print "# @!method " print "self." unless introspect.member_x @@ -1654,8 +1654,6 @@ def self.generate_operation introspect puts "# @param opts [Hash] Set of options" optional_input.each do |arg_name, details| - next if (details[:flags] & ARGUMENT_DEPRECATED) != 0 - yard_name = details[:yard_name] gtype = details[:gtype] rtype = gtype_to_ruby gtype @@ -1664,8 +1662,6 @@ def self.generate_operation introspect puts "# @option opts [#{rtype}] :#{yard_name} #{blurb}" end optional_output.each do |arg_name, details| - next if (details[:flags] & ARGUMENT_DEPRECATED) != 0 - yard_name = details[:yard_name] gtype = details[:gtype] rtype = gtype_to_ruby gtype diff --git a/lib/vips/operation.rb b/lib/vips/operation.rb index 8fed370c..5b0f6fed 100644 --- a/lib/vips/operation.rb +++ b/lib/vips/operation.rb @@ -48,7 +48,8 @@ module Vips class Introspect attr_reader :name, :description, :flags, :args, :required_input, :optional_input, :required_output, :optional_output, :member_x, - :method_args, :vips_name, :destructive + :method_args, :vips_name, :destructive, :doc_optional_input, + :doc_optional_output @@introspect_cache = {} @@ -142,6 +143,8 @@ def add_yard_introspection name @flags = Vips.vips_operation_get_flags @op @member_x = nil @method_args = [] + @doc_optional_input = {} + @doc_optional_output = {} @args.each do |details| arg_name = details[:arg_name] @@ -164,6 +167,17 @@ def add_yard_introspection name end end end + + # and make the arg sets to document by filtering out deprecated args + @optional_input.each do |arg_name, details| + next if (details[:flags] & ARGUMENT_DEPRECATED) != 0 + @doc_optional_input[details[:arg_name]] = details + end + + @optional_output.each do |arg_name, details| + next if (details[:flags] & ARGUMENT_DEPRECATED) != 0 + @doc_optional_output[details[:arg_name]] = details + end end def self.get name From e705f88ed7b071ff5065ff63f4b757251a16b074 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Tue, 2 Nov 2021 16:33:55 +0000 Subject: [PATCH 02/50] add hyperbolic trig functions --- CHANGELOG.md | 1 + lib/vips/image.rb | 44 ++++++++++++++++++++++++++++++++++++++++++- lib/vips/operation.rb | 4 ++-- 3 files changed, 46 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b4947064..6caa3f21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * `write_to_buffer` tries to use the new target API, then falls back to the old buffer system [jcupitt] * don't generate yard docs for deprecated args [jcupitt] +* add hyperbolic trig functions [jcupitt] ## Version 2.1.3 (2021-8-23) diff --git a/lib/vips/image.rb b/lib/vips/image.rb index 50b1b6b5..bae9c372 100644 --- a/lib/vips/image.rb +++ b/lib/vips/image.rb @@ -634,7 +634,7 @@ def write_to_buffer format_string, **opts end if !saver.nil? - target = Vips::Target::new_to_memory + target = Vips::Target.new_to_memory Vips::Operation.call saver, [self, target], opts, option_string buffer = target.get("blob") else @@ -1450,6 +1450,48 @@ def atan math :atan end + # Return the hyperbolic sine of an image in radians. + # + # @return [Image] sine of each pixel + def sinh + math :sinh + end + + # Return the hyperbolic cosine of an image in radians. + # + # @return [Image] cosine of each pixel + def cosh + math :cosh + end + + # Return the hyperbolic tangent of an image in radians. + # + # @return [Image] tangent of each pixel + def tanh + math :tanh + end + + # Return the inverse hyperbolic sine of an image in radians. + # + # @return [Image] inverse sine of each pixel + def asinh + math :asinh + end + + # Return the inverse hyperbolic cosine of an image in radians. + # + # @return [Image] inverse cosine of each pixel + def acosh + math :acosh + end + + # Return the inverse hyperbolic tangent of an image in radians. + # + # @return [Image] inverse tangent of each pixel + def atanh + math :atanh + end + # Return the natural log of an image. # # @return [Image] natural log of each pixel diff --git a/lib/vips/operation.rb b/lib/vips/operation.rb index 5b0f6fed..c5b46f90 100644 --- a/lib/vips/operation.rb +++ b/lib/vips/operation.rb @@ -48,7 +48,7 @@ module Vips class Introspect attr_reader :name, :description, :flags, :args, :required_input, :optional_input, :required_output, :optional_output, :member_x, - :method_args, :vips_name, :destructive, :doc_optional_input, + :method_args, :vips_name, :destructive, :doc_optional_input, :doc_optional_output @@introspect_cache = {} @@ -168,7 +168,7 @@ def add_yard_introspection name end end - # and make the arg sets to document by filtering out deprecated args + # and make the arg sets to document by filtering out deprecated args @optional_input.each do |arg_name, details| next if (details[:flags] & ARGUMENT_DEPRECATED) != 0 @doc_optional_input[details[:arg_name]] = details From 999e3400a9373bb44cd40d30eb14f4317048d02e Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Sat, 20 Nov 2021 11:51:01 +0000 Subject: [PATCH 03/50] update notes on relase process --- TODO | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/TODO b/TODO index 5f19a37d..1e44966d 100644 --- a/TODO +++ b/TODO @@ -37,8 +37,7 @@ - Push new gem to rubygems, tag repository with version. - gem signin --otp 111111 bundle exec rake release - The otp is from authy / google authenticator / etc. + You'll be asked for a otp from authy / google authenticator / etc. From 1c32aa33ed3950a6d0c3c1fee50974f2a07f4123 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Tue, 11 Jan 2022 13:19:37 +0000 Subject: [PATCH 04/50] update install notes see https://github.com/libvips/ruby-vips/issues/326 --- README.md | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index c1eeaff2..b55fad1b 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,9 @@ [![Test](https://github.com/libvips/ruby-vips/workflows/Test/badge.svg)](https://github.com/libvips/ruby-vips/actions?query=workflow%3ATest) This gem is a Ruby binding for the [libvips image processing -library](https://libvips.github.io/libvips). +library](https://libvips.github.io/libvips). It has been tested on Linux, +macOs and Windows, and with ruby 2, ruby 3 and jruby. It uses [ruby-ffi](https://github.com/ffi/ffi) to call +functions in the libvips library. libvips is a [demand-driven, horizontally threaded](https://github.com/libvips/libvips/wiki/Why-is-libvips-quick) @@ -14,32 +16,30 @@ memory](https://github.com/libvips/libvips/wiki/Speed-and-memory-use). libvips is licensed under the [LGPL 2.1+](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html). -## Requirements +## Install on linux and macOS - * macOS, Linux, and Windows tested +Install the libvips binary with your package manager (eg. `apt install +libvips42` or perhaps `brew install vips`, see the [libvips install +instructions](https://libvips.github.io/libvips/install.html)) then install +this gem with: - * libvips 8.2 or later, see the [libvips install instructions](https://libvips.github.io/libvips/install.html) - - * [ruby-ffi](https://github.com/ffi/ffi) 1.9 or later +``` +gem install ruby-vips +``` - * Ruby 2.0+, JRuby +Or include `gem "ruby-vips"` in your gemfile. -## Install +## Install on Windows -[Install libvips](https://libvips.github.io/libvips/install.html), then: +The gemspec will pull in the msys libvips for you, so all you need is: ``` -$ gem install ruby-vips +gem install ruby-vips ``` -or include it in `Gemfile`: - -```ruby -gem "ruby-vips" -``` +Or include `gem "ruby-vips"` in your gemfile. -On Windows, you'll need to set the `RUBY_DLL_PATH` environment variable to -point to the libvips bin directory. +Tested with the ruby and msys from choco. ## Example From 2fd57d4342270752f2b8149fd487e36aed84a4fa Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Tue, 11 Jan 2022 13:21:19 +0000 Subject: [PATCH 05/50] typo in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b55fad1b..1dc8dea2 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This gem is a Ruby binding for the [libvips image processing library](https://libvips.github.io/libvips). It has been tested on Linux, -macOs and Windows, and with ruby 2, ruby 3 and jruby. It uses [ruby-ffi](https://github.com/ffi/ffi) to call +macOS and Windows, and with ruby 2, ruby 3 and jruby. It uses [ruby-ffi](https://github.com/ffi/ffi) to call functions in the libvips library. libvips is a [demand-driven, horizontally From 4e9fd0bca9de491a61aca20fd58a3088742c8adc Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Sun, 23 Jan 2022 05:47:23 +0000 Subject: [PATCH 06/50] fix a lint error --- spec/connection_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/connection_spec.rb b/spec/connection_spec.rb index c2649e29..6c4ee0df 100644 --- a/spec/connection_spec.rb +++ b/spec/connection_spec.rb @@ -20,7 +20,7 @@ end it "can create a source from an area of memory" do - str = File.open(simg("wagon.jpg"), "rb").read + str = File.binread(simg("wagon.jpg")) source = Vips::Source.new_from_memory str expect(source) From 2445829ad895789161cf0cd965dab7535a4ed90e Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Sun, 23 Jan 2022 05:51:46 +0000 Subject: [PATCH 07/50] more lint warnings --- spec/image_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/image_spec.rb b/spec/image_spec.rb index f1d49f64..2fe57214 100644 --- a/spec/image_spec.rb +++ b/spec/image_spec.rb @@ -220,7 +220,7 @@ def has_jpeg? if has_jpeg? it "can load a sample jpg image buffer" do - str = File.open(simg("wagon.jpg"), "rb").read + str = File.binread(simg("wagon.jpg")) x = Vips::Image.new_from_buffer str, "" expect(x.width).to eq(685) expect(x.height).to eq(478) @@ -231,7 +231,7 @@ def has_jpeg? if has_jpeg? it "can load a sample jpg image utf-8 buffer" do - str = File.open(simg("wagon.jpg"), "r").read + str = File.read(simg("wagon.jpg")) x = Vips::Image.new_from_buffer str, "" expect(x.width).to eq(685) expect(x.height).to eq(478) @@ -257,7 +257,7 @@ def has_jpeg? if has_jpeg? it "can set an ICC profile on a jpg image" do x = Vips::Image.new_from_file simg("icc.jpg") - profile = File.open(simg("lcd.icc"), "rb").read + profile = File.binread(simg("lcd.icc")) x = x.copy x.set_value "icc-profile-data", profile x.write_to_file(timg("x.jpg")) From 3206143db61ac63f4689efc5a7cad83d92d4c93a Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Tue, 25 Jan 2022 09:10:38 +0000 Subject: [PATCH 08/50] add ruby 3.1 to testing --- .github/workflows/test.yml | 1 + README.md | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 64a86681..7b3c92a8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,6 +47,7 @@ jobs: - 2.6 - 2.7 - 3.0 + - 3.1 - jruby fail-fast: true diff --git a/README.md b/README.md index 1dc8dea2..068a953d 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,10 @@ [![Test](https://github.com/libvips/ruby-vips/workflows/Test/badge.svg)](https://github.com/libvips/ruby-vips/actions?query=workflow%3ATest) This gem is a Ruby binding for the [libvips image processing -library](https://libvips.github.io/libvips). It has been tested on Linux, -macOS and Windows, and with ruby 2, ruby 3 and jruby. It uses [ruby-ffi](https://github.com/ffi/ffi) to call -functions in the libvips library. +library](https://libvips.github.io/libvips). It has been tested on +Linux, macOS and Windows, and with ruby 2, ruby 3 and jruby. It uses +[ruby-ffi](https://github.com/ffi/ffi) to call functions in the libvips +library. libvips is a [demand-driven, horizontally threaded](https://github.com/libvips/libvips/wiki/Why-is-libvips-quick) @@ -39,7 +40,7 @@ gem install ruby-vips Or include `gem "ruby-vips"` in your gemfile. -Tested with the ruby and msys from choco. +Tested with the ruby and msys from choco, but others may work. ## Example @@ -106,4 +107,3 @@ rmagick.rb 788768 See also [benchmarks at the official libvips website](https://github.com/libvips/libvips/wiki/Speed-and-memory-use). - From 53d279bfb2b0a5b703a9a7665452a340163cc02e Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Sun, 8 May 2022 13:59:42 +0100 Subject: [PATCH 09/50] add draw_point! see https://github.com/libvips/ruby-vips/issues/148 --- CHANGELOG.md | 2 ++ lib/vips/mutableimage.rb | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6caa3f21..d27c5d97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## master +* add `draw_point!` [jcupitt] + ## Version 2.1.4 (2021-10-28) * `write_to_buffer` tries to use the new target API, then falls back to the old diff --git a/lib/vips/mutableimage.rb b/lib/vips/mutableimage.rb index 2290dba4..365e61e2 100644 --- a/lib/vips/mutableimage.rb +++ b/lib/vips/mutableimage.rb @@ -96,6 +96,13 @@ def method_missing name, *args, **options Vips::Operation.call name.to_s, [self, *args], options end + # Draw a point on an image. + # + # See {Image#draw_rect}. + def draw_point! ink, left, top, **opts + draw_rect! ink, left, top, 1, 1, **opts + end + # Create a metadata item on an image of the specifed type. Ruby types # are automatically transformed into the matching glib type (eg. # {GObject::GINT_TYPE}), if possible. From a30fc5b9ad6735c53f62797de0c823ed795b12f1 Mon Sep 17 00:00:00 2001 From: Jeremy Daer Date: Wed, 18 May 2022 12:35:25 -0700 Subject: [PATCH 10/50] Expose runtime state for metrics scraping and diagnostics Metrics for allocations and open files: * `Vips.tracked_mem` - bytes currently allocated * `Vips.tracked_mem_highwater` - max bytes allocated * `Vips.tracked_allocs` - current allocation count * `Vips.tracked_files` - current open file count Expose global settings for inspection: * `Vips.vector?` - whether SIMD vector support is enabled * `Vips.cache_max` - max operations to cache * `Vips.cache_max_mem` - max bytes to cache * `Vips.cache_max_files` - max open files to cache --- lib/vips.rb | 66 ++++++++++++++++++++++++++++++++++++++++++++++ spec/vips_spec.rb | 67 ++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 121 insertions(+), 12 deletions(-) diff --git a/lib/vips.rb b/lib/vips.rb index 1edd735d..d017dd76 100644 --- a/lib/vips.rb +++ b/lib/vips.rb @@ -625,6 +625,7 @@ def to_s attach_function :vips_leak_set, [:int], :void attach_function :vips_vector_set_enabled, [:int], :void + attach_function :vips_vector_isenabled, [], :int attach_function :vips_concurrency_set, [:int], :void # vips_foreign_get_suffixes was added in libvips 8.8 @@ -640,20 +641,66 @@ def self.leak_set leak vips_leak_set((leak ? 1 : 0)) end + attach_function :vips_tracked_get_mem, [], :int + attach_function :vips_tracked_get_mem_highwater, [], :int + attach_function :vips_tracked_get_allocs, [], :int + attach_function :vips_tracked_get_files, [], :int + attach_function :vips_cache_get_max, [], :int + attach_function :vips_cache_get_max_mem, [], :int + attach_function :vips_cache_get_max_files, [], :int attach_function :vips_cache_set_max, [:int], :void attach_function :vips_cache_set_max_mem, [:int], :void attach_function :vips_cache_set_max_files, [:int], :void + attach_function :vips_cache_print, [], :void + attach_function :vips_cache_drop_all, [], :void + + # Get the number of bytes currently allocated via vips_malloc. + def self.tracked_mem + vips_tracked_get_mem + end + + # Get the greatest number of bytes ever actively allocated via vips_malloc. + def self.tracked_mem_highwater + vips_tracked_get_mem_highwater + end + + # Get the number of active allocations. + def self.tracked_allocs + vips_tracked_get_allocs + end + + # Get the number of open files. + def self.tracked_files + vips_tracked_get_files + end + + # Get the maximum number of operations that libvips should cache. + def self.cache_max + vips_cache_get_max + end + + # Get the maximum amount of memory that libvips uses for the operation cache. + def self.cache_max_mem + vips_cache_get_max_mem + end + + # Get the maximum number of files libvips keeps open in the operation cache. + def self.cache_max_files + vips_cache_get_max_files + end # Set the maximum number of operations that libvips should cache. Set 0 to # disable the operation cache. The default is 1000. def self.cache_set_max size vips_cache_set_max size + cache_max end # Set the maximum amount of memory that libvips should use for the operation # cache. Set 0 to disable the operation cache. The default is 100mb. def self.cache_set_max_mem size vips_cache_set_max_mem size + cache_max_mem end # Set the maximum number of files libvips should keep open in the @@ -661,6 +708,17 @@ def self.cache_set_max_mem size # 100. def self.cache_set_max_files size vips_cache_set_max_files size + cache_max_files + end + + # Print the libvips operation cache to stdout. Handy for debugging. + def self.cache_print # :nodoc: + vips_cache_print + end + + # Drop the libvips operation cache. Handy for leak tracking. + def self.cache_drop_all # :nodoc: + vips_cache_drop_all end # Set the size of the libvips worker pool. This defaults to the number of @@ -669,11 +727,19 @@ def self.concurrency_set n vips_concurrency_set n end + # Whether SIMD and the run-time compiler are enabled. This can give a nice + # speed-up, but can also be unstable on some systems or with some versions + # of the run-time compiler. + def self.vector? + vips_vector_isenabled == 1 + end + # Enable or disable SIMD and the run-time compiler. This can give a nice # speed-up, but can also be unstable on some systems or with some versions # of the run-time compiler. def self.vector_set enabled vips_vector_set_enabled(enabled ? 1 : 0) + vector? end # Deprecated compatibility function. diff --git a/spec/vips_spec.rb b/spec/vips_spec.rb index 6f28cde1..32144329 100644 --- a/spec/vips_spec.rb +++ b/spec/vips_spec.rb @@ -6,8 +6,16 @@ Vips.concurrency_set 12 end - it "can set SIMD" do - Vips.vector_set true + it "sets SIMD" do + default = Vips.vector? + + expect(Vips.vector_set(true)).to be true + expect(Vips.vector?).to be true + + expect(Vips.vector_set(false)).to be false + expect(Vips.vector?).to be false + + Vips.vector_set default end it "can enable leak testing" do @@ -15,24 +23,59 @@ Vips.leak_set false end - it "can set the operation cache size" do - Vips.cache_set_max 0 - Vips.cache_set_max 100 + it "can get a set of filename suffixes" do + suffs = Vips.get_suffixes + expect(suffs.length > 10).to be true unless suffs.empty? + end + end + + describe "cache" do + it "can get and set the operation cache size" do + default = Vips.cache_max + + expect(Vips.cache_set_max(0)).to be 0 + expect(Vips.cache_max).to be 0 + + expect(Vips.cache_set_max(default)).to be default + expect(Vips.cache_max).to be default end it "can set the operation cache memory limit" do - Vips.cache_set_max_mem 0 - Vips.cache_set_max_mem 10000000 + default = Vips.cache_max_mem + + expect(Vips.cache_set_max_mem(0)).to be 0 + expect(Vips.cache_max_mem).to be 0 + + expect(Vips.cache_set_max_mem(default)).to be default + expect(Vips.cache_max_mem).to be default end it "can set the operation cache file limit" do - Vips.cache_set_max_files 0 - Vips.cache_set_max_files 100 + default = Vips.cache_max_files + + expect(Vips.cache_set_max_files(0)).to be 0 + expect(Vips.cache_max_files).to be 0 + + expect(Vips.cache_set_max_files(default)).to be default + expect(Vips.cache_max_files).to be default end + end - it "can get a set of filename suffixes" do - suffs = Vips.get_suffixes - expect(suffs.length > 10).to be true unless suffs.empty? + describe "#tracked_*" do + it "can get allocated bytes" do + expect(Vips.tracked_mem).to be >= 0 + end + + it "can get allocated bytes high-water mark" do + expect(Vips.tracked_mem_highwater).to be >= 0 + end + + it "can get allocation count" do + expect(Vips.tracked_allocs).to be >= 0 + end + + it "can get open file count" do + expect(Vips.tracked_files).to be >= 0 end end From 3e6cd180308c06f368832693150ae00312553eca Mon Sep 17 00:00:00 2001 From: Jeremy Daer Date: Wed, 18 May 2022 12:35:25 -0700 Subject: [PATCH 11/50] Reset concurrency to the initial default by setting 0 or nil `Vips.concurrency_set(0)` suggests it'll set concurrency back to the default value, but it does nothing if concurrency is already set, which is always true because Vips.init has already configured thread pools. The result is that if you set concurrency to any value, setting it to zero will leave that value in place. This reads the default concurrency immediately after Vips.init so we can make good on having `concurrency_set 0` reset to default. Also allows setting `nil` to reset to default. Note that setting concurrency does not reconfigure existing thread pools. It affects thread pools spawned for future operations. --- lib/vips.rb | 21 +++++++++++++++++++-- spec/spec_helper.rb | 8 ++++++++ spec/vips_spec.rb | 25 ++++++++++++++++++++++++- 3 files changed, 51 insertions(+), 3 deletions(-) diff --git a/lib/vips.rb b/lib/vips.rb index 1edd735d..4342b65c 100644 --- a/lib/vips.rb +++ b/lib/vips.rb @@ -626,6 +626,10 @@ def to_s attach_function :vips_leak_set, [:int], :void attach_function :vips_vector_set_enabled, [:int], :void attach_function :vips_concurrency_set, [:int], :void + attach_function :vips_concurrency_get, [], :int + + # Track the original default concurrency so we can reset to it. + DEFAULT_CONCURRENCY = vips_concurrency_get # vips_foreign_get_suffixes was added in libvips 8.8 begin @@ -663,10 +667,23 @@ def self.cache_set_max_files size vips_cache_set_max_files size end - # Set the size of the libvips worker pool. This defaults to the number of - # hardware threads on your computer. Set to 1 to disable threading. + # Get the size of libvips worker pools. Defaults to the VIPS_CONCURRENCY env + # var or the number of hardware threads on your computer. + def self.concurrency + vips_concurrency_get + end + + # Get the default size of libvips worker pools. + def self.concurrency_default + DEFAULT_CONCURRENCY + end + + # Set the size of each libvips worker pool. Max 1024 threads. Set to 1 to + # disable threading. Set to 0 or nil to reset to default. def self.concurrency_set n + n = DEFAULT_CONCURRENCY if n.to_i == 0 vips_concurrency_set n + concurrency end # Enable or disable SIMD and the run-time compiler. This can give a nice diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 0410b1ba..2bb56931 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,3 +1,11 @@ +# Set default concurrency so we can check against it later. Must be set +# before Vips.init sets concurrency to the default. +DEFAULT_VIPS_CONCURRENCY = 5 +ENV["VIPS_CONCURRENCY"] = DEFAULT_VIPS_CONCURRENCY.to_s + +# Disable stderr output since we purposefully trigger warn-able behavior. +ENV["VIPS_WARNING"] = "1" + require "vips" require "tempfile" diff --git a/spec/vips_spec.rb b/spec/vips_spec.rb index 6f28cde1..42cbb6d4 100644 --- a/spec/vips_spec.rb +++ b/spec/vips_spec.rb @@ -2,8 +2,31 @@ RSpec.describe Vips do describe "Vips" do + it "can get default concurrency" do + expect(Vips.concurrency_default).to eq DEFAULT_VIPS_CONCURRENCY + end + + it "can get concurrency" do + expect(Vips.concurrency).to eq Vips.concurrency_default + end + it "can set concurrency" do - Vips.concurrency_set 12 + expect(Vips.concurrency_set(12)).to eq 12 + expect(Vips.concurrency).to eq 12 + end + + it "clips concurrency to 1024" do + expect(Vips.concurrency_set(1025)).to eq 1024 + end + + it "can set concurrency to 0 to reset to default" do + Vips.concurrency_set(rand(100)) + expect(Vips.concurrency_set(0)).to eq Vips.concurrency_default + end + + it "can set concurrency to nil to reset to default" do + Vips.concurrency_set(rand(100)) + expect(Vips.concurrency_set(nil)).to eq Vips.concurrency_default end it "can set SIMD" do From 3865cd6a27c9ee2b200b4bd0872f38267a8d333a Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Tue, 24 May 2022 12:23:13 +0100 Subject: [PATCH 12/50] note metric additions in changelog see https://github.com/libvips/ruby-vips/pull/335 --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d27c5d97..13d38a96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ ## master * add `draw_point!` [jcupitt] +* add `Vips.tracked_*` for getting file and memory metrics [jeremy] +* add `Vips.cache_*` for getting cache settings [jeremy] +* add `Vips.vector?` to get/set SIMD status [jeremy] ## Version 2.1.4 (2021-10-28) From 932c31a103bb91c93ea862f3702b24b3fdd12905 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Tue, 24 May 2022 12:59:26 +0100 Subject: [PATCH 13/50] note concurrency API improvements see https://github.com/libvips/ruby-vips/pull/336 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 13d38a96..a7ffe170 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ * add `Vips.tracked_*` for getting file and memory metrics [jeremy] * add `Vips.cache_*` for getting cache settings [jeremy] * add `Vips.vector?` to get/set SIMD status [jeremy] +* add `Vips.concurrency` to get/set threadpool size [jeremy] +* add `Vips.concurrency_default` to get the default threadpool size [jeremy] ## Version 2.1.4 (2021-10-28) From 00d39c3f0ff0fa7f005fc86bff515333554049be Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Fri, 16 Dec 2022 11:58:40 +0000 Subject: [PATCH 14/50] fix targetcustom spec with libvips 8.13 Due to a libvips bug, we need to close in line with targetcustom output. see https://github.com/libvips/ruby-vips/issues/351 --- CHANGELOG.md | 1 + spec/connection_spec.rb | 43 ++++++++++++++++++++++++++++++++--------- 2 files changed, 35 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a7ffe170..845d5e0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ * add `Vips.vector?` to get/set SIMD status [jeremy] * add `Vips.concurrency` to get/set threadpool size [jeremy] * add `Vips.concurrency_default` to get the default threadpool size [jeremy] +* fix targetcustom spec test with libvips 8.13 [lucaskanashiro] ## Version 2.1.4 (2021-10-28) diff --git a/spec/connection_spec.rb b/spec/connection_spec.rb index 6c4ee0df..10dc4c7f 100644 --- a/spec/connection_spec.rb +++ b/spec/connection_spec.rb @@ -140,21 +140,46 @@ expect(target) end +end + +# 8.13 had a broken on_finish, so close ourselves before 8.14 +RSpec.describe Vips::SourceCustom, version: [8, 9] do + it "can write an image to a user output stream with explicit close" do + image = Vips::Image.new_from_file simg("wagon.jpg") - it "can write an image to a user output stream" do filename = timg("x5.png") file = File.open filename, "wb" target = Vips::TargetCustom.new target.on_write { |chunk| file.write(chunk) } - target.on_finish { file.close } - image = Vips::Image.new_from_file simg("wagon.jpg") image.write_to_target target, ".png" + file.close - image = Vips::Image.new_from_file filename - expect(image) - expect(image.width).to eq(685) - expect(image.height).to eq(478) - expect(image.bands).to eq(3) - expect(image.avg).to be_within(0.001).of(109.789) + image2 = Vips::Image.new_from_file filename + expect(image2) + expect(image2.width).to eq(685) + expect(image2.height).to eq(478) + expect(image2.bands).to eq(3) + expect(image2.avg).to eq(image.avg) + end +end + +# on_finish started working again in 8.14 (and 8.13.4+, and 8.12 and earlier) +RSpec.describe Vips::SourceCustom, version: [8, 14] do + it "can write an image to a user output stream" do + image = Vips::Image.new_from_file simg("wagon.jpg") + + filename = timg("x5.png") + file = File.open filename, "wb" + target = Vips::TargetCustom.new + target.on_write { |chunk| file.write(chunk) } + target.on_finish { file.close } + image.write_to_target target, filename + + image2 = Vips::Image.new_from_file filename + expect(image2) + expect(image2.width).to eq(685) + expect(image2.height).to eq(478) + expect(image2.bands).to eq(3) + expect(image2.avg).to eq(image.avg) end end From e315f2cb13dd7bc7322240d11bb819f3a0a90c2a Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Sat, 17 Dec 2022 10:32:58 +0000 Subject: [PATCH 15/50] fix a lint warning --- lib/vips/image.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/vips/image.rb b/lib/vips/image.rb index bae9c372..42ae434b 100644 --- a/lib/vips/image.rb +++ b/lib/vips/image.rb @@ -138,14 +138,14 @@ def self.run_cmplx image, &block image = image.cast :float end - new_format = image.format == :double ? :dpcomplex : :complex + new_format = (image.format == :double) ? :dpcomplex : :complex image = image.copy format: new_format, bands: image.bands / 2 end image = block.call(image) unless Image.complex? original_format - new_format = image.format == :dpcomplex ? :double : :float + new_format = (image.format == :dpcomplex) ? :double : :float image = image.copy format: new_format, bands: image.bands * 2 end From 6e07792f064f48bcba4a2858a0868cddd5e3ec7f Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Sat, 17 Dec 2022 10:53:38 +0000 Subject: [PATCH 16/50] grrr more stupid lint changes --- lib/vips/operation.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vips/operation.rb b/lib/vips/operation.rb index c5b46f90..9bc14d85 100644 --- a/lib/vips/operation.rb +++ b/lib/vips/operation.rb @@ -151,7 +151,7 @@ def add_yard_introspection name flags = details[:flags] gtype = details[:gtype] - details[:yard_name] = arg_name == "in" ? "im" : arg_name + details[:yard_name] = (arg_name == "in") ? "im" : arg_name pspec = @op.get_pspec arg_name details[:blurb] = GObject.g_param_spec_get_blurb pspec From 2db13b74e784181890adb978bcfb1a1b5304c7f8 Mon Sep 17 00:00:00 2001 From: Peter Goldstein Date: Wed, 15 Mar 2023 20:13:57 -0400 Subject: [PATCH 17/50] Add Ruby 3.2 to CI --- .github/workflows/test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7b3c92a8..9bfe532c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -46,8 +46,9 @@ jobs: - 2.5 - 2.6 - 2.7 - - 3.0 + - '3.0' - 3.1 + - 3.2 - jruby fail-fast: true @@ -55,7 +56,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up Ruby uses: ruby/setup-ruby@v1 From b32b244cae375494b65441518525a83d0915e4e1 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Thu, 16 Mar 2023 09:12:17 +0000 Subject: [PATCH 18/50] quote all ruby versions in yaml --- .github/workflows/test.yml | 20 ++++++++++---------- CHANGELOG.md | 1 + example/revalidate.rb | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 10 deletions(-) create mode 100755 example/revalidate.rb diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9bfe532c..4b93cfd4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,17 +38,17 @@ jobs: matrix: os-version: [ 'ubuntu-20.04' ] ruby-version: - - 2.0 - - 2.1 - - 2.2 - - 2.3 - - 2.4 - - 2.5 - - 2.6 - - 2.7 + - '2.0' + - '2.1' + - '2.2' + - '2.3' + - '2.4' + - '2.5' + - '2.6' + - '2.7' - '3.0' - - 3.1 - - 3.2 + - '3.1' + - '3.2' - jruby fail-fast: true diff --git a/CHANGELOG.md b/CHANGELOG.md index 845d5e0d..9796c74d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ * add `Vips.concurrency` to get/set threadpool size [jeremy] * add `Vips.concurrency_default` to get the default threadpool size [jeremy] * fix targetcustom spec test with libvips 8.13 [lucaskanashiro] +* add ruby 3.2 to CI [petergoldstein] ## Version 2.1.4 (2021-10-28) diff --git a/example/revalidate.rb b/example/revalidate.rb new file mode 100755 index 00000000..ac5de860 --- /dev/null +++ b/example/revalidate.rb @@ -0,0 +1,36 @@ +#!/usr/bin/ruby + +# demo the "revalidate" feature in libvips 8.15 + +require "fileutils" +require "vips" + +if ARGV.length != 2 + puts "usage: ./revalidate.rb IMAGE-FILE-1 IMAGE-FILE-2" + exit 1 +end + +if File.exists?("fred") + puts "file 'fred' exists, delete it first" + exit 1 +end + +puts "copying #{ARGV[0]} to fred ..." +FileUtils.cp(ARGV[0], "fred") + +image1 = Vips::Image.new_from_file("fred") +puts "fred.width = #{image1.width}" + +puts "copying #{ARGV[1]} to fred ..." +FileUtils.cp(ARGV[1], "fred") + +puts "plain image open ..." +image2 = Vips::Image.new_from_file("fred") +puts "fred.width = #{image2.width}" + +puts "opening with revalidate ..." +image2 = Vips::Image.new_from_file("fred", revalidate: true) +puts "fred.width = #{image2.width}" + +File.delete("fred") + From 1c1f363ee9856a6f45fb48c7b5a6a2d28c02ee0a Mon Sep 17 00:00:00 2001 From: Peter Goldstein Date: Thu, 16 Mar 2023 08:16:43 -0400 Subject: [PATCH 19/50] Fix lints - use exist? as exists? is no longer available in Ruby 3.2 --- example/revalidate.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/example/revalidate.rb b/example/revalidate.rb index ac5de860..bfc7fc88 100755 --- a/example/revalidate.rb +++ b/example/revalidate.rb @@ -10,7 +10,7 @@ exit 1 end -if File.exists?("fred") +if File.exist?("fred") puts "file 'fred' exists, delete it first" exit 1 end @@ -33,4 +33,3 @@ puts "fred.width = #{image2.width}" File.delete("fred") - From 90fdaad57f6f36f5f2f1aa0634f377dd483e5b16 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Mon, 20 Mar 2023 13:57:53 +0000 Subject: [PATCH 20/50] update revalidate example --- example/revalidate.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/example/revalidate.rb b/example/revalidate.rb index ac5de860..00df85bb 100755 --- a/example/revalidate.rb +++ b/example/revalidate.rb @@ -32,5 +32,9 @@ image2 = Vips::Image.new_from_file("fred", revalidate: true) puts "fred.width = #{image2.width}" +puts "opening again, should get cached entry ..." +image2 = Vips::Image.new_from_file("fred") +puts "fred.width = #{image2.width}" + File.delete("fred") From fb40304856a5bfa0b9eced7fd36a3d1904a4268e Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 18 Oct 2023 14:03:32 +0100 Subject: [PATCH 21/50] update docs for 8.15, bump version see https://github.com/libvips/libvips/issues/3718 --- CHANGELOG.md | 3 + VERSION | 2 +- lib/vips/methods.rb | 869 +++++++++++++++++++++++++++----------------- lib/vips/version.rb | 2 +- 4 files changed, 549 insertions(+), 327 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9796c74d..ba92acbb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## master +## Version 2.2.0 (2023-10-18) + * add `draw_point!` [jcupitt] * add `Vips.tracked_*` for getting file and memory metrics [jeremy] * add `Vips.cache_*` for getting cache settings [jeremy] @@ -10,6 +12,7 @@ * add `Vips.concurrency_default` to get the default threadpool size [jeremy] * fix targetcustom spec test with libvips 8.13 [lucaskanashiro] * add ruby 3.2 to CI [petergoldstein] +* update docs for libvips 8.15 [jcupitt] ## Version 2.1.4 (2021-10-28) diff --git a/VERSION b/VERSION index 7d2ed7c7..ccbccc3d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.1.4 +2.2.0 diff --git a/lib/vips/methods.rb b/lib/vips/methods.rb index 3b4963f0..2a436b20 100644 --- a/lib/vips/methods.rb +++ b/lib/vips/methods.rb @@ -39,7 +39,7 @@ class Image # @!method relational(right, relational, **opts) # Relational operation on two images. # @param right [Vips::Image] Right-hand image argument -# @param relational [Vips::OperationRelational] relational to perform +# @param relational [Vips::OperationRelational] Relational to perform # @param opts [Hash] Set of options # @return [Vips::Image] Output image @@ -52,21 +52,21 @@ class Image # @!method boolean(right, boolean, **opts) # Boolean operation on two images. # @param right [Vips::Image] Right-hand image argument -# @param boolean [Vips::OperationBoolean] boolean to perform +# @param boolean [Vips::OperationBoolean] Boolean to perform # @param opts [Hash] Set of options # @return [Vips::Image] Output image # @!method math2(right, math2, **opts) # Binary math operations. # @param right [Vips::Image] Right-hand image argument -# @param math2 [Vips::OperationMath2] math to perform +# @param math2 [Vips::OperationMath2] Math to perform # @param opts [Hash] Set of options # @return [Vips::Image] Output image # @!method complex2(right, cmplx, **opts) # Complex binary operations on two images. # @param right [Vips::Image] Right-hand image argument -# @param cmplx [Vips::OperationComplex2] binary complex operation to perform +# @param cmplx [Vips::OperationComplex2] Binary complex operation to perform # @param opts [Hash] Set of options # @return [Vips::Image] Output image @@ -97,7 +97,7 @@ class Image # @!method math(math, **opts) # Apply a math operation to an image. -# @param math [Vips::OperationMath] math to perform +# @param math [Vips::OperationMath] Math to perform # @param opts [Hash] Set of options # @return [Vips::Image] Output image @@ -113,13 +113,13 @@ class Image # @!method round(round, **opts) # Perform a round function on an image. -# @param round [Vips::OperationRound] rounding operation to perform +# @param round [Vips::OperationRound] Rounding operation to perform # @param opts [Hash] Set of options # @return [Vips::Image] Output image # @!method relational_const(relational, c, **opts) # Relational operations against a constant. -# @param relational [Vips::OperationRelational] relational to perform +# @param relational [Vips::OperationRelational] Relational to perform # @param c [Array] Array of constants # @param opts [Hash] Set of options # @return [Vips::Image] Output image @@ -132,27 +132,27 @@ class Image # @!method boolean_const(boolean, c, **opts) # Boolean operations against a constant. -# @param boolean [Vips::OperationBoolean] boolean to perform +# @param boolean [Vips::OperationBoolean] Boolean to perform # @param c [Array] Array of constants # @param opts [Hash] Set of options # @return [Vips::Image] Output image # @!method math2_const(math2, c, **opts) # Binary math operations with a constant. -# @param math2 [Vips::OperationMath2] math to perform +# @param math2 [Vips::OperationMath2] Math to perform # @param c [Array] Array of constants # @param opts [Hash] Set of options # @return [Vips::Image] Output image # @!method complex(cmplx, **opts) # Perform a complex operation on an image. -# @param cmplx [Vips::OperationComplex] complex to perform +# @param cmplx [Vips::OperationComplex] Complex to perform # @param opts [Hash] Set of options # @return [Vips::Image] Output image # @!method complexget(get, **opts) # Get a component from a complex image. -# @param get [Vips::OperationComplexget] complex to perform +# @param get [Vips::OperationComplexget] Complex to perform # @param opts [Hash] Set of options # @return [Vips::Image] Output image @@ -215,7 +215,7 @@ class Image # @!method hough_line(**opts) # Find hough line transform. # @param opts [Hash] Set of options -# @option opts [Integer] :width horizontal size of parameter space +# @option opts [Integer] :width Horizontal size of parameter space # @option opts [Integer] :height Vertical size of parameter space # @return [Vips::Image] Output image @@ -260,6 +260,7 @@ class Image # @param opts [Hash] Set of options # @option opts [Float] :threshold Object threshold # @option opts [Array] :background Color for background pixels +# @option opts [Boolean] :line_art Enable line art mode # @return [Array] Left edge of image, Top edge of extract area, Width of extract area, Height of extract area # @!method copy(**opts) @@ -324,7 +325,7 @@ class Image # @!method gravity(direction, width, height, **opts) # Place an image within a larger image with a certain gravity. -# @param direction [Vips::CompassDirection] direction to place image within width/height +# @param direction [Vips::CompassDirection] Direction to place image within width/height # @param width [Integer] Image width in pixels # @param height [Integer] Image height in pixels # @param opts [Hash] Set of options @@ -396,7 +397,10 @@ class Image # @param height [Integer] Height of extract area # @param opts [Hash] Set of options # @option opts [Vips::Interesting] :interesting How to measure interestingness -# @return [Vips::Image] Output image +# @option opts [Boolean] :premultiplied Input image already has premultiplied alpha +# @option opts [Integer] :attention_x Output Horizontal position of attention centre +# @option opts [Integer] :attention_y Output Vertical position of attention centre +# @return [Vips::Image, Hash Object>] Output image, Hash of optional output items # @!method extract_band(band, **opts) # Extract band from an image. @@ -425,7 +429,7 @@ class Image # @!method bandbool(boolean, **opts) # Boolean operation across image bands. -# @param boolean [Vips::OperationBoolean] boolean to perform +# @param boolean [Vips::OperationBoolean] Boolean to perform # @param opts [Hash] Set of options # @return [Vips::Image] Output image @@ -464,7 +468,7 @@ class Image # @!method recomb(m, **opts) # Linear recombination with matrix. -# @param m [Vips::Image] matrix of coefficients +# @param m [Vips::Image] Matrix of coefficients # @param opts [Hash] Set of options # @return [Vips::Image] Output image @@ -502,9 +506,9 @@ class Image # @!method grid(tile_height, across, down, **opts) # Grid an image. -# @param tile_height [Integer] chop into tiles this high -# @param across [Integer] number of tiles across -# @param down [Integer] number of tiles down +# @param tile_height [Integer] Chop into tiles this high +# @param across [Integer] Number of tiles across +# @param down [Integer] Number of tiles down # @param opts [Hash] Set of options # @return [Vips::Image] Output image @@ -608,10 +612,10 @@ class Image # @!method self.logmat(sigma, min_ampl, **opts) # Make a laplacian of gaussian image. -# @param sigma [Float] Radius of Logmatian -# @param min_ampl [Float] Minimum amplitude of Logmatian +# @param sigma [Float] Radius of Gaussian +# @param min_ampl [Float] Minimum amplitude of Gaussian # @param opts [Hash] Set of options -# @option opts [Boolean] :separable Generate separable Logmatian +# @option opts [Boolean] :separable Generate separable Gaussian # @option opts [Vips::Precision] :precision Generate with this precision # @return [Vips::Image] Output image @@ -623,11 +627,12 @@ class Image # @option opts [Integer] :width Maximum image width in pixels # @option opts [Integer] :height Maximum image height in pixels # @option opts [Vips::Align] :align Align on the low, centre or high edge -# @option opts [Boolean] :rgba Enable RGBA output -# @option opts [Integer] :dpi DPI to render at # @option opts [Boolean] :justify Justify lines +# @option opts [Integer] :dpi DPI to render at # @option opts [Integer] :spacing Line spacing # @option opts [String] :fontfile Load this font file +# @option opts [Boolean] :rgba Enable RGBA output +# @option opts [Vips::TextWrap] :wrap Wrap lines on word or character boundaries # @option opts [Integer] :autofit_dpi Output DPI selected by autofit # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items @@ -697,7 +702,7 @@ class Image # @param height [Integer] Image height in pixels # @param frequency_cutoff_x [Float] Frequency cutoff x # @param frequency_cutoff_y [Float] Frequency cutoff y -# @param radius [Float] radius of circle +# @param radius [Float] Radius of circle # @param opts [Hash] Set of options # @option opts [Boolean] :uchar Output an unsigned char image # @option opts [Boolean] :nodc Remove DC component @@ -741,7 +746,7 @@ class Image # @param order [Float] Filter order # @param frequency_cutoff_x [Float] Frequency cutoff x # @param frequency_cutoff_y [Float] Frequency cutoff y -# @param radius [Float] radius of circle +# @param radius [Float] Radius of circle # @param amplitude_cutoff [Float] Amplitude cutoff # @param opts [Hash] Set of options # @option opts [Boolean] :uchar Output an unsigned char image @@ -783,7 +788,7 @@ class Image # @param height [Integer] Image height in pixels # @param frequency_cutoff_x [Float] Frequency cutoff x # @param frequency_cutoff_y [Float] Frequency cutoff y -# @param radius [Float] radius of circle +# @param radius [Float] Radius of circle # @param amplitude_cutoff [Float] Amplitude cutoff # @param opts [Hash] Set of options # @option opts [Boolean] :uchar Output an unsigned char image @@ -882,6 +887,7 @@ class Image # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items @@ -896,6 +902,7 @@ class Image # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items @@ -906,6 +913,7 @@ class Image # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items @@ -916,6 +924,7 @@ class Image # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items @@ -932,6 +941,7 @@ class Image # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items @@ -942,6 +952,7 @@ class Image # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items @@ -952,6 +963,7 @@ class Image # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items @@ -962,6 +974,7 @@ class Image # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items @@ -972,6 +985,7 @@ class Image # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items @@ -982,6 +996,7 @@ class Image # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items @@ -992,6 +1007,7 @@ class Image # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items @@ -1002,6 +1018,7 @@ class Image # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items @@ -1012,51 +1029,7 @@ class Image # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on -# @option opts [Vips::ForeignFlags] :flags Output Flags for this file -# @return [Vips::Image, Hash Object>] Output image, Hash of optional output items - -# @!method self.pdfload(filename, **opts) -# Load pdf from file. -# @param filename [String] Filename to load from -# @param opts [Hash] Set of options -# @option opts [Integer] :page Load this page from the file -# @option opts [Integer] :n Load this many pages -# @option opts [Float] :dpi Render at this DPI -# @option opts [Float] :scale Scale output by this factor -# @option opts [Array] :background Background value -# @option opts [Boolean] :memory Force open via memory -# @option opts [Vips::Access] :access Required access pattern for this file -# @option opts [Vips::FailOn] :fail_on Error level to fail on -# @option opts [Vips::ForeignFlags] :flags Output Flags for this file -# @return [Vips::Image, Hash Object>] Output image, Hash of optional output items - -# @!method self.pdfload_buffer(buffer, **opts) -# Load pdf from buffer. -# @param buffer [VipsBlob] Buffer to load from -# @param opts [Hash] Set of options -# @option opts [Integer] :page Load this page from the file -# @option opts [Integer] :n Load this many pages -# @option opts [Float] :dpi Render at this DPI -# @option opts [Float] :scale Scale output by this factor -# @option opts [Array] :background Background value -# @option opts [Boolean] :memory Force open via memory -# @option opts [Vips::Access] :access Required access pattern for this file -# @option opts [Vips::FailOn] :fail_on Error level to fail on -# @option opts [Vips::ForeignFlags] :flags Output Flags for this file -# @return [Vips::Image, Hash Object>] Output image, Hash of optional output items - -# @!method self.pdfload_source(source, **opts) -# Load pdf from source. -# @param source [Vips::Source] Source to load from -# @param opts [Hash] Set of options -# @option opts [Integer] :page Load this page from the file -# @option opts [Integer] :n Load this many pages -# @option opts [Float] :dpi Render at this DPI -# @option opts [Float] :scale Scale output by this factor -# @option opts [Array] :background Background value -# @option opts [Boolean] :memory Force open via memory -# @option opts [Vips::Access] :access Required access pattern for this file -# @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items @@ -1070,6 +1043,7 @@ class Image # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items @@ -1083,6 +1057,7 @@ class Image # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items @@ -1096,36 +1071,7 @@ class Image # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on -# @option opts [Vips::ForeignFlags] :flags Output Flags for this file -# @return [Vips::Image, Hash Object>] Output image, Hash of optional output items - -# @!method self.jxlload(filename, **opts) -# Load jpeg-xl image. -# @param filename [String] Filename to load from -# @param opts [Hash] Set of options -# @option opts [Boolean] :memory Force open via memory -# @option opts [Vips::Access] :access Required access pattern for this file -# @option opts [Vips::FailOn] :fail_on Error level to fail on -# @option opts [Vips::ForeignFlags] :flags Output Flags for this file -# @return [Vips::Image, Hash Object>] Output image, Hash of optional output items - -# @!method self.jxlload_buffer(buffer, **opts) -# Load jpeg-xl image. -# @param buffer [VipsBlob] Buffer to load from -# @param opts [Hash] Set of options -# @option opts [Boolean] :memory Force open via memory -# @option opts [Vips::Access] :access Required access pattern for this file -# @option opts [Vips::FailOn] :fail_on Error level to fail on -# @option opts [Vips::ForeignFlags] :flags Output Flags for this file -# @return [Vips::Image, Hash Object>] Output image, Hash of optional output items - -# @!method self.jxlload_source(source, **opts) -# Load jpeg-xl image. -# @param source [Vips::Source] Source to load from -# @param opts [Hash] Set of options -# @option opts [Boolean] :memory Force open via memory -# @option opts [Vips::Access] :access Required access pattern for this file -# @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items @@ -1137,6 +1083,7 @@ class Image # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items @@ -1148,6 +1095,7 @@ class Image # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items @@ -1159,6 +1107,7 @@ class Image # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items @@ -1166,11 +1115,12 @@ class Image # Load gif with libnsgif. # @param filename [String] Filename to load from # @param opts [Hash] Set of options -# @option opts [Integer] :n Load this many pages -# @option opts [Integer] :page Load this page from the file +# @option opts [Integer] :n Number of pages to load, -1 for all +# @option opts [Integer] :page First page to load # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items @@ -1178,11 +1128,12 @@ class Image # Load gif with libnsgif. # @param buffer [VipsBlob] Buffer to load from # @param opts [Hash] Set of options -# @option opts [Integer] :n Load this many pages -# @option opts [Integer] :page Load this page from the file +# @option opts [Integer] :n Number of pages to load, -1 for all +# @option opts [Integer] :page First page to load # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items @@ -1190,11 +1141,12 @@ class Image # Load gif from source. # @param source [Vips::Source] Source to load from # @param opts [Hash] Set of options -# @option opts [Integer] :n Load this many pages -# @option opts [Integer] :page Load this page from the file +# @option opts [Integer] :n Number of pages to load, -1 for all +# @option opts [Integer] :page First page to load # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items @@ -1206,6 +1158,7 @@ class Image # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items @@ -1217,6 +1170,7 @@ class Image # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items @@ -1228,6 +1182,7 @@ class Image # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items @@ -1238,6 +1193,7 @@ class Image # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items @@ -1247,9 +1203,11 @@ class Image # @param opts [Hash] Set of options # @option opts [Integer] :shrink Shrink factor on load # @option opts [Boolean] :autorotate Rotate image using exif orientation +# @option opts [Boolean] :unlimited Remove all denial of service limits # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items @@ -1259,9 +1217,11 @@ class Image # @param opts [Hash] Set of options # @option opts [Integer] :shrink Shrink factor on load # @option opts [Boolean] :autorotate Rotate image using exif orientation +# @option opts [Boolean] :unlimited Remove all denial of service limits # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items @@ -1271,9 +1231,11 @@ class Image # @param opts [Hash] Set of options # @option opts [Integer] :shrink Shrink factor on load # @option opts [Boolean] :autorotate Rotate image using exif orientation +# @option opts [Boolean] :unlimited Remove all denial of service limits # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items @@ -1281,12 +1243,13 @@ class Image # Load webp from file. # @param filename [String] Filename to load from # @param opts [Hash] Set of options -# @option opts [Integer] :page Load this page from the file -# @option opts [Integer] :n Load this many pages -# @option opts [Float] :scale Scale factor on load +# @option opts [Integer] :page First page to load +# @option opts [Integer] :n Number of pages to load, -1 for all +# @option opts [Float] :scale Factor to scale by # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items @@ -1294,12 +1257,13 @@ class Image # Load webp from buffer. # @param buffer [VipsBlob] Buffer to load from # @param opts [Hash] Set of options -# @option opts [Integer] :page Load this page from the file -# @option opts [Integer] :n Load this many pages -# @option opts [Float] :scale Scale factor on load +# @option opts [Integer] :page First page to load +# @option opts [Integer] :n Number of pages to load, -1 for all +# @option opts [Float] :scale Factor to scale by # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items @@ -1307,12 +1271,13 @@ class Image # Load webp from source. # @param source [Vips::Source] Source to load from # @param opts [Hash] Set of options -# @option opts [Integer] :page Load this page from the file -# @option opts [Integer] :n Load this many pages -# @option opts [Float] :scale Scale factor on load +# @option opts [Integer] :page First page to load +# @option opts [Integer] :n Number of pages to load, -1 for all +# @option opts [Float] :scale Factor to scale by # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items @@ -1320,13 +1285,14 @@ class Image # Load tiff from file. # @param filename [String] Filename to load from # @param opts [Hash] Set of options -# @option opts [Integer] :page Load this page from the image -# @option opts [Integer] :subifd Select subifd index -# @option opts [Integer] :n Load this many pages +# @option opts [Integer] :page First page to load +# @option opts [Integer] :subifd Subifd index +# @option opts [Integer] :n Number of pages to load, -1 for all # @option opts [Boolean] :autorotate Rotate image using orientation tag # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items @@ -1334,13 +1300,14 @@ class Image # Load tiff from buffer. # @param buffer [VipsBlob] Buffer to load from # @param opts [Hash] Set of options -# @option opts [Integer] :page Load this page from the image -# @option opts [Integer] :subifd Select subifd index -# @option opts [Integer] :n Load this many pages +# @option opts [Integer] :page First page to load +# @option opts [Integer] :subifd Subifd index +# @option opts [Integer] :n Number of pages to load, -1 for all # @option opts [Boolean] :autorotate Rotate image using orientation tag # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items @@ -1348,13 +1315,69 @@ class Image # Load tiff from source. # @param source [Vips::Source] Source to load from # @param opts [Hash] Set of options -# @option opts [Integer] :page Load this page from the image -# @option opts [Integer] :subifd Select subifd index -# @option opts [Integer] :n Load this many pages +# @option opts [Integer] :page First page to load +# @option opts [Integer] :subifd Subifd index +# @option opts [Integer] :n Number of pages to load, -1 for all # @option opts [Boolean] :autorotate Rotate image using orientation tag # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation +# @option opts [Vips::ForeignFlags] :flags Output Flags for this file +# @return [Vips::Image, Hash Object>] Output image, Hash of optional output items + +# @!method self.fitsload(filename, **opts) +# Load a fits image. +# @param filename [String] Filename to load from +# @param opts [Hash] Set of options +# @option opts [Boolean] :memory Force open via memory +# @option opts [Vips::Access] :access Required access pattern for this file +# @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation +# @option opts [Vips::ForeignFlags] :flags Output Flags for this file +# @return [Vips::Image, Hash Object>] Output image, Hash of optional output items + +# @!method self.fitsload_source(source, **opts) +# Load fits from a source. +# @param source [Vips::Source] Source to load from +# @param opts [Hash] Set of options +# @option opts [Boolean] :memory Force open via memory +# @option opts [Vips::Access] :access Required access pattern for this file +# @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation +# @option opts [Vips::ForeignFlags] :flags Output Flags for this file +# @return [Vips::Image, Hash Object>] Output image, Hash of optional output items + +# @!method self.openexrload(filename, **opts) +# Load an openexr image. +# @param filename [String] Filename to load from +# @param opts [Hash] Set of options +# @option opts [Boolean] :memory Force open via memory +# @option opts [Vips::Access] :access Required access pattern for this file +# @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation +# @option opts [Vips::ForeignFlags] :flags Output Flags for this file +# @return [Vips::Image, Hash Object>] Output image, Hash of optional output items + +# @!method self.niftiload(filename, **opts) +# Load nifti volume. +# @param filename [String] Filename to load from +# @param opts [Hash] Set of options +# @option opts [Boolean] :memory Force open via memory +# @option opts [Vips::Access] :access Required access pattern for this file +# @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation +# @option opts [Vips::ForeignFlags] :flags Output Flags for this file +# @return [Vips::Image, Hash Object>] Output image, Hash of optional output items + +# @!method self.niftiload_source(source, **opts) +# Load nifti volumes. +# @param source [Vips::Source] Source to load from +# @param opts [Hash] Set of options +# @option opts [Boolean] :memory Force open via memory +# @option opts [Vips::Access] :access Required access pattern for this file +# @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items @@ -1362,13 +1385,15 @@ class Image # Load file with openslide. # @param filename [String] Filename to load from # @param opts [Hash] Set of options -# @option opts [Boolean] :attach_associated Attach all associated images # @option opts [Integer] :level Load this level from the file # @option opts [Boolean] :autocrop Crop to image bounds # @option opts [String] :associated Load this associated image +# @option opts [Boolean] :attach_associated Attach all associated images +# @option opts [Boolean] :rgb Output RGB (not RGBA) # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items @@ -1376,128 +1401,172 @@ class Image # Load source with openslide. # @param source [Vips::Source] Source to load from # @param opts [Hash] Set of options -# @option opts [Boolean] :attach_associated Attach all associated images # @option opts [Integer] :level Load this level from the file # @option opts [Boolean] :autocrop Crop to image bounds # @option opts [String] :associated Load this associated image +# @option opts [Boolean] :attach_associated Attach all associated images +# @option opts [Boolean] :rgb Output RGB (not RGBA) # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items -# @!method self.magickload(filename, **opts) -# Load file with imagemagick. +# @!method self.heifload(filename, **opts) +# Load a heif image. # @param filename [String] Filename to load from # @param opts [Hash] Set of options -# @option opts [String] :density Canvas resolution for rendering vector formats like SVG -# @option opts [Integer] :page Load this page from the file -# @option opts [Integer] :n Load this many pages +# @option opts [Integer] :page First page to load +# @option opts [Integer] :n Number of pages to load, -1 for all +# @option opts [Boolean] :thumbnail Fetch thumbnail image +# @option opts [Boolean] :unlimited Remove all denial of service limits # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items -# @!method self.magickload_buffer(buffer, **opts) -# Load buffer with imagemagick. +# @!method self.heifload_buffer(buffer, **opts) +# Load a heif image. # @param buffer [VipsBlob] Buffer to load from # @param opts [Hash] Set of options -# @option opts [String] :density Canvas resolution for rendering vector formats like SVG -# @option opts [Integer] :page Load this page from the file -# @option opts [Integer] :n Load this many pages +# @option opts [Integer] :page First page to load +# @option opts [Integer] :n Number of pages to load, -1 for all +# @option opts [Boolean] :thumbnail Fetch thumbnail image +# @option opts [Boolean] :unlimited Remove all denial of service limits # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items -# @!method self.fitsload(filename, **opts) -# Load a fits image. +# @!method self.heifload_source(source, **opts) +# Load a heif image. +# @param source [Vips::Source] Source to load from +# @param opts [Hash] Set of options +# @option opts [Integer] :page First page to load +# @option opts [Integer] :n Number of pages to load, -1 for all +# @option opts [Boolean] :thumbnail Fetch thumbnail image +# @option opts [Boolean] :unlimited Remove all denial of service limits +# @option opts [Boolean] :memory Force open via memory +# @option opts [Vips::Access] :access Required access pattern for this file +# @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation +# @option opts [Vips::ForeignFlags] :flags Output Flags for this file +# @return [Vips::Image, Hash Object>] Output image, Hash of optional output items + +# @!method self.jxlload(filename, **opts) +# Load jpeg-xl image. # @param filename [String] Filename to load from # @param opts [Hash] Set of options # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items -# @!method self.fitsload_source(source, **opts) -# Load fits from a source. -# @param source [Vips::Source] Source to load from +# @!method self.jxlload_buffer(buffer, **opts) +# Load jpeg-xl image. +# @param buffer [VipsBlob] Buffer to load from # @param opts [Hash] Set of options # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items -# @!method self.openexrload(filename, **opts) -# Load an openexr image. -# @param filename [String] Filename to load from +# @!method self.jxlload_source(source, **opts) +# Load jpeg-xl image. +# @param source [Vips::Source] Source to load from # @param opts [Hash] Set of options # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items -# @!method self.niftiload(filename, **opts) -# Load nifti volume. +# @!method self.pdfload(filename, **opts) +# Load pdf from file. # @param filename [String] Filename to load from # @param opts [Hash] Set of options +# @option opts [Integer] :page First page to load +# @option opts [Integer] :n Number of pages to load, -1 for all +# @option opts [Float] :dpi DPI to render at +# @option opts [Float] :scale Factor to scale by +# @option opts [Array] :background Background colour +# @option opts [String] :password Password to decrypt with # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items -# @!method self.niftiload_source(source, **opts) -# Load nifti volumes. -# @param source [Vips::Source] Source to load from +# @!method self.pdfload_buffer(buffer, **opts) +# Load pdf from buffer. +# @param buffer [VipsBlob] Buffer to load from # @param opts [Hash] Set of options +# @option opts [Integer] :page First page to load +# @option opts [Integer] :n Number of pages to load, -1 for all +# @option opts [Float] :dpi DPI to render at +# @option opts [Float] :scale Factor to scale by +# @option opts [Array] :background Background colour +# @option opts [String] :password Password to decrypt with # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items -# @!method self.heifload(filename, **opts) -# Load a heif image. -# @param filename [String] Filename to load from +# @!method self.pdfload_source(source, **opts) +# Load pdf from source. +# @param source [Vips::Source] Source to load from # @param opts [Hash] Set of options -# @option opts [Integer] :page Load this page from the file -# @option opts [Integer] :n Load this many pages -# @option opts [Boolean] :thumbnail Fetch thumbnail image +# @option opts [Integer] :page First page to load +# @option opts [Integer] :n Number of pages to load, -1 for all +# @option opts [Float] :dpi DPI to render at +# @option opts [Float] :scale Factor to scale by +# @option opts [Array] :background Background colour +# @option opts [String] :password Password to decrypt with # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items -# @!method self.heifload_buffer(buffer, **opts) -# Load a heif image. -# @param buffer [VipsBlob] Buffer to load from +# @!method self.magickload(filename, **opts) +# Load file with imagemagick. +# @param filename [String] Filename to load from # @param opts [Hash] Set of options -# @option opts [Integer] :page Load this page from the file -# @option opts [Integer] :n Load this many pages -# @option opts [Boolean] :thumbnail Fetch thumbnail image +# @option opts [String] :density Canvas resolution for rendering vector formats like SVG +# @option opts [Integer] :page First page to load +# @option opts [Integer] :n Number of pages to load, -1 for all # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items -# @!method self.heifload_source(source, **opts) -# Load a heif image. -# @param source [Vips::Source] Source to load from +# @!method self.magickload_buffer(buffer, **opts) +# Load buffer with imagemagick. +# @param buffer [VipsBlob] Buffer to load from # @param opts [Hash] Set of options -# @option opts [Integer] :page Load this page from the file -# @option opts [Integer] :n Load this many pages -# @option opts [Boolean] :thumbnail Fetch thumbnail image +# @option opts [String] :density Canvas resolution for rendering vector formats like SVG +# @option opts [Integer] :page First page to load +# @option opts [Integer] :n Number of pages to load, -1 for all # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on +# @option opts [Boolean] :revalidate Don't use a cached result for this operation # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items @@ -1505,8 +1574,9 @@ class Image # Save image to csv. # @param filename [String] Filename to save to # @param opts [Hash] Set of options +# @option opts [String] :profile Filename of ICC profile to embed # @option opts [String] :separator Separator characters -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [nil] @@ -1515,8 +1585,9 @@ class Image # Save image to csv. # @param target [Vips::Target] Target to save to # @param opts [Hash] Set of options +# @option opts [String] :profile Filename of ICC profile to embed # @option opts [String] :separator Separator characters -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [nil] @@ -1525,7 +1596,8 @@ class Image # Save image to matrix. # @param filename [String] Filename to save to # @param opts [Hash] Set of options -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [String] :profile Filename of ICC profile to embed +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [nil] @@ -1534,7 +1606,8 @@ class Image # Save image to matrix. # @param target [Vips::Target] Target to save to # @param opts [Hash] Set of options -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [String] :profile Filename of ICC profile to embed +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [nil] @@ -1542,7 +1615,8 @@ class Image # @!method matrixprint(**opts) # Print matrix. # @param opts [Hash] Set of options -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [String] :profile Filename of ICC profile to embed +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [nil] @@ -1551,7 +1625,8 @@ class Image # Save image to raw file. # @param filename [String] Filename to save to # @param opts [Hash] Set of options -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [String] :profile Filename of ICC profile to embed +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [nil] @@ -1560,7 +1635,8 @@ class Image # Write raw image to file descriptor. # @param fd [Integer] File descriptor to write to # @param opts [Hash] Set of options -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [String] :profile Filename of ICC profile to embed +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [nil] @@ -1569,7 +1645,8 @@ class Image # Save image to file in vips format. # @param filename [String] Filename to save to # @param opts [Hash] Set of options -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [String] :profile Filename of ICC profile to embed +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [nil] @@ -1578,7 +1655,8 @@ class Image # Save image to target in vips format. # @param target [Vips::Target] Target to save to # @param opts [Hash] Set of options -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [String] :profile Filename of ICC profile to embed +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [nil] @@ -1588,9 +1666,10 @@ class Image # @param filename [String] Filename to save to # @param opts [Hash] Set of options # @option opts [Vips::ForeignPpmFormat] :format Format to save in -# @option opts [Boolean] :ascii save as ascii -# @option opts [Integer] :bitdepth set to 1 to write as a 1 bit image -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [Boolean] :ascii Save as ascii +# @option opts [String] :profile Filename of ICC profile to embed +# @option opts [Integer] :bitdepth Set to 1 to write as a 1 bit image +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [nil] @@ -1600,9 +1679,10 @@ class Image # @param target [Vips::Target] Target to save to # @param opts [Hash] Set of options # @option opts [Vips::ForeignPpmFormat] :format Format to save in -# @option opts [Boolean] :ascii save as ascii -# @option opts [Integer] :bitdepth set to 1 to write as a 1 bit image -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [Boolean] :ascii Save as ascii +# @option opts [String] :profile Filename of ICC profile to embed +# @option opts [Integer] :bitdepth Set to 1 to write as a 1 bit image +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [nil] @@ -1611,7 +1691,8 @@ class Image # Save image to radiance file. # @param filename [String] Filename to save to # @param opts [Hash] Set of options -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [String] :profile Filename of ICC profile to embed +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [nil] @@ -1619,7 +1700,8 @@ class Image # @!method radsave_buffer(**opts) # Save image to radiance buffer. # @param opts [Hash] Set of options -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [String] :profile Filename of ICC profile to embed +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [VipsBlob] Buffer to save to @@ -1628,48 +1710,8 @@ class Image # Save image to radiance target. # @param target [Vips::Target] Target to save to # @param opts [Hash] Set of options -# @option opts [Boolean] :strip Strip all metadata from image -# @option opts [Array] :background Background value -# @option opts [Integer] :page_height Set page height for multipage save -# @return [nil] - -# @!method jxlsave(filename, **opts) -# Save image in jpeg-xl format. -# @param filename [String] Filename to load from -# @param opts [Hash] Set of options -# @option opts [Integer] :tier Decode speed tier -# @option opts [Float] :distance Target butteraugli distance -# @option opts [Integer] :effort Encoding effort -# @option opts [Boolean] :lossless Enable lossless compression -# @option opts [Integer] :Q Quality factor -# @option opts [Boolean] :strip Strip all metadata from image -# @option opts [Array] :background Background value -# @option opts [Integer] :page_height Set page height for multipage save -# @return [nil] - -# @!method jxlsave_buffer(**opts) -# Save image in jpeg-xl format. -# @param opts [Hash] Set of options -# @option opts [Integer] :tier Decode speed tier -# @option opts [Float] :distance Target butteraugli distance -# @option opts [Integer] :effort Encoding effort -# @option opts [Boolean] :lossless Enable lossless compression -# @option opts [Integer] :Q Quality factor -# @option opts [Boolean] :strip Strip all metadata from image -# @option opts [Array] :background Background value -# @option opts [Integer] :page_height Set page height for multipage save -# @return [VipsBlob] Buffer to save to - -# @!method jxlsave_target(target, **opts) -# Save image in jpeg-xl format. -# @param target [Vips::Target] Target to save to -# @param opts [Hash] Set of options -# @option opts [Integer] :tier Decode speed tier -# @option opts [Float] :distance Target butteraugli distance -# @option opts [Integer] :effort Encoding effort -# @option opts [Boolean] :lossless Enable lossless compression -# @option opts [Integer] :Q Quality factor -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [String] :profile Filename of ICC profile to embed +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [nil] @@ -1679,11 +1721,12 @@ class Image # @param filename [String] Filename to load from # @param opts [Hash] Set of options # @option opts [Integer] :tile_width Tile width in pixels +# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Integer] :tile_height Tile height in pixels # @option opts [Boolean] :lossless Enable lossless compression # @option opts [Integer] :Q Q factor # @option opts [Vips::ForeignSubsample] :subsample_mode Select chroma subsample operation mode -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [nil] @@ -1692,11 +1735,12 @@ class Image # Save image in jpeg2000 format. # @param opts [Hash] Set of options # @option opts [Integer] :tile_width Tile width in pixels +# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Integer] :tile_height Tile height in pixels # @option opts [Boolean] :lossless Enable lossless compression # @option opts [Integer] :Q Q factor # @option opts [Vips::ForeignSubsample] :subsample_mode Select chroma subsample operation mode -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [VipsBlob] Buffer to save to @@ -1706,11 +1750,12 @@ class Image # @param target [Vips::Target] Target to save to # @param opts [Hash] Set of options # @option opts [Integer] :tile_width Tile width in pixels +# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Integer] :tile_height Tile height in pixels # @option opts [Boolean] :lossless Enable lossless compression # @option opts [Integer] :Q Q factor # @option opts [Vips::ForeignSubsample] :subsample_mode Select chroma subsample operation mode -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [nil] @@ -1721,8 +1766,13 @@ class Image # @param opts [Hash] Set of options # @option opts [Float] :dither Amount of dithering # @option opts [Integer] :effort Quantisation effort +# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Integer] :bitdepth Number of bits per pixel -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [Float] :interframe_maxerror Maximum inter-frame error for transparency +# @option opts [Boolean] :reuse Reuse palette from input +# @option opts [Float] :interpalette_maxerror Maximum inter-palette error for palette reusage +# @option opts [Boolean] :interlace Generate an interlaced (progressive) GIF +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [nil] @@ -1732,8 +1782,13 @@ class Image # @param opts [Hash] Set of options # @option opts [Float] :dither Amount of dithering # @option opts [Integer] :effort Quantisation effort +# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Integer] :bitdepth Number of bits per pixel -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [Float] :interframe_maxerror Maximum inter-frame error for transparency +# @option opts [Boolean] :reuse Reuse palette from input +# @option opts [Float] :interpalette_maxerror Maximum inter-palette error for palette reusage +# @option opts [Boolean] :interlace Generate an interlaced (progressive) GIF +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [VipsBlob] Buffer to save to @@ -1744,8 +1799,13 @@ class Image # @param opts [Hash] Set of options # @option opts [Float] :dither Amount of dithering # @option opts [Integer] :effort Quantisation effort +# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Integer] :bitdepth Number of bits per pixel -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [Float] :interframe_maxerror Maximum inter-frame error for transparency +# @option opts [Boolean] :reuse Reuse palette from input +# @option opts [Float] :interpalette_maxerror Maximum inter-palette error for palette reusage +# @option opts [Boolean] :interlace Generate an interlaced (progressive) GIF +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [nil] @@ -1754,22 +1814,22 @@ class Image # Save image to deepzoom file. # @param filename [String] Filename to save to # @param opts [Hash] Set of options -# @option opts [String] :basename Base name to save to +# @option opts [String] :imagename Image name # @option opts [Vips::ForeignDzLayout] :layout Directory layout # @option opts [String] :suffix Filename suffix for tiles # @option opts [Integer] :overlap Tile overlap in pixels # @option opts [Integer] :tile_size Tile size in pixels +# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Boolean] :centre Center image in tile # @option opts [Vips::ForeignDzDepth] :depth Pyramid depth # @option opts [Vips::Angle] :angle Rotate image during save # @option opts [Vips::ForeignDzContainer] :container Pyramid container type -# @option opts [Boolean] :properties Write a properties file to the output directory # @option opts [Integer] :compression ZIP deflate compression level # @option opts [Vips::RegionShrink] :region_shrink Method to shrink regions # @option opts [Integer] :skip_blanks Skip tiles which are nearly equal to the background -# @option opts [Boolean] :no_strip Don't strip tile metadata # @option opts [String] :id Resource ID -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [Integer] :Q Q factor +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [nil] @@ -1777,40 +1837,64 @@ class Image # @!method dzsave_buffer(**opts) # Save image to dz buffer. # @param opts [Hash] Set of options -# @option opts [String] :basename Base name to save to +# @option opts [String] :imagename Image name # @option opts [Vips::ForeignDzLayout] :layout Directory layout # @option opts [String] :suffix Filename suffix for tiles # @option opts [Integer] :overlap Tile overlap in pixels # @option opts [Integer] :tile_size Tile size in pixels +# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Boolean] :centre Center image in tile # @option opts [Vips::ForeignDzDepth] :depth Pyramid depth # @option opts [Vips::Angle] :angle Rotate image during save # @option opts [Vips::ForeignDzContainer] :container Pyramid container type -# @option opts [Boolean] :properties Write a properties file to the output directory # @option opts [Integer] :compression ZIP deflate compression level # @option opts [Vips::RegionShrink] :region_shrink Method to shrink regions # @option opts [Integer] :skip_blanks Skip tiles which are nearly equal to the background -# @option opts [Boolean] :no_strip Don't strip tile metadata # @option opts [String] :id Resource ID -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [Integer] :Q Q factor +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [VipsBlob] Buffer to save to +# @!method dzsave_target(target, **opts) +# Save image to deepzoom target. +# @param target [Vips::Target] Target to save to +# @param opts [Hash] Set of options +# @option opts [String] :imagename Image name +# @option opts [Vips::ForeignDzLayout] :layout Directory layout +# @option opts [String] :suffix Filename suffix for tiles +# @option opts [Integer] :overlap Tile overlap in pixels +# @option opts [Integer] :tile_size Tile size in pixels +# @option opts [String] :profile Filename of ICC profile to embed +# @option opts [Boolean] :centre Center image in tile +# @option opts [Vips::ForeignDzDepth] :depth Pyramid depth +# @option opts [Vips::Angle] :angle Rotate image during save +# @option opts [Vips::ForeignDzContainer] :container Pyramid container type +# @option opts [Integer] :compression ZIP deflate compression level +# @option opts [Vips::RegionShrink] :region_shrink Method to shrink regions +# @option opts [Integer] :skip_blanks Skip tiles which are nearly equal to the background +# @option opts [String] :id Resource ID +# @option opts [Integer] :Q Q factor +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain +# @option opts [Array] :background Background value +# @option opts [Integer] :page_height Set page height for multipage save +# @return [nil] + # @!method pngsave(filename, **opts) # Save image to png file. # @param filename [String] Filename to save to # @param opts [Hash] Set of options # @option opts [Integer] :compression Compression factor # @option opts [Boolean] :interlace Interlace image -# @option opts [String] :profile ICC profile to embed +# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Vips::ForeignPngFilter] :filter libpng row filter flag(s) # @option opts [Boolean] :palette Quantise to 8bpp palette # @option opts [Integer] :Q Quantisation quality # @option opts [Float] :dither Amount of dithering -# @option opts [Integer] :bitdepth Write as a 1, 2, 4 or 8 bit image +# @option opts [Integer] :bitdepth Write as a 1, 2, 4, 8 or 16 bit image # @option opts [Integer] :effort Quantisation CPU effort -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [nil] @@ -1820,14 +1904,14 @@ class Image # @param opts [Hash] Set of options # @option opts [Integer] :compression Compression factor # @option opts [Boolean] :interlace Interlace image -# @option opts [String] :profile ICC profile to embed +# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Vips::ForeignPngFilter] :filter libpng row filter flag(s) # @option opts [Boolean] :palette Quantise to 8bpp palette # @option opts [Integer] :Q Quantisation quality # @option opts [Float] :dither Amount of dithering -# @option opts [Integer] :bitdepth Write as a 1, 2, 4 or 8 bit image +# @option opts [Integer] :bitdepth Write as a 1, 2, 4, 8 or 16 bit image # @option opts [Integer] :effort Quantisation CPU effort -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [VipsBlob] Buffer to save to @@ -1838,14 +1922,14 @@ class Image # @param opts [Hash] Set of options # @option opts [Integer] :compression Compression factor # @option opts [Boolean] :interlace Interlace image -# @option opts [String] :profile ICC profile to embed +# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Vips::ForeignPngFilter] :filter libpng row filter flag(s) # @option opts [Boolean] :palette Quantise to 8bpp palette # @option opts [Integer] :Q Quantisation quality # @option opts [Float] :dither Amount of dithering -# @option opts [Integer] :bitdepth Write as a 1, 2, 4 or 8 bit image +# @option opts [Integer] :bitdepth Write as a 1, 2, 4, 8 or 16 bit image # @option opts [Integer] :effort Quantisation CPU effort -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [nil] @@ -1855,7 +1939,7 @@ class Image # @param filename [String] Filename to save to # @param opts [Hash] Set of options # @option opts [Integer] :Q Q factor -# @option opts [String] :profile ICC profile to embed +# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Boolean] :optimize_coding Compute optimal Huffman coding tables # @option opts [Boolean] :interlace Generate an interlaced (progressive) jpeg # @option opts [Boolean] :trellis_quant Apply trellis quantisation to each 8x8 block @@ -1864,7 +1948,7 @@ class Image # @option opts [Integer] :quant_table Use predefined quantization table with given index # @option opts [Vips::ForeignSubsample] :subsample_mode Select chroma subsample operation mode # @option opts [Integer] :restart_interval Add restart markers every specified number of mcu -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [nil] @@ -1873,7 +1957,7 @@ class Image # Save image to jpeg buffer. # @param opts [Hash] Set of options # @option opts [Integer] :Q Q factor -# @option opts [String] :profile ICC profile to embed +# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Boolean] :optimize_coding Compute optimal Huffman coding tables # @option opts [Boolean] :interlace Generate an interlaced (progressive) jpeg # @option opts [Boolean] :trellis_quant Apply trellis quantisation to each 8x8 block @@ -1882,7 +1966,7 @@ class Image # @option opts [Integer] :quant_table Use predefined quantization table with given index # @option opts [Vips::ForeignSubsample] :subsample_mode Select chroma subsample operation mode # @option opts [Integer] :restart_interval Add restart markers every specified number of mcu -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [VipsBlob] Buffer to save to @@ -1892,7 +1976,7 @@ class Image # @param target [Vips::Target] Target to save to # @param opts [Hash] Set of options # @option opts [Integer] :Q Q factor -# @option opts [String] :profile ICC profile to embed +# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Boolean] :optimize_coding Compute optimal Huffman coding tables # @option opts [Boolean] :interlace Generate an interlaced (progressive) jpeg # @option opts [Boolean] :trellis_quant Apply trellis quantisation to each 8x8 block @@ -1901,7 +1985,7 @@ class Image # @option opts [Integer] :quant_table Use predefined quantization table with given index # @option opts [Vips::ForeignSubsample] :subsample_mode Select chroma subsample operation mode # @option opts [Integer] :restart_interval Add restart markers every specified number of mcu -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [nil] @@ -1910,7 +1994,7 @@ class Image # Save image to jpeg mime. # @param opts [Hash] Set of options # @option opts [Integer] :Q Q factor -# @option opts [String] :profile ICC profile to embed +# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Boolean] :optimize_coding Compute optimal Huffman coding tables # @option opts [Boolean] :interlace Generate an interlaced (progressive) jpeg # @option opts [Boolean] :trellis_quant Apply trellis quantisation to each 8x8 block @@ -1919,66 +2003,89 @@ class Image # @option opts [Integer] :quant_table Use predefined quantization table with given index # @option opts [Vips::ForeignSubsample] :subsample_mode Select chroma subsample operation mode # @option opts [Integer] :restart_interval Add restart markers every specified number of mcu -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [nil] # @!method webpsave(filename, **opts) -# Save image to webp file. +# Save as webp. # @param filename [String] Filename to save to # @param opts [Hash] Set of options # @option opts [Integer] :Q Q factor -# @option opts [Boolean] :lossless enable lossless compression +# @option opts [Boolean] :lossless Enable lossless compression +# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Vips::ForeignWebpPreset] :preset Preset for lossy compression # @option opts [Boolean] :smart_subsample Enable high quality chroma subsampling # @option opts [Boolean] :near_lossless Enable preprocessing in lossless mode (uses Q) # @option opts [Integer] :alpha_q Change alpha plane fidelity for lossy compression -# @option opts [Boolean] :min_size Optimise for minium size +# @option opts [Boolean] :min_size Optimise for minimum size # @option opts [Integer] :kmin Minimum number of frames between key frames # @option opts [Integer] :kmax Maximum number of frames between key frames # @option opts [Integer] :effort Level of CPU effort to reduce file size -# @option opts [String] :profile ICC profile to embed -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [Boolean] :mixed Allow mixed encoding (might reduce file size) +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [nil] # @!method webpsave_buffer(**opts) -# Save image to webp buffer. +# Save as webp. # @param opts [Hash] Set of options # @option opts [Integer] :Q Q factor -# @option opts [Boolean] :lossless enable lossless compression +# @option opts [Boolean] :lossless Enable lossless compression +# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Vips::ForeignWebpPreset] :preset Preset for lossy compression # @option opts [Boolean] :smart_subsample Enable high quality chroma subsampling # @option opts [Boolean] :near_lossless Enable preprocessing in lossless mode (uses Q) # @option opts [Integer] :alpha_q Change alpha plane fidelity for lossy compression -# @option opts [Boolean] :min_size Optimise for minium size +# @option opts [Boolean] :min_size Optimise for minimum size # @option opts [Integer] :kmin Minimum number of frames between key frames # @option opts [Integer] :kmax Maximum number of frames between key frames # @option opts [Integer] :effort Level of CPU effort to reduce file size -# @option opts [String] :profile ICC profile to embed -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [Boolean] :mixed Allow mixed encoding (might reduce file size) +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [VipsBlob] Buffer to save to # @!method webpsave_target(target, **opts) -# Save image to webp target. +# Save as webp. # @param target [Vips::Target] Target to save to # @param opts [Hash] Set of options # @option opts [Integer] :Q Q factor -# @option opts [Boolean] :lossless enable lossless compression +# @option opts [Boolean] :lossless Enable lossless compression +# @option opts [String] :profile Filename of ICC profile to embed +# @option opts [Vips::ForeignWebpPreset] :preset Preset for lossy compression +# @option opts [Boolean] :smart_subsample Enable high quality chroma subsampling +# @option opts [Boolean] :near_lossless Enable preprocessing in lossless mode (uses Q) +# @option opts [Integer] :alpha_q Change alpha plane fidelity for lossy compression +# @option opts [Boolean] :min_size Optimise for minimum size +# @option opts [Integer] :kmin Minimum number of frames between key frames +# @option opts [Integer] :kmax Maximum number of frames between key frames +# @option opts [Integer] :effort Level of CPU effort to reduce file size +# @option opts [Boolean] :mixed Allow mixed encoding (might reduce file size) +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain +# @option opts [Array] :background Background value +# @option opts [Integer] :page_height Set page height for multipage save +# @return [nil] + +# @!method webpsave_mime(**opts) +# Save image to webp mime. +# @param opts [Hash] Set of options +# @option opts [Integer] :Q Q factor +# @option opts [Boolean] :lossless Enable lossless compression +# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Vips::ForeignWebpPreset] :preset Preset for lossy compression # @option opts [Boolean] :smart_subsample Enable high quality chroma subsampling # @option opts [Boolean] :near_lossless Enable preprocessing in lossless mode (uses Q) # @option opts [Integer] :alpha_q Change alpha plane fidelity for lossy compression -# @option opts [Boolean] :min_size Optimise for minium size +# @option opts [Boolean] :min_size Optimise for minimum size # @option opts [Integer] :kmin Minimum number of frames between key frames # @option opts [Integer] :kmax Maximum number of frames between key frames # @option opts [Integer] :effort Level of CPU effort to reduce file size -# @option opts [String] :profile ICC profile to embed -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [Boolean] :mixed Allow mixed encoding (might reduce file size) +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [nil] @@ -1990,9 +2097,9 @@ class Image # @option opts [Vips::ForeignTiffCompression] :compression Compression for this file # @option opts [Integer] :Q Q factor # @option opts [Vips::ForeignTiffPredictor] :predictor Compression prediction -# @option opts [String] :profile ICC profile to embed # @option opts [Boolean] :tile Write a tiled tiff # @option opts [Integer] :tile_width Tile width in pixels +# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Integer] :tile_height Tile height in pixels # @option opts [Boolean] :pyramid Write a pyramidal tiff # @option opts [Boolean] :miniswhite Use 0 for white in 1-bit images @@ -2008,7 +2115,7 @@ class Image # @option opts [Vips::ForeignDzDepth] :depth Pyramid depth # @option opts [Boolean] :subifd Save pyr layers as sub-IFDs # @option opts [Boolean] :premultiply Save with premultiplied alpha -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [nil] @@ -2019,9 +2126,9 @@ class Image # @option opts [Vips::ForeignTiffCompression] :compression Compression for this file # @option opts [Integer] :Q Q factor # @option opts [Vips::ForeignTiffPredictor] :predictor Compression prediction -# @option opts [String] :profile ICC profile to embed # @option opts [Boolean] :tile Write a tiled tiff # @option opts [Integer] :tile_width Tile width in pixels +# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Integer] :tile_height Tile height in pixels # @option opts [Boolean] :pyramid Write a pyramidal tiff # @option opts [Boolean] :miniswhite Use 0 for white in 1-bit images @@ -2037,41 +2144,47 @@ class Image # @option opts [Vips::ForeignDzDepth] :depth Pyramid depth # @option opts [Boolean] :subifd Save pyr layers as sub-IFDs # @option opts [Boolean] :premultiply Save with premultiplied alpha -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [VipsBlob] Buffer to save to -# @!method magicksave(filename, **opts) -# Save file with imagemagick. -# @param filename [String] Filename to save to +# @!method tiffsave_target(target, **opts) +# Save image to tiff target. +# @param target [Vips::Target] Target to save to # @param opts [Hash] Set of options -# @option opts [String] :format Format to save in -# @option opts [Integer] :quality Quality to use -# @option opts [Boolean] :optimize_gif_frames Apply GIF frames optimization -# @option opts [Boolean] :optimize_gif_transparency Apply GIF transparency optimization -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [Vips::ForeignTiffCompression] :compression Compression for this file +# @option opts [Integer] :Q Q factor +# @option opts [Vips::ForeignTiffPredictor] :predictor Compression prediction +# @option opts [Boolean] :tile Write a tiled tiff +# @option opts [Integer] :tile_width Tile width in pixels +# @option opts [String] :profile Filename of ICC profile to embed +# @option opts [Integer] :tile_height Tile height in pixels +# @option opts [Boolean] :pyramid Write a pyramidal tiff +# @option opts [Boolean] :miniswhite Use 0 for white in 1-bit images +# @option opts [Integer] :bitdepth Write as a 1, 2, 4 or 8 bit image +# @option opts [Vips::ForeignTiffResunit] :resunit Resolution unit +# @option opts [Float] :xres Horizontal resolution in pixels/mm +# @option opts [Float] :yres Vertical resolution in pixels/mm +# @option opts [Boolean] :bigtiff Write a bigtiff image +# @option opts [Boolean] :properties Write a properties document to IMAGEDESCRIPTION +# @option opts [Vips::RegionShrink] :region_shrink Method to shrink regions +# @option opts [Integer] :level ZSTD compression level +# @option opts [Boolean] :lossless Enable WEBP lossless mode +# @option opts [Vips::ForeignDzDepth] :depth Pyramid depth +# @option opts [Boolean] :subifd Save pyr layers as sub-IFDs +# @option opts [Boolean] :premultiply Save with premultiplied alpha +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [nil] -# @!method magicksave_buffer(**opts) -# Save image to magick buffer. -# @param opts [Hash] Set of options -# @option opts [String] :format Format to save in -# @option opts [Integer] :quality Quality to use -# @option opts [Boolean] :optimize_gif_frames Apply GIF frames optimization -# @option opts [Boolean] :optimize_gif_transparency Apply GIF transparency optimization -# @option opts [Boolean] :strip Strip all metadata from image -# @option opts [Array] :background Background value -# @option opts [Integer] :page_height Set page height for multipage save -# @return [VipsBlob] Buffer to save to - # @!method fitssave(filename, **opts) # Save image to fits file. # @param filename [String] Filename to save to # @param opts [Hash] Set of options -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [String] :profile Filename of ICC profile to embed +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [nil] @@ -2080,7 +2193,8 @@ class Image # Save image to nifti file. # @param filename [String] Filename to save to # @param opts [Hash] Set of options -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [String] :profile Filename of ICC profile to embed +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [nil] @@ -2090,11 +2204,14 @@ class Image # @param filename [String] Filename to save to # @param opts [Hash] Set of options # @option opts [Integer] :Q Q factor +# @option opts [Integer] :bitdepth Number of bits per pixel +# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Boolean] :lossless Enable lossless compression # @option opts [Vips::ForeignHeifCompression] :compression Compression format # @option opts [Integer] :effort CPU effort # @option opts [Vips::ForeignSubsample] :subsample_mode Select chroma subsample operation mode -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [Vips::ForeignHeifEncoder] :encoder Select encoder to use +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [nil] @@ -2103,11 +2220,14 @@ class Image # Save image in heif format. # @param opts [Hash] Set of options # @option opts [Integer] :Q Q factor +# @option opts [Integer] :bitdepth Number of bits per pixel +# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Boolean] :lossless Enable lossless compression # @option opts [Vips::ForeignHeifCompression] :compression Compression format # @option opts [Integer] :effort CPU effort # @option opts [Vips::ForeignSubsample] :subsample_mode Select chroma subsample operation mode -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [Vips::ForeignHeifEncoder] :encoder Select encoder to use +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [VipsBlob] Buffer to save to @@ -2117,15 +2237,91 @@ class Image # @param target [Vips::Target] Target to save to # @param opts [Hash] Set of options # @option opts [Integer] :Q Q factor +# @option opts [Integer] :bitdepth Number of bits per pixel +# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Boolean] :lossless Enable lossless compression # @option opts [Vips::ForeignHeifCompression] :compression Compression format # @option opts [Integer] :effort CPU effort # @option opts [Vips::ForeignSubsample] :subsample_mode Select chroma subsample operation mode -# @option opts [Boolean] :strip Strip all metadata from image +# @option opts [Vips::ForeignHeifEncoder] :encoder Select encoder to use +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain +# @option opts [Array] :background Background value +# @option opts [Integer] :page_height Set page height for multipage save +# @return [nil] + +# @!method jxlsave(filename, **opts) +# Save image in jpeg-xl format. +# @param filename [String] Filename to load from +# @param opts [Hash] Set of options +# @option opts [Integer] :tier Decode speed tier +# @option opts [Float] :distance Target butteraugli distance +# @option opts [String] :profile Filename of ICC profile to embed +# @option opts [Integer] :effort Encoding effort +# @option opts [Boolean] :lossless Enable lossless compression +# @option opts [Integer] :Q Quality factor +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save # @return [nil] +# @!method jxlsave_buffer(**opts) +# Save image in jpeg-xl format. +# @param opts [Hash] Set of options +# @option opts [Integer] :tier Decode speed tier +# @option opts [Float] :distance Target butteraugli distance +# @option opts [String] :profile Filename of ICC profile to embed +# @option opts [Integer] :effort Encoding effort +# @option opts [Boolean] :lossless Enable lossless compression +# @option opts [Integer] :Q Quality factor +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain +# @option opts [Array] :background Background value +# @option opts [Integer] :page_height Set page height for multipage save +# @return [VipsBlob] Buffer to save to + +# @!method jxlsave_target(target, **opts) +# Save image in jpeg-xl format. +# @param target [Vips::Target] Target to save to +# @param opts [Hash] Set of options +# @option opts [Integer] :tier Decode speed tier +# @option opts [Float] :distance Target butteraugli distance +# @option opts [String] :profile Filename of ICC profile to embed +# @option opts [Integer] :effort Encoding effort +# @option opts [Boolean] :lossless Enable lossless compression +# @option opts [Integer] :Q Quality factor +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain +# @option opts [Array] :background Background value +# @option opts [Integer] :page_height Set page height for multipage save +# @return [nil] + +# @!method magicksave(filename, **opts) +# Save file with imagemagick. +# @param filename [String] Filename to save to +# @param opts [Hash] Set of options +# @option opts [String] :format Format to save in +# @option opts [Integer] :quality Quality to use +# @option opts [Boolean] :optimize_gif_frames Apply GIF frames optimization +# @option opts [Boolean] :optimize_gif_transparency Apply GIF transparency optimization +# @option opts [Integer] :bitdepth Number of bits per pixel +# @option opts [String] :profile Filename of ICC profile to embed +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain +# @option opts [Array] :background Background value +# @option opts [Integer] :page_height Set page height for multipage save +# @return [nil] + +# @!method magicksave_buffer(**opts) +# Save image to magick buffer. +# @param opts [Hash] Set of options +# @option opts [String] :format Format to save in +# @option opts [Integer] :quality Quality to use +# @option opts [Boolean] :optimize_gif_frames Apply GIF frames optimization +# @option opts [Boolean] :optimize_gif_transparency Apply GIF transparency optimization +# @option opts [Integer] :bitdepth Number of bits per pixel +# @option opts [String] :profile Filename of ICC profile to embed +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain +# @option opts [Array] :background Background value +# @option opts [Integer] :page_height Set page height for multipage save +# @return [VipsBlob] Buffer to save to + # @!method self.thumbnail(filename, width, **opts) # Generate thumbnail from file. # @param filename [String] Filename to read from @@ -2139,6 +2335,7 @@ class Image # @option opts [String] :import_profile Fallback import profile # @option opts [String] :export_profile Fallback export profile # @option opts [Vips::Intent] :intent Rendering intent +# @option opts [Vips::FailOn] :fail_on Error level to fail on # @return [Vips::Image] Output image # @!method self.thumbnail_buffer(buffer, width, **opts) @@ -2155,6 +2352,7 @@ class Image # @option opts [String] :import_profile Fallback import profile # @option opts [String] :export_profile Fallback export profile # @option opts [Vips::Intent] :intent Rendering intent +# @option opts [Vips::FailOn] :fail_on Error level to fail on # @return [Vips::Image] Output image # @!method thumbnail_image(width, **opts) @@ -2169,6 +2367,7 @@ class Image # @option opts [String] :import_profile Fallback import profile # @option opts [String] :export_profile Fallback export profile # @option opts [Vips::Intent] :intent Rendering intent +# @option opts [Vips::FailOn] :fail_on Error level to fail on # @return [Vips::Image] Output image # @!method self.thumbnail_source(source, width, **opts) @@ -2185,6 +2384,7 @@ class Image # @option opts [String] :import_profile Fallback import profile # @option opts [String] :export_profile Fallback export profile # @option opts [Vips::Intent] :intent Rendering intent +# @option opts [Vips::FailOn] :fail_on Error level to fail on # @return [Vips::Image] Output image # @!method mapim(index, **opts) @@ -2192,6 +2392,9 @@ class Image # @param index [Vips::Image] Index pixels with this # @param opts [Hash] Set of options # @option opts [Vips::Interpolate] :interpolate Interpolate pixels with this +# @option opts [Array] :background Background value +# @option opts [Boolean] :premultiplied Images have premultiplied alpha +# @option opts [Vips::Extend] :extend How to generate the extra pixels # @return [Vips::Image] Output image # @!method shrink(hshrink, vshrink, **opts) @@ -2199,18 +2402,21 @@ class Image # @param hshrink [Float] Horizontal shrink factor # @param vshrink [Float] Vertical shrink factor # @param opts [Hash] Set of options +# @option opts [Boolean] :ceil Round-up output dimensions # @return [Vips::Image] Output image # @!method shrinkh(hshrink, **opts) # Shrink an image horizontally. # @param hshrink [Integer] Horizontal shrink factor # @param opts [Hash] Set of options +# @option opts [Boolean] :ceil Round-up output dimensions # @return [Vips::Image] Output image # @!method shrinkv(vshrink, **opts) # Shrink an image vertically. # @param vshrink [Integer] Vertical shrink factor # @param opts [Hash] Set of options +# @option opts [Boolean] :ceil Round-up output dimensions # @return [Vips::Image] Output image # @!method reduceh(hshrink, **opts) @@ -2218,6 +2424,7 @@ class Image # @param hshrink [Float] Horizontal shrink factor # @param opts [Hash] Set of options # @option opts [Vips::Kernel] :kernel Resampling kernel +# @option opts [Float] :gap Reducing gap # @return [Vips::Image] Output image # @!method reducev(vshrink, **opts) @@ -2225,6 +2432,7 @@ class Image # @param vshrink [Float] Vertical shrink factor # @param opts [Hash] Set of options # @option opts [Vips::Kernel] :kernel Resampling kernel +# @option opts [Float] :gap Reducing gap # @return [Vips::Image] Output image # @!method reduce(hshrink, vshrink, **opts) @@ -2233,6 +2441,7 @@ class Image # @param vshrink [Float] Vertical shrink factor # @param opts [Hash] Set of options # @option opts [Vips::Kernel] :kernel Resampling kernel +# @option opts [Float] :gap Reducing gap # @return [Vips::Image] Output image # @!method quadratic(coeff, **opts) @@ -2287,6 +2496,7 @@ class Image # @param scale [Float] Scale image by this factor # @param opts [Hash] Set of options # @option opts [Vips::Kernel] :kernel Resampling kernel +# @option opts [Float] :gap Reducing gap # @option opts [Float] :vscale Vertical scale image by this factor # @return [Vips::Image] Output image @@ -2339,16 +2549,6 @@ class Image # @param opts [Hash] Set of options # @return [Vips::Image] Output image -# @!method scRGB2XYZ(**opts) -# Transform scrgb to xyz. -# @param opts [Hash] Set of options -# @return [Vips::Image] Output image - -# @!method XYZ2scRGB(**opts) -# Transform xyz to scrgb. -# @param opts [Hash] Set of options -# @return [Vips::Image] Output image - # @!method LabQ2Lab(**opts) # Unpack a labq image to float lab. # @param opts [Hash] Set of options @@ -2459,12 +2659,22 @@ class Image # @param opts [Hash] Set of options # @return [Vips::Image] Output image +# @!method scRGB2XYZ(**opts) +# Transform scrgb to xyz. +# @param opts [Hash] Set of options +# @return [Vips::Image] Output image + # @!method scRGB2BW(**opts) # Convert scrgb to bw. # @param opts [Hash] Set of options # @option opts [Integer] :depth Output device space depth in bits # @return [Vips::Image] Output image +# @!method XYZ2scRGB(**opts) +# Transform xyz to scrgb. +# @param opts [Hash] Set of options +# @return [Vips::Image] Output image + # @!method scRGB2sRGB(**opts) # Convert an scrgb image to srgb. # @param opts [Hash] Set of options @@ -2491,7 +2701,7 @@ class Image # Map an image though a lut. # @param lut [Vips::Image] Look-up table image # @param opts [Hash] Set of options -# @option opts [Integer] :band apply one-band lut to this band of in +# @option opts [Integer] :band Apply one-band lut to this band of in # @return [Vips::Image] Output image # @!method case(cases, **opts) @@ -2604,7 +2814,7 @@ class Image # @return [Vips::Image] Output image # @!method convsep(mask, **opts) -# Seperable convolution operation. +# Separable convolution operation. # @param mask [Vips::Image] Input matrix image # @param opts [Hash] Set of options # @option opts [Vips::Precision] :precision Convolve with this precision @@ -2650,6 +2860,21 @@ class Image # @option opts [Vips::Precision] :precision Convolve with this precision # @return [Vips::Image] Output image +# @!method sobel(**opts) +# Sobel edge detector. +# @param opts [Hash] Set of options +# @return [Vips::Image] Output image + +# @!method scharr(**opts) +# Scharr edge detector. +# @param opts [Hash] Set of options +# @return [Vips::Image] Output image + +# @!method prewitt(**opts) +# Prewitt edge detector. +# @param opts [Hash] Set of options +# @return [Vips::Image] Output image + # @!method canny(**opts) # Canny edge detector. # @param opts [Hash] Set of options @@ -2657,11 +2882,6 @@ class Image # @option opts [Vips::Precision] :precision Convolve with this precision # @return [Vips::Image] Output image -# @!method sobel(**opts) -# Sobel edge detector. -# @param opts [Hash] Set of options -# @return [Vips::Image] Output image - # @!method fwfft(**opts) # Forward fft. # @param opts [Hash] Set of options @@ -2714,7 +2934,7 @@ class Image # @!method labelregions(**opts) # Label regions in an image. # @param opts [Hash] Set of options -# @option opts [Integer] :segments Output Number of discrete contigious regions +# @option opts [Integer] :segments Output Number of discrete contiguous regions # @return [Vips::Image, Hash Object>] Mask of region labels, Hash of optional output items # @!method fill_nearest(**opts) @@ -2772,9 +2992,9 @@ class Image # @option opts [Vips::Image] :test Test pixels in this image # @option opts [Boolean] :equal DrawFlood while equal to edge # @option opts [Integer] :left Output Left edge of modified area -# @option opts [Integer] :top Output top edge of modified area -# @option opts [Integer] :width Output width of modified area -# @option opts [Integer] :height Output height of modified area +# @option opts [Integer] :top Output Top edge of modified area +# @option opts [Integer] :width Output Width of modified area +# @option opts [Integer] :height Output Height of modified area # @return [Vips::Image, Hash Object>] Image to draw on, Hash of optional output items # @!method draw_image(sub, x, y, **opts) @@ -2844,7 +3064,6 @@ class Image # @option opts [Boolean] :search Search to improve tie-points # @option opts [Vips::Interpolate] :interpolate Interpolate pixels with this # @option opts [Integer] :mblend Maximum blend size -# @option opts [Integer] :bandno Band to search for features on # @return [Vips::Image] Output image # @!method matrixinvert(**opts) diff --git a/lib/vips/version.rb b/lib/vips/version.rb index d1f9890e..6d3d8a5f 100644 --- a/lib/vips/version.rb +++ b/lib/vips/version.rb @@ -1,3 +1,3 @@ module Vips - VERSION = "2.1.4" + VERSION = "2.2.0" end From e29944f01cfcc949e7150573d804cfbf1660b583 Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Thu, 30 Nov 2023 09:41:40 +0100 Subject: [PATCH 22/50] CI: Tell dependabot to update GH Actions --- .github/dependabot.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..5ace4600 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" From aaf7e33f4630993507cb6fa03ab867dfe55ccfa8 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Sat, 17 Feb 2024 20:13:44 +0000 Subject: [PATCH 23/50] new_from_source should ref the source object new_from_source needs to ref the ruby source wrapper, since the underlying C object will only ref the C source object also fix some issues in reference handling, and some lint errors see https://github.com/libvips/ruby-vips/issues/384 thanks taylorthurlow --- CHANGELOG.md | 3 +++ VERSION | 2 +- lib/vips/image.rb | 9 ++++++++- lib/vips/interpolate.rb | 6 +++--- lib/vips/mutableimage.rb | 2 +- lib/vips/operation.rb | 25 +++++++++++++++---------- lib/vips/region.rb | 6 +++--- lib/vips/sourcecustom.rb | 2 +- lib/vips/targetcustom.rb | 2 +- lib/vips/version.rb | 2 +- 10 files changed, 37 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba92acbb..8848ddb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## master +* `new_from_source` keeps a ref to the source object [taylorthurlow] +* some fixes to object references system + ## Version 2.2.0 (2023-10-18) * add `draw_point!` [jcupitt] diff --git a/VERSION b/VERSION index ccbccc3d..c043eea7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.2.0 +2.2.1 diff --git a/lib/vips/image.rb b/lib/vips/image.rb index 42ae434b..8d354332 100644 --- a/lib/vips/image.rb +++ b/lib/vips/image.rb @@ -458,7 +458,14 @@ def self.new_from_source source, option_string, **opts loader = Vips.vips_foreign_find_load_source source raise Vips::Error if loader.nil? - Vips::Operation.call loader, [source], opts, option_string + image = Vips::Operation.call loader, [source], opts, option_string + + # keep a secret ref to the source object ... the libvips loader will + # keep a ref to the C source object, but we need the ruby wrapper object + # to stay alive too + image.references << source + + image end def self.matrix_from_array width, height, array diff --git a/lib/vips/interpolate.rb b/lib/vips/interpolate.rb index 7897a5e9..e31450a1 100644 --- a/lib/vips/interpolate.rb +++ b/lib/vips/interpolate.rb @@ -49,10 +49,10 @@ class ManagedStruct < Vips::Object::ManagedStruct def initialize name name = name.to_s if name.is_a? Symbol - ptr = Vips.vips_interpolate_new name - raise Vips::Error if ptr.nil? + pointer = Vips.vips_interpolate_new name + raise Vips::Error if pointer.nil? - super ptr + super(pointer) end end end diff --git a/lib/vips/mutableimage.rb b/lib/vips/mutableimage.rb index 365e61e2..75cc36ad 100644 --- a/lib/vips/mutableimage.rb +++ b/lib/vips/mutableimage.rb @@ -58,7 +58,7 @@ def initialize(image) # See also the comment on set_type! before changing this. pointer = copy_image.ptr ::GObject.g_object_ref pointer - super pointer + super(pointer) # and save the copy ready for when we finish mutating @image = copy_image diff --git a/lib/vips/operation.rb b/lib/vips/operation.rb index 9bc14d85..aebe5981 100644 --- a/lib/vips/operation.rb +++ b/lib/vips/operation.rb @@ -218,7 +218,7 @@ def initialize value raise Vips::Error if value.null? end - super value + super(value) end def build @@ -283,7 +283,7 @@ def set name, value, match_image, flags, gtype, destructive value = value.map { |x| Operation.imageize match_image, x } end - super name, value + super(name, value) end public @@ -440,14 +440,12 @@ def self.call name, supplied, optional = {}, option_string = "" end end - # collect a list of all input references here - references = Set.new + # dedupe all input references here + deduped_references = Set.new add_reference = lambda do |x| if x.is_a?(Vips::Image) - x.references.each do |i| - references << i - end + deduped_references.merge x.references end false end @@ -482,20 +480,27 @@ def self.call name, supplied, optional = {}, option_string = "" op = op.build + # we need an array of references for output objects + references = deduped_references.to_a + # attach all input refs to output x set_reference = lambda do |x| + # stop early if there are no refs to attach + return true if references == [] + if x.is_a? Vips::Image - x.references += references + references.each { |i| x.references << i } end + false end # get all required results result = [] required_output.each do |details| - value = details[:arg_name] + value = op.get(details[:arg_name]) flat_find value, &set_reference - result << op.get(value) + result << value end # fetch all optional ones diff --git a/lib/vips/region.rb b/lib/vips/region.rb index 92d08a0d..31479db7 100644 --- a/lib/vips/region.rb +++ b/lib/vips/region.rb @@ -44,10 +44,10 @@ class ManagedStruct < Vips::Object::ManagedStruct end def initialize(name) - ptr = Vips.vips_region_new name - raise Vips::Error if ptr.null? + pointer = Vips.vips_region_new name + raise Vips::Error if pointer.null? - super ptr + super(pointer) end def width diff --git a/lib/vips/sourcecustom.rb b/lib/vips/sourcecustom.rb index 48d5a05c..9e1c5e7b 100644 --- a/lib/vips/sourcecustom.rb +++ b/lib/vips/sourcecustom.rb @@ -47,7 +47,7 @@ def initialize pointer = Vips.vips_source_custom_new raise Vips::Error if pointer.null? - super pointer + super(pointer) end # The block is executed to read data from the source. The interface is diff --git a/lib/vips/targetcustom.rb b/lib/vips/targetcustom.rb index 9f07db75..2aa25756 100644 --- a/lib/vips/targetcustom.rb +++ b/lib/vips/targetcustom.rb @@ -47,7 +47,7 @@ def initialize pointer = Vips.vips_target_custom_new raise Vips::Error if pointer.null? - super pointer + super(pointer) end # The block is executed to write data to the source. The interface is diff --git a/lib/vips/version.rb b/lib/vips/version.rb index 6d3d8a5f..c60474f8 100644 --- a/lib/vips/version.rb +++ b/lib/vips/version.rb @@ -1,3 +1,3 @@ module Vips - VERSION = "2.2.0" + VERSION = "2.2.1" end From e29e2b6bc87bd928eca1ca4149b93a27627a79e4 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Mon, 19 Feb 2024 14:09:46 +0000 Subject: [PATCH 24/50] update checkout to v4 --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4b93cfd4..78466436 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,7 +20,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Ruby uses: ruby/setup-ruby@v1 @@ -56,7 +56,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Ruby uses: ruby/setup-ruby@v1 From 257bcdba831fd0b166c728b5b76ef1cbc6ac81dd Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Mon, 19 Feb 2024 14:35:15 +0000 Subject: [PATCH 25/50] guard references --- lib/vips/image.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/vips/image.rb b/lib/vips/image.rb index 8d354332..be85807a 100644 --- a/lib/vips/image.rb +++ b/lib/vips/image.rb @@ -458,14 +458,14 @@ def self.new_from_source source, option_string, **opts loader = Vips.vips_foreign_find_load_source source raise Vips::Error if loader.nil? - image = Vips::Operation.call loader, [source], opts, option_string + result = Vips::Operation.call loader, [source], opts, option_string # keep a secret ref to the source object ... the libvips loader will # keep a ref to the C source object, but we need the ruby wrapper object # to stay alive too - image.references << source + result.references << source if result.is_a?(Vips::Image) - image + result end def self.matrix_from_array width, height, array From e1df3590fda47f7c59abbe78d5b913d85414c467 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Mon, 19 Feb 2024 14:46:16 +0000 Subject: [PATCH 26/50] remove ruby2.0 support since something seems to have broken it --- .github/workflows/test.yml | 1 - lib/vips/image.rb | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 78466436..6eb76e17 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,7 +38,6 @@ jobs: matrix: os-version: [ 'ubuntu-20.04' ] ruby-version: - - '2.0' - '2.1' - '2.2' - '2.3' diff --git a/lib/vips/image.rb b/lib/vips/image.rb index be85807a..9aa581cc 100644 --- a/lib/vips/image.rb +++ b/lib/vips/image.rb @@ -463,7 +463,7 @@ def self.new_from_source source, option_string, **opts # keep a secret ref to the source object ... the libvips loader will # keep a ref to the C source object, but we need the ruby wrapper object # to stay alive too - result.references << source if result.is_a?(Vips::Image) + result.references << source result end From b735f3e96136095868e78f8240d1e7dd1544f002 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Mon, 19 Feb 2024 14:50:38 +0000 Subject: [PATCH 27/50] lint --- lib/vips/image.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vips/image.rb b/lib/vips/image.rb index 9aa581cc..45bd2edd 100644 --- a/lib/vips/image.rb +++ b/lib/vips/image.rb @@ -463,7 +463,7 @@ def self.new_from_source source, option_string, **opts # keep a secret ref to the source object ... the libvips loader will # keep a ref to the C source object, but we need the ruby wrapper object # to stay alive too - result.references << source + result.references << source result end From 83a83407086cce2b6ccca7930195c30751ced4e1 Mon Sep 17 00:00:00 2001 From: Andrey Glushkov Date: Wed, 20 Dec 2023 16:59:03 +0300 Subject: [PATCH 28/50] Add wrappers for vips_block_untrusted_set and vips_operation_block_set methods ```ruby Vips.block("VipsForeignLoad", true); Vips.block("VipsForeignLoadJpeg", false) Vips.block_untrusted(true) ``` Use `vips -l` at the command-line to see the operations classes hierarchy. --- CHANGELOG.md | 2 ++ lib/vips.rb | 25 +++++++++++++++++++++++++ spec/block_operations_spec.rb | 34 ++++++++++++++++++++++++++++++++++ spec/image_spec.rb | 4 ---- spec/spec_helper.rb | 8 ++++++++ 5 files changed, 69 insertions(+), 4 deletions(-) create mode 100644 spec/block_operations_spec.rb diff --git a/CHANGELOG.md b/CHANGELOG.md index 8848ddb2..77c9d654 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## master +* add `Vips.block_untrusted` method to block all untrusted operations. Only for libvips >= 8.13. [Docs](https://www.libvips.org/API/current/libvips-vips.html#vips-block-untrusted-set). [#382](https://github.com/libvips/ruby-vips/pull/382) [aglushkov](https://github.com/aglushkov) +* add `Vips.block` method to block specific operation. Only for libvips >= 8.13. [Docs](https://www.libvips.org/API/current/VipsOperation.html#vips-operation-block-set). [#382](https://github.com/libvips/ruby-vips/pull/382) [aglushkov](https://github.com/aglushkov) * `new_from_source` keeps a ref to the source object [taylorthurlow] * some fixes to object references system diff --git a/lib/vips.rb b/lib/vips.rb index 5c10d493..f0e7461d 100644 --- a/lib/vips.rb +++ b/lib/vips.rb @@ -779,6 +779,31 @@ def self.at_least_libvips?(x, y) major > x || (major == x && minor >= y) end + if at_least_libvips?(8, 13) + attach_function :vips_block_untrusted_set, [:bool], :void + attach_function :vips_operation_block_set, %i[string bool], :void + + # Block/unblock all untrusted operations from running. + # Use `vips -l` at the command-line to see the class hierarchy and which operations are marked as untrusted. + def self.block_untrusted(enabled) + vips_block_untrusted_set(enabled) + end + + # Block/unblock all operations in the libvips class hierarchy at specified *operation_name* and below. + # + # For example this will block all loaders except JPEG + # + # Vips.block("VipsForeignLoad", true); + # Vips.block("VipsForeignLoadJpeg", false) + # + # Use `vips -l` at the command-line to see the class hierarchy. + # This call does nothing if the named operation is not found. + # + def self.block(operation_name, enabled) + vips_operation_block_set(operation_name, enabled) + end + end + # Get a list of all supported file suffixes. # # @return [[String]] array of supported suffixes diff --git a/spec/block_operations_spec.rb b/spec/block_operations_spec.rb new file mode 100644 index 00000000..6cd0e7c5 --- /dev/null +++ b/spec/block_operations_spec.rb @@ -0,0 +1,34 @@ +require "spec_helper" + +RSpec.describe Vips, version: [8, 13] do + let(:svg_image) { simg("lion.svg") } + let(:jpg_image) { simg("wagon.jpg") } + + if has_svg? + it "can block untrusted operations" do + untrusted_image = svg_image # svgload operation is known as untrusted + + # Block + Vips.block_untrusted(true) + expect { Vips::Image.new_from_file(untrusted_image) }.to raise_error Vips::Error, /svgload/ + + # Unblock + Vips.block_untrusted(false) + expect { Vips::Image.new_from_file(untrusted_image) }.not_to raise_error + end + end + + if has_jpeg? && has_svg? + it "can block specific operations" do + # Block all loaders except jpeg + Vips.block("VipsForeignLoad", true) + Vips.block("VipsForeignLoadJpeg", false) + expect { Vips::Image.new_from_file(svg_image) }.to raise_error Vips::Error, /svgload/ + expect { Vips::Image.new_from_file(jpg_image) }.not_to raise_error + + # Unblock all loaders + Vips.block("VipsForeignLoad", false) + expect { Vips::Image.new_from_file(svg_image) }.not_to raise_error + end + end +end diff --git a/spec/image_spec.rb b/spec/image_spec.rb index 2fe57214..38fdb29a 100644 --- a/spec/image_spec.rb +++ b/spec/image_spec.rb @@ -1,9 +1,5 @@ require "spec_helper" -def has_jpeg? - Vips.type_find("VipsOperation", "jpegload") != nil -end - RSpec.describe Vips::Image do it "can save an image to a file" do filename = timg "x.v" diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 2bb56931..76227b0c 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -22,6 +22,14 @@ def timg(name) File.join(@temp_dir, name) end +def has_jpeg? + Vips.type_find("VipsOperation", "jpegload") != nil +end + +def has_svg? + Vips.type_find("VipsOperation", "svgload") != nil +end + RSpec.configure do |config| config.around do |example| Dir.mktmpdir("ruby-vips-spec-") do |dir| From 05cde1d9d530a4b1a6b3b833e09b1bc0b906f993 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 21 Feb 2024 13:08:49 +0000 Subject: [PATCH 29/50] fix tests with git master libvips and get changelog ready for 2.2.1 --- CHANGELOG.md | 2 ++ spec/block_operations_spec.rb | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 77c9d654..6d885b25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## master +## Version 2.2.1 (2023-02-21) + * add `Vips.block_untrusted` method to block all untrusted operations. Only for libvips >= 8.13. [Docs](https://www.libvips.org/API/current/libvips-vips.html#vips-block-untrusted-set). [#382](https://github.com/libvips/ruby-vips/pull/382) [aglushkov](https://github.com/aglushkov) * add `Vips.block` method to block specific operation. Only for libvips >= 8.13. [Docs](https://www.libvips.org/API/current/VipsOperation.html#vips-operation-block-set). [#382](https://github.com/libvips/ruby-vips/pull/382) [aglushkov](https://github.com/aglushkov) * `new_from_source` keeps a ref to the source object [taylorthurlow] diff --git a/spec/block_operations_spec.rb b/spec/block_operations_spec.rb index 6cd0e7c5..1ec46484 100644 --- a/spec/block_operations_spec.rb +++ b/spec/block_operations_spec.rb @@ -10,7 +10,7 @@ # Block Vips.block_untrusted(true) - expect { Vips::Image.new_from_file(untrusted_image) }.to raise_error Vips::Error, /svgload/ + expect { Vips::Image.new_from_file(untrusted_image) }.to raise_error Vips::Error, /not a known/ # Unblock Vips.block_untrusted(false) @@ -23,7 +23,7 @@ # Block all loaders except jpeg Vips.block("VipsForeignLoad", true) Vips.block("VipsForeignLoadJpeg", false) - expect { Vips::Image.new_from_file(svg_image) }.to raise_error Vips::Error, /svgload/ + expect { Vips::Image.new_from_file(svg_image) }.to raise_error Vips::Error, /not a known/ expect { Vips::Image.new_from_file(jpg_image) }.not_to raise_error # Unblock all loaders From d644adcaaf11b1db0785d06b3779ddaadfc04c50 Mon Sep 17 00:00:00 2001 From: Guillaume Wrobel <20317297+guillaumewrobel@users.noreply.github.com> Date: Wed, 21 Feb 2024 15:02:13 +0100 Subject: [PATCH 30/50] Fix last version year --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d885b25..7c3c1d6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## master -## Version 2.2.1 (2023-02-21) +## Version 2.2.1 (2024-02-21) * add `Vips.block_untrusted` method to block all untrusted operations. Only for libvips >= 8.13. [Docs](https://www.libvips.org/API/current/libvips-vips.html#vips-block-untrusted-set). [#382](https://github.com/libvips/ruby-vips/pull/382) [aglushkov](https://github.com/aglushkov) * add `Vips.block` method to block specific operation. Only for libvips >= 8.13. [Docs](https://www.libvips.org/API/current/VipsOperation.html#vips-operation-block-set). [#382](https://github.com/libvips/ruby-vips/pull/382) [aglushkov](https://github.com/aglushkov) From 16a803b93020a72e714b06fea81ab5b189c28cd2 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Sat, 24 Feb 2024 18:39:12 +0000 Subject: [PATCH 31/50] fix release date --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d885b25..7c3c1d6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## master -## Version 2.2.1 (2023-02-21) +## Version 2.2.1 (2024-02-21) * add `Vips.block_untrusted` method to block all untrusted operations. Only for libvips >= 8.13. [Docs](https://www.libvips.org/API/current/libvips-vips.html#vips-block-untrusted-set). [#382](https://github.com/libvips/ruby-vips/pull/382) [aglushkov](https://github.com/aglushkov) * add `Vips.block` method to block specific operation. Only for libvips >= 8.13. [Docs](https://www.libvips.org/API/current/VipsOperation.html#vips-operation-block-set). [#382](https://github.com/libvips/ruby-vips/pull/382) [aglushkov](https://github.com/aglushkov) From 61db28da883eae492594b453098047f5c079a9d8 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Fri, 1 Mar 2024 16:43:36 +0100 Subject: [PATCH 32/50] Fix a method redefinition warning --- lib/vips/object.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/vips/object.rb b/lib/vips/object.rb index 3b3e92de..9541c6f1 100644 --- a/lib/vips/object.rb +++ b/lib/vips/object.rb @@ -9,9 +9,6 @@ module Vips private - # debugging support - attach_function :vips_object_print_all, [], :void - # we must init these by hand, since they are usually made on first image # create attach_function :vips_band_format_get_type, [], :GType @@ -337,6 +334,7 @@ class ArgumentInstancePtr < FFI::Struct ArgumentClassPtr.ptr, ArgumentInstancePtr.ptr], :int + # debugging support attach_function :vips_object_print_all, [], :void attach_function :vips_object_set_from_string, [:pointer, :string], :int From d12874b1076d844b9649d08dc36e838cafcfd64e Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Fri, 1 Mar 2024 16:46:23 +0100 Subject: [PATCH 33/50] Add ruby 3.3 to CI --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6eb76e17..5492d035 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -48,6 +48,7 @@ jobs: - '3.0' - '3.1' - '3.2' + - '3.3' - jruby fail-fast: true From badc3585fb58ff89a56d77d0eb0e0559d41d23f4 Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Mon, 4 Mar 2024 15:48:35 +0100 Subject: [PATCH 34/50] Ensure compatibility with a single shared libvips library See: #372. --- lib/vips.rb | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/lib/vips.rb b/lib/vips.rb index f0e7461d..b2608508 100644 --- a/lib/vips.rb +++ b/lib/vips.rb @@ -42,7 +42,19 @@ class << self extend FFI::Library - ffi_lib library_name("glib-2.0", 0) + if FFI::Platform.windows? + # On Windows, `GetProcAddress()` can only search in a specified DLL and + # doesn't look into its dependent libraries for symbols. Therefore, we + # check if the GLib DLLs are available. If these can not be found, we + # assume that GLib is statically linked into libvips. + ffi_lib ["libglib-2.0-0.dll", "libvips-42.dll"] + else + # macOS and *nix uses `dlsym()`, which also searches for named symbols + # in the dependencies of the shared library. Therefore, we can support + # a single shared libvips library with all dependencies statically + # linked. + ffi_lib library_name("vips", 42) + end attach_function :g_malloc, [:size_t], :pointer @@ -134,7 +146,11 @@ def self.set_log_domain domain module GObject extend FFI::Library - ffi_lib library_name("gobject-2.0", 0) + if FFI::Platform.windows? + ffi_lib ["libgobject-2.0-0.dll", "libvips-42.dll"] + else + ffi_lib library_name("vips", 42) + end # we can't just use ulong, windows has different int sizing rules if FFI::Platform::ADDRESS_SIZE == 64 From 2c55d8bb5e095c9c7a4b20e36841350412c653f8 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Tue, 5 Mar 2024 12:53:16 +0000 Subject: [PATCH 35/50] fix compat with semistatic libvips we must fetch `g_*()` funcs from libvips if we can --- CHANGELOG.md | 2 ++ lib/vips.rb | 50 ++++++++++++++++++++++++++++++++------------------ 2 files changed, 34 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c3c1d6a..38a12a47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## master +* fix compat with unified (semistatic) libvips binaries [kleisauke] + ## Version 2.2.1 (2024-02-21) * add `Vips.block_untrusted` method to block all untrusted operations. Only for libvips >= 8.13. [Docs](https://www.libvips.org/API/current/libvips-vips.html#vips-block-untrusted-set). [#382](https://github.com/libvips/ruby-vips/pull/382) [aglushkov](https://github.com/aglushkov) diff --git a/lib/vips.rb b/lib/vips.rb index b2608508..45c103d2 100644 --- a/lib/vips.rb +++ b/lib/vips.rb @@ -33,6 +33,30 @@ def library_name(name, abi_number) end end +# we can sometimes get dependent libraries from libvips -- either the platform +# will open dependencies for us automatically, or the libvips binary has been +# built to includes all main dependencies (common on windows, can happen +# elsewhere) +# +# we must get glib functions from libvips if we can, since it will be the +# one that libvips itself is using, and they will share runtime types +module Vips + extend FFI::Library + + ffi_lib library_name("vips", 42) + + begin + attach_function :g_malloc, [:size_t], :pointer + @@is_unified = true + rescue => e + @@is_unified = false + end + + def self.unified? + @@is_unified + end +end + module GLib class << self attr_accessor :logger @@ -42,18 +66,10 @@ class << self extend FFI::Library - if FFI::Platform.windows? - # On Windows, `GetProcAddress()` can only search in a specified DLL and - # doesn't look into its dependent libraries for symbols. Therefore, we - # check if the GLib DLLs are available. If these can not be found, we - # assume that GLib is statically linked into libvips. - ffi_lib ["libglib-2.0-0.dll", "libvips-42.dll"] - else - # macOS and *nix uses `dlsym()`, which also searches for named symbols - # in the dependencies of the shared library. Therefore, we can support - # a single shared libvips library with all dependencies statically - # linked. + if Vips::unified? ffi_lib library_name("vips", 42) + else + ffi_lib library_name("glib-2.0", 0) end attach_function :g_malloc, [:size_t], :pointer @@ -146,10 +162,10 @@ def self.set_log_domain domain module GObject extend FFI::Library - if FFI::Platform.windows? - ffi_lib ["libgobject-2.0-0.dll", "libvips-42.dll"] - else + if Vips::unified? ffi_lib library_name("vips", 42) + else + ffi_lib library_name("gobject-2.0", 0) end # we can't just use ulong, windows has different int sizing rules @@ -584,10 +600,8 @@ module GObject # {Image#median}. module Vips - extend FFI::Library - - ffi_lib library_name("vips", 42) - + # we've already opened the libvips library + LOG_DOMAIN = "VIPS" GLib.set_log_domain LOG_DOMAIN From 491d7d9d176f6baaa656d6126b358daf5b27d124 Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Thu, 7 Mar 2024 10:53:03 +0100 Subject: [PATCH 36/50] Fix compat with shared Windows builds --- lib/vips.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vips.rb b/lib/vips.rb index 45c103d2..3d550242 100644 --- a/lib/vips.rb +++ b/lib/vips.rb @@ -48,7 +48,7 @@ module Vips begin attach_function :g_malloc, [:size_t], :pointer @@is_unified = true - rescue => e + rescue FFI::NotFoundError @@is_unified = false end From 2cb995d56ca9023a69d487dc83b499ea7759759a Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Thu, 7 Mar 2024 10:56:45 +0100 Subject: [PATCH 37/50] Fix lint --- lib/vips.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/vips.rb b/lib/vips.rb index 3d550242..92af2e2d 100644 --- a/lib/vips.rb +++ b/lib/vips.rb @@ -66,7 +66,7 @@ class << self extend FFI::Library - if Vips::unified? + if Vips.unified? ffi_lib library_name("vips", 42) else ffi_lib library_name("glib-2.0", 0) @@ -162,7 +162,7 @@ def self.set_log_domain domain module GObject extend FFI::Library - if Vips::unified? + if Vips.unified? ffi_lib library_name("vips", 42) else ffi_lib library_name("gobject-2.0", 0) @@ -601,7 +601,7 @@ module GObject module Vips # we've already opened the libvips library - + LOG_DOMAIN = "VIPS" GLib.set_log_domain LOG_DOMAIN From c1a05c26494c5e0115ca9752ade3ad6afdcc7cf3 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 5 Jun 2024 14:02:15 +0100 Subject: [PATCH 38/50] add logger to the gemspec Since logger will be unbundled in ruby 3.5. Thanks Earlopain See https://github.com/libvips/ruby-vips/issues/397 --- ruby-vips.gemspec | 1 + 1 file changed, 1 insertion(+) diff --git a/ruby-vips.gemspec b/ruby-vips.gemspec index 9e706040..6f0ec857 100644 --- a/ruby-vips.gemspec +++ b/ruby-vips.gemspec @@ -36,6 +36,7 @@ Gem::Specification.new do |spec| spec.required_ruby_version = ">= 2.0.0" spec.add_runtime_dependency "ffi", ["~> 1.12"] + spec.add_runtime_dependency "logger" spec.add_development_dependency "rake", ["~> 12.0"] spec.add_development_dependency "rspec", ["~> 3.3"] From 12159bd8990a3e0de619b76068dfa71a58ad0f18 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 5 Jun 2024 14:10:14 +0100 Subject: [PATCH 39/50] remove ruby 2.1 from testing since it doesn't support logger --- .github/workflows/test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5492d035..54eb625c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,7 +38,6 @@ jobs: matrix: os-version: [ 'ubuntu-20.04' ] ruby-version: - - '2.1' - '2.2' - '2.3' - '2.4' @@ -75,7 +74,7 @@ jobs: DEBIAN_FRONTEND: noninteractive run: # we only need the library - sudo apt-get install --fix-missing -qq -o Acquire::Retries=3 + sudo apt-get install --no-install-recommends --fix-missing -qq -o Acquire::Retries=3 libvips - name: Run Tests From ebcb853f3f244b4bc1294b9700656acf8b90962f Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 5 Jun 2024 14:12:17 +0100 Subject: [PATCH 40/50] remove ruby 2.2 from CI since it does not support logger --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 54eb625c..ed7f3063 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,7 +38,6 @@ jobs: matrix: os-version: [ 'ubuntu-20.04' ] ruby-version: - - '2.2' - '2.3' - '2.4' - '2.5' From 7a2b9ba3819178ae744661be461b7546cb636d40 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 17 Jul 2024 12:14:04 +0100 Subject: [PATCH 41/50] version bump to 2.2.2 --- CHANGELOG.md | 2 ++ VERSION | 2 +- lib/vips/version.rb | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38a12a47..caabbb52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## master +## Version 2.2.2 (2024-07-17) + * fix compat with unified (semistatic) libvips binaries [kleisauke] ## Version 2.2.1 (2024-02-21) diff --git a/VERSION b/VERSION index c043eea7..b1b25a5f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.2.1 +2.2.2 diff --git a/lib/vips/version.rb b/lib/vips/version.rb index c60474f8..44e9f330 100644 --- a/lib/vips/version.rb +++ b/lib/vips/version.rb @@ -1,3 +1,3 @@ module Vips - VERSION = "2.2.1" + VERSION = "2.2.2" end From 61d8d931a2d23db85cd3382125f75b3f1e5ed77e Mon Sep 17 00:00:00 2001 From: Rodrigo Argumedo <7613139+rodrigoargumedo@users.noreply.github.com> Date: Fri, 2 Aug 2024 13:56:59 +0000 Subject: [PATCH 42/50] Lint code --- lib/vips/operation.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vips/operation.rb b/lib/vips/operation.rb index aebe5981..7d58bc18 100644 --- a/lib/vips/operation.rb +++ b/lib/vips/operation.rb @@ -218,7 +218,7 @@ def initialize value raise Vips::Error if value.null? end - super(value) + super end def build From 90a7fe3bdaa1824c168addf74f4ef7bba621eac4 Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Fri, 2 Aug 2024 16:48:36 +0200 Subject: [PATCH 43/50] CI: remove `pull_request_target` event --- .github/workflows/test.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ed7f3063..617e8613 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,13 +1,6 @@ name: Test -on: - push: - branches: - - master - pull_request: - pull_request_target: - branches: - - master +on: [push, pull_request] env: NOKOGIRI_USE_SYSTEM_LIBRARIES: true From 8d87f5c77f7a98cb193376ea58652a1201755500 Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Fri, 2 Aug 2024 16:49:05 +0200 Subject: [PATCH 44/50] CI: upgrade runner to Ubuntu 24.04 --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 617e8613..51c7958f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,7 +29,7 @@ jobs: strategy: matrix: - os-version: [ 'ubuntu-20.04' ] + os-version: [ 'ubuntu-24.04' ] ruby-version: - '2.3' - '2.4' From 5c01af149645977704fdb2a9e8f7e950102f92bc Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Fri, 2 Aug 2024 16:50:17 +0200 Subject: [PATCH 45/50] CI: consolidate and simplify APT steps --- .github/workflows/test.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 51c7958f..a40b6fa8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -55,19 +55,13 @@ jobs: ruby-version: ${{ matrix.ruby-version }} bundler-cache: true - - name: Update apt - env: - DEBIAN_FRONTEND: noninteractive - run: - sudo apt-get update -qq -o Acquire::Retries=3 - - name: Install libvips env: DEBIAN_FRONTEND: noninteractive - run: + run: | + sudo apt-get update # we only need the library - sudo apt-get install --no-install-recommends --fix-missing -qq -o Acquire::Retries=3 - libvips + sudo apt-get install --no-install-recommends libvips - name: Run Tests run: bundle exec rake spec From 41f6e45c11ce37010a25255f4bb8d66e0c7de7aa Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Fri, 2 Aug 2024 16:53:24 +0200 Subject: [PATCH 46/50] CI: remove redundant `DEBIAN_FRONTEND=noninteractive` env The Linux runners on GitHub Actions already sets this env variable, see: https://github.com/actions/runner-images/blob/2a4bc14da46f1f8e358aa902a69edb9bef135472/images/ubuntu/scripts/build/configure-dpkg.sh#L17 --- .github/workflows/test.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a40b6fa8..a7216f42 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -56,8 +56,6 @@ jobs: bundler-cache: true - name: Install libvips - env: - DEBIAN_FRONTEND: noninteractive run: | sudo apt-get update # we only need the library From 66f2d1720927a9ec9ce8729c6cc6187f3cbedd3b Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Sat, 12 Oct 2024 14:32:37 +0100 Subject: [PATCH 47/50] update docs for 8.16 --- lib/vips/methods.rb | 200 +++++++++++++++++++++++++++--------------- lib/vips/operation.rb | 2 +- 2 files changed, 129 insertions(+), 73 deletions(-) diff --git a/lib/vips/methods.rb b/lib/vips/methods.rb index 2a436b20..a514d712 100644 --- a/lib/vips/methods.rb +++ b/lib/vips/methods.rb @@ -18,6 +18,18 @@ class Image # @param opts [Hash] Set of options # @return [Vips::Image] Output image +# @!method minpair(right, **opts) +# Minimum of a pair of images. +# @param right [Vips::Image] Right-hand image argument +# @param opts [Hash] Set of options +# @return [Vips::Image] Output image + +# @!method maxpair(right, **opts) +# Maximum of a pair of images. +# @param right [Vips::Image] Right-hand image argument +# @param opts [Hash] Set of options +# @return [Vips::Image] Output image + # @!method subtract(right, **opts) # Subtract two images. # @param right [Vips::Image] Right-hand image argument @@ -76,10 +88,11 @@ class Image # @param opts [Hash] Set of options # @return [Vips::Image] Output image -# @!method self.sum(im, **opts) -# Sum an array of images. -# @param im [Array] Array of input images +# @!method clamp(**opts) +# Clamp values of an image. # @param opts [Hash] Set of options +# @option opts [Float] :min Minimum value +# @option opts [Float] :max Maximum value # @return [Vips::Image] Output image # @!method invert(**opts) @@ -156,6 +169,12 @@ class Image # @param opts [Hash] Set of options # @return [Vips::Image] Output image +# @!method self.sum(im, **opts) +# Sum an array of images. +# @param im [Array] Array of input images +# @param opts [Hash] Set of options +# @return [Vips::Image] Output image + # @!method avg(**opts) # Find image average. # @param opts [Hash] Set of options @@ -253,6 +272,7 @@ class Image # @param x [Integer] Point to read # @param y [Integer] Point to read # @param opts [Hash] Set of options +# @option opts [Boolean] :unpack_complex Complex pixels should be unpacked # @return [Array] Array of output values # @!method find_trim(**opts) @@ -304,14 +324,6 @@ class Image # @option opts [Integer] :tile_height Tile height in pixels # @return [Vips::Image] Output image -# @!method cache(**opts) -# Cache an image. -# @param opts [Hash] Set of options -# @option opts [Integer] :max_tiles Maximum number of tiles to cache -# @option opts [Integer] :tile_height Tile height in pixels -# @option opts [Integer] :tile_width Tile width in pixels -# @return [Vips::Image] Output image - # @!method embed(x, y, width, height, **opts) # Embed an image in a larger image. # @param x [Integer] Left edge of input in output @@ -573,6 +585,11 @@ class Image # @option opts [Boolean] :premultiplied Images have premultiplied alpha # @return [Vips::Image] Output image +# @!method addalpha(**opts) +# Append an alpha channel. +# @param opts [Hash] Set of options +# @return [Vips::Image] Output image + # @!method self.black(width, height, **opts) # Make a black image. # @param width [Integer] Image width in pixels @@ -636,6 +653,18 @@ class Image # @option opts [Integer] :autofit_dpi Output DPI selected by autofit # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items +# @!method self.sdf(width, height, shape, **opts) +# Create an sdf image. +# @param width [Integer] Image width in pixels +# @param height [Integer] Image height in pixels +# @param shape [Vips::SdfShape] SDF shape to create +# @param opts [Hash] Set of options +# @option opts [Float] :r Radius +# @option opts [Array] :a Point a +# @option opts [Array] :b Point b +# @option opts [Array] :corners Corner radii +# @return [Vips::Image] Output image + # @!method self.eye(width, height, **opts) # Make an image showing the eye's spatial response. # @param width [Integer] Image width in pixels @@ -1462,6 +1491,8 @@ class Image # Load jpeg-xl image. # @param filename [String] Filename to load from # @param opts [Hash] Set of options +# @option opts [Integer] :page First page to load +# @option opts [Integer] :n Number of pages to load, -1 for all # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on @@ -1473,6 +1504,8 @@ class Image # Load jpeg-xl image. # @param buffer [VipsBlob] Buffer to load from # @param opts [Hash] Set of options +# @option opts [Integer] :page First page to load +# @option opts [Integer] :n Number of pages to load, -1 for all # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on @@ -1484,6 +1517,8 @@ class Image # Load jpeg-xl image. # @param source [Vips::Source] Source to load from # @param opts [Hash] Set of options +# @option opts [Integer] :page First page to load +# @option opts [Integer] :n Number of pages to load, -1 for all # @option opts [Boolean] :memory Force open via memory # @option opts [Vips::Access] :access Required access pattern for this file # @option opts [Vips::FailOn] :fail_on Error level to fail on @@ -1574,91 +1609,100 @@ class Image # Save image to csv. # @param filename [String] Filename to save to # @param opts [Hash] Set of options -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [String] :separator Separator characters # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [nil] # @!method csvsave_target(target, **opts) # Save image to csv. # @param target [Vips::Target] Target to save to # @param opts [Hash] Set of options -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [String] :separator Separator characters # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [nil] # @!method matrixsave(filename, **opts) # Save image to matrix. # @param filename [String] Filename to save to # @param opts [Hash] Set of options -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [nil] # @!method matrixsave_target(target, **opts) # Save image to matrix. # @param target [Vips::Target] Target to save to # @param opts [Hash] Set of options -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [nil] # @!method matrixprint(**opts) # Print matrix. # @param opts [Hash] Set of options -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [nil] # @!method rawsave(filename, **opts) # Save image to raw file. # @param filename [String] Filename to save to # @param opts [Hash] Set of options -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [nil] -# @!method rawsave_fd(fd, **opts) -# Write raw image to file descriptor. -# @param fd [Integer] File descriptor to write to +# @!method rawsave_buffer(**opts) +# Write raw image to buffer. # @param opts [Hash] Set of options +# @option opts [Vips::ForeignKeep] :keep Which metadata to retain +# @option opts [Array] :background Background value +# @option opts [Integer] :page_height Set page height for multipage save # @option opts [String] :profile Filename of ICC profile to embed +# @return [VipsBlob] Buffer to save to + +# @!method rawsave_target(target, **opts) +# Write raw image to target. +# @param target [Vips::Target] Target to save to +# @param opts [Hash] Set of options # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [nil] # @!method vipssave(filename, **opts) # Save image to file in vips format. # @param filename [String] Filename to save to # @param opts [Hash] Set of options -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [nil] # @!method vipssave_target(target, **opts) # Save image to target in vips format. # @param target [Vips::Target] Target to save to # @param opts [Hash] Set of options -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [nil] # @!method ppmsave(filename, **opts) @@ -1667,11 +1711,11 @@ class Image # @param opts [Hash] Set of options # @option opts [Vips::ForeignPpmFormat] :format Format to save in # @option opts [Boolean] :ascii Save as ascii -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Integer] :bitdepth Set to 1 to write as a 1 bit image # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [nil] # @!method ppmsave_target(target, **opts) @@ -1680,48 +1724,47 @@ class Image # @param opts [Hash] Set of options # @option opts [Vips::ForeignPpmFormat] :format Format to save in # @option opts [Boolean] :ascii Save as ascii -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Integer] :bitdepth Set to 1 to write as a 1 bit image # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [nil] # @!method radsave(filename, **opts) # Save image to radiance file. # @param filename [String] Filename to save to # @param opts [Hash] Set of options -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [nil] # @!method radsave_buffer(**opts) # Save image to radiance buffer. # @param opts [Hash] Set of options -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [VipsBlob] Buffer to save to # @!method radsave_target(target, **opts) # Save image to radiance target. # @param target [Vips::Target] Target to save to # @param opts [Hash] Set of options -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [nil] # @!method jp2ksave(filename, **opts) # Save image in jpeg2000 format. -# @param filename [String] Filename to load from +# @param filename [String] Filename to save to # @param opts [Hash] Set of options # @option opts [Integer] :tile_width Tile width in pixels -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Integer] :tile_height Tile height in pixels # @option opts [Boolean] :lossless Enable lossless compression # @option opts [Integer] :Q Q factor @@ -1729,13 +1772,13 @@ class Image # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [nil] # @!method jp2ksave_buffer(**opts) # Save image in jpeg2000 format. # @param opts [Hash] Set of options # @option opts [Integer] :tile_width Tile width in pixels -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Integer] :tile_height Tile height in pixels # @option opts [Boolean] :lossless Enable lossless compression # @option opts [Integer] :Q Q factor @@ -1743,6 +1786,7 @@ class Image # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [VipsBlob] Buffer to save to # @!method jp2ksave_target(target, **opts) @@ -1750,7 +1794,6 @@ class Image # @param target [Vips::Target] Target to save to # @param opts [Hash] Set of options # @option opts [Integer] :tile_width Tile width in pixels -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Integer] :tile_height Tile height in pixels # @option opts [Boolean] :lossless Enable lossless compression # @option opts [Integer] :Q Q factor @@ -1758,6 +1801,7 @@ class Image # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [nil] # @!method gifsave(filename, **opts) @@ -1766,7 +1810,6 @@ class Image # @param opts [Hash] Set of options # @option opts [Float] :dither Amount of dithering # @option opts [Integer] :effort Quantisation effort -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Integer] :bitdepth Number of bits per pixel # @option opts [Float] :interframe_maxerror Maximum inter-frame error for transparency # @option opts [Boolean] :reuse Reuse palette from input @@ -1775,6 +1818,7 @@ class Image # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [nil] # @!method gifsave_buffer(**opts) @@ -1782,7 +1826,6 @@ class Image # @param opts [Hash] Set of options # @option opts [Float] :dither Amount of dithering # @option opts [Integer] :effort Quantisation effort -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Integer] :bitdepth Number of bits per pixel # @option opts [Float] :interframe_maxerror Maximum inter-frame error for transparency # @option opts [Boolean] :reuse Reuse palette from input @@ -1791,6 +1834,7 @@ class Image # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [VipsBlob] Buffer to save to # @!method gifsave_target(target, **opts) @@ -1799,7 +1843,6 @@ class Image # @param opts [Hash] Set of options # @option opts [Float] :dither Amount of dithering # @option opts [Integer] :effort Quantisation effort -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Integer] :bitdepth Number of bits per pixel # @option opts [Float] :interframe_maxerror Maximum inter-frame error for transparency # @option opts [Boolean] :reuse Reuse palette from input @@ -1808,6 +1851,7 @@ class Image # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [nil] # @!method dzsave(filename, **opts) @@ -1819,7 +1863,6 @@ class Image # @option opts [String] :suffix Filename suffix for tiles # @option opts [Integer] :overlap Tile overlap in pixels # @option opts [Integer] :tile_size Tile size in pixels -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Boolean] :centre Center image in tile # @option opts [Vips::ForeignDzDepth] :depth Pyramid depth # @option opts [Vips::Angle] :angle Rotate image during save @@ -1832,6 +1875,7 @@ class Image # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [nil] # @!method dzsave_buffer(**opts) @@ -1842,7 +1886,6 @@ class Image # @option opts [String] :suffix Filename suffix for tiles # @option opts [Integer] :overlap Tile overlap in pixels # @option opts [Integer] :tile_size Tile size in pixels -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Boolean] :centre Center image in tile # @option opts [Vips::ForeignDzDepth] :depth Pyramid depth # @option opts [Vips::Angle] :angle Rotate image during save @@ -1855,6 +1898,7 @@ class Image # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [VipsBlob] Buffer to save to # @!method dzsave_target(target, **opts) @@ -1866,7 +1910,6 @@ class Image # @option opts [String] :suffix Filename suffix for tiles # @option opts [Integer] :overlap Tile overlap in pixels # @option opts [Integer] :tile_size Tile size in pixels -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Boolean] :centre Center image in tile # @option opts [Vips::ForeignDzDepth] :depth Pyramid depth # @option opts [Vips::Angle] :angle Rotate image during save @@ -1879,16 +1922,16 @@ class Image # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [nil] # @!method pngsave(filename, **opts) -# Save image to png file. +# Save image to file as png. # @param filename [String] Filename to save to # @param opts [Hash] Set of options # @option opts [Integer] :compression Compression factor # @option opts [Boolean] :interlace Interlace image -# @option opts [String] :profile Filename of ICC profile to embed -# @option opts [Vips::ForeignPngFilter] :filter libpng row filter flag(s) +# @option opts [Vips::ForeignPngFilter] :filter libspng row filter flag(s) # @option opts [Boolean] :palette Quantise to 8bpp palette # @option opts [Integer] :Q Quantisation quality # @option opts [Float] :dither Amount of dithering @@ -1897,15 +1940,15 @@ class Image # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [nil] # @!method pngsave_buffer(**opts) -# Save image to png buffer. +# Save image to buffer as png. # @param opts [Hash] Set of options # @option opts [Integer] :compression Compression factor # @option opts [Boolean] :interlace Interlace image -# @option opts [String] :profile Filename of ICC profile to embed -# @option opts [Vips::ForeignPngFilter] :filter libpng row filter flag(s) +# @option opts [Vips::ForeignPngFilter] :filter libspng row filter flag(s) # @option opts [Boolean] :palette Quantise to 8bpp palette # @option opts [Integer] :Q Quantisation quality # @option opts [Float] :dither Amount of dithering @@ -1914,6 +1957,7 @@ class Image # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [VipsBlob] Buffer to save to # @!method pngsave_target(target, **opts) @@ -1922,8 +1966,7 @@ class Image # @param opts [Hash] Set of options # @option opts [Integer] :compression Compression factor # @option opts [Boolean] :interlace Interlace image -# @option opts [String] :profile Filename of ICC profile to embed -# @option opts [Vips::ForeignPngFilter] :filter libpng row filter flag(s) +# @option opts [Vips::ForeignPngFilter] :filter libspng row filter flag(s) # @option opts [Boolean] :palette Quantise to 8bpp palette # @option opts [Integer] :Q Quantisation quality # @option opts [Float] :dither Amount of dithering @@ -1932,6 +1975,7 @@ class Image # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [nil] # @!method jpegsave(filename, **opts) @@ -1939,7 +1983,6 @@ class Image # @param filename [String] Filename to save to # @param opts [Hash] Set of options # @option opts [Integer] :Q Q factor -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Boolean] :optimize_coding Compute optimal Huffman coding tables # @option opts [Boolean] :interlace Generate an interlaced (progressive) jpeg # @option opts [Boolean] :trellis_quant Apply trellis quantisation to each 8x8 block @@ -1951,13 +1994,13 @@ class Image # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [nil] # @!method jpegsave_buffer(**opts) # Save image to jpeg buffer. # @param opts [Hash] Set of options # @option opts [Integer] :Q Q factor -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Boolean] :optimize_coding Compute optimal Huffman coding tables # @option opts [Boolean] :interlace Generate an interlaced (progressive) jpeg # @option opts [Boolean] :trellis_quant Apply trellis quantisation to each 8x8 block @@ -1969,6 +2012,7 @@ class Image # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [VipsBlob] Buffer to save to # @!method jpegsave_target(target, **opts) @@ -1976,7 +2020,6 @@ class Image # @param target [Vips::Target] Target to save to # @param opts [Hash] Set of options # @option opts [Integer] :Q Q factor -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Boolean] :optimize_coding Compute optimal Huffman coding tables # @option opts [Boolean] :interlace Generate an interlaced (progressive) jpeg # @option opts [Boolean] :trellis_quant Apply trellis quantisation to each 8x8 block @@ -1988,13 +2031,13 @@ class Image # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [nil] # @!method jpegsave_mime(**opts) # Save image to jpeg mime. # @param opts [Hash] Set of options # @option opts [Integer] :Q Q factor -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Boolean] :optimize_coding Compute optimal Huffman coding tables # @option opts [Boolean] :interlace Generate an interlaced (progressive) jpeg # @option opts [Boolean] :trellis_quant Apply trellis quantisation to each 8x8 block @@ -2006,6 +2049,7 @@ class Image # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [nil] # @!method webpsave(filename, **opts) @@ -2014,7 +2058,6 @@ class Image # @param opts [Hash] Set of options # @option opts [Integer] :Q Q factor # @option opts [Boolean] :lossless Enable lossless compression -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Vips::ForeignWebpPreset] :preset Preset for lossy compression # @option opts [Boolean] :smart_subsample Enable high quality chroma subsampling # @option opts [Boolean] :near_lossless Enable preprocessing in lossless mode (uses Q) @@ -2023,10 +2066,14 @@ class Image # @option opts [Integer] :kmin Minimum number of frames between key frames # @option opts [Integer] :kmax Maximum number of frames between key frames # @option opts [Integer] :effort Level of CPU effort to reduce file size +# @option opts [Integer] :target_size Desired target size in bytes # @option opts [Boolean] :mixed Allow mixed encoding (might reduce file size) +# @option opts [Boolean] :smart_deblock Enable auto-adjusting of the deblocking filter +# @option opts [Integer] :passes Number of entropy-analysis passes (in [1..10]) # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [nil] # @!method webpsave_buffer(**opts) @@ -2034,7 +2081,6 @@ class Image # @param opts [Hash] Set of options # @option opts [Integer] :Q Q factor # @option opts [Boolean] :lossless Enable lossless compression -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Vips::ForeignWebpPreset] :preset Preset for lossy compression # @option opts [Boolean] :smart_subsample Enable high quality chroma subsampling # @option opts [Boolean] :near_lossless Enable preprocessing in lossless mode (uses Q) @@ -2043,10 +2089,14 @@ class Image # @option opts [Integer] :kmin Minimum number of frames between key frames # @option opts [Integer] :kmax Maximum number of frames between key frames # @option opts [Integer] :effort Level of CPU effort to reduce file size +# @option opts [Integer] :target_size Desired target size in bytes # @option opts [Boolean] :mixed Allow mixed encoding (might reduce file size) +# @option opts [Boolean] :smart_deblock Enable auto-adjusting of the deblocking filter +# @option opts [Integer] :passes Number of entropy-analysis passes (in [1..10]) # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [VipsBlob] Buffer to save to # @!method webpsave_target(target, **opts) @@ -2055,7 +2105,6 @@ class Image # @param opts [Hash] Set of options # @option opts [Integer] :Q Q factor # @option opts [Boolean] :lossless Enable lossless compression -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Vips::ForeignWebpPreset] :preset Preset for lossy compression # @option opts [Boolean] :smart_subsample Enable high quality chroma subsampling # @option opts [Boolean] :near_lossless Enable preprocessing in lossless mode (uses Q) @@ -2064,10 +2113,14 @@ class Image # @option opts [Integer] :kmin Minimum number of frames between key frames # @option opts [Integer] :kmax Maximum number of frames between key frames # @option opts [Integer] :effort Level of CPU effort to reduce file size +# @option opts [Integer] :target_size Desired target size in bytes # @option opts [Boolean] :mixed Allow mixed encoding (might reduce file size) +# @option opts [Boolean] :smart_deblock Enable auto-adjusting of the deblocking filter +# @option opts [Integer] :passes Number of entropy-analysis passes (in [1..10]) # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [nil] # @!method webpsave_mime(**opts) @@ -2075,7 +2128,6 @@ class Image # @param opts [Hash] Set of options # @option opts [Integer] :Q Q factor # @option opts [Boolean] :lossless Enable lossless compression -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Vips::ForeignWebpPreset] :preset Preset for lossy compression # @option opts [Boolean] :smart_subsample Enable high quality chroma subsampling # @option opts [Boolean] :near_lossless Enable preprocessing in lossless mode (uses Q) @@ -2084,10 +2136,14 @@ class Image # @option opts [Integer] :kmin Minimum number of frames between key frames # @option opts [Integer] :kmax Maximum number of frames between key frames # @option opts [Integer] :effort Level of CPU effort to reduce file size +# @option opts [Integer] :target_size Desired target size in bytes # @option opts [Boolean] :mixed Allow mixed encoding (might reduce file size) +# @option opts [Boolean] :smart_deblock Enable auto-adjusting of the deblocking filter +# @option opts [Integer] :passes Number of entropy-analysis passes (in [1..10]) # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [nil] # @!method tiffsave(filename, **opts) @@ -2099,7 +2155,6 @@ class Image # @option opts [Vips::ForeignTiffPredictor] :predictor Compression prediction # @option opts [Boolean] :tile Write a tiled tiff # @option opts [Integer] :tile_width Tile width in pixels -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Integer] :tile_height Tile height in pixels # @option opts [Boolean] :pyramid Write a pyramidal tiff # @option opts [Boolean] :miniswhite Use 0 for white in 1-bit images @@ -2110,7 +2165,7 @@ class Image # @option opts [Boolean] :bigtiff Write a bigtiff image # @option opts [Boolean] :properties Write a properties document to IMAGEDESCRIPTION # @option opts [Vips::RegionShrink] :region_shrink Method to shrink regions -# @option opts [Integer] :level ZSTD compression level +# @option opts [Integer] :level Deflate (1-9, default 6) or ZSTD (1-22, default 9) compression level # @option opts [Boolean] :lossless Enable WEBP lossless mode # @option opts [Vips::ForeignDzDepth] :depth Pyramid depth # @option opts [Boolean] :subifd Save pyr layers as sub-IFDs @@ -2118,6 +2173,7 @@ class Image # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [nil] # @!method tiffsave_buffer(**opts) @@ -2128,7 +2184,6 @@ class Image # @option opts [Vips::ForeignTiffPredictor] :predictor Compression prediction # @option opts [Boolean] :tile Write a tiled tiff # @option opts [Integer] :tile_width Tile width in pixels -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Integer] :tile_height Tile height in pixels # @option opts [Boolean] :pyramid Write a pyramidal tiff # @option opts [Boolean] :miniswhite Use 0 for white in 1-bit images @@ -2139,7 +2194,7 @@ class Image # @option opts [Boolean] :bigtiff Write a bigtiff image # @option opts [Boolean] :properties Write a properties document to IMAGEDESCRIPTION # @option opts [Vips::RegionShrink] :region_shrink Method to shrink regions -# @option opts [Integer] :level ZSTD compression level +# @option opts [Integer] :level Deflate (1-9, default 6) or ZSTD (1-22, default 9) compression level # @option opts [Boolean] :lossless Enable WEBP lossless mode # @option opts [Vips::ForeignDzDepth] :depth Pyramid depth # @option opts [Boolean] :subifd Save pyr layers as sub-IFDs @@ -2147,6 +2202,7 @@ class Image # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [VipsBlob] Buffer to save to # @!method tiffsave_target(target, **opts) @@ -2158,7 +2214,6 @@ class Image # @option opts [Vips::ForeignTiffPredictor] :predictor Compression prediction # @option opts [Boolean] :tile Write a tiled tiff # @option opts [Integer] :tile_width Tile width in pixels -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Integer] :tile_height Tile height in pixels # @option opts [Boolean] :pyramid Write a pyramidal tiff # @option opts [Boolean] :miniswhite Use 0 for white in 1-bit images @@ -2169,7 +2224,7 @@ class Image # @option opts [Boolean] :bigtiff Write a bigtiff image # @option opts [Boolean] :properties Write a properties document to IMAGEDESCRIPTION # @option opts [Vips::RegionShrink] :region_shrink Method to shrink regions -# @option opts [Integer] :level ZSTD compression level +# @option opts [Integer] :level Deflate (1-9, default 6) or ZSTD (1-22, default 9) compression level # @option opts [Boolean] :lossless Enable WEBP lossless mode # @option opts [Vips::ForeignDzDepth] :depth Pyramid depth # @option opts [Boolean] :subifd Save pyr layers as sub-IFDs @@ -2177,26 +2232,27 @@ class Image # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [nil] # @!method fitssave(filename, **opts) # Save image to fits file. # @param filename [String] Filename to save to # @param opts [Hash] Set of options -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [nil] # @!method niftisave(filename, **opts) # Save image to nifti file. # @param filename [String] Filename to save to # @param opts [Hash] Set of options -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [nil] # @!method heifsave(filename, **opts) @@ -2205,7 +2261,6 @@ class Image # @param opts [Hash] Set of options # @option opts [Integer] :Q Q factor # @option opts [Integer] :bitdepth Number of bits per pixel -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Boolean] :lossless Enable lossless compression # @option opts [Vips::ForeignHeifCompression] :compression Compression format # @option opts [Integer] :effort CPU effort @@ -2214,6 +2269,7 @@ class Image # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [nil] # @!method heifsave_buffer(**opts) @@ -2221,7 +2277,6 @@ class Image # @param opts [Hash] Set of options # @option opts [Integer] :Q Q factor # @option opts [Integer] :bitdepth Number of bits per pixel -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Boolean] :lossless Enable lossless compression # @option opts [Vips::ForeignHeifCompression] :compression Compression format # @option opts [Integer] :effort CPU effort @@ -2230,6 +2285,7 @@ class Image # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [VipsBlob] Buffer to save to # @!method heifsave_target(target, **opts) @@ -2238,7 +2294,6 @@ class Image # @param opts [Hash] Set of options # @option opts [Integer] :Q Q factor # @option opts [Integer] :bitdepth Number of bits per pixel -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Boolean] :lossless Enable lossless compression # @option opts [Vips::ForeignHeifCompression] :compression Compression format # @option opts [Integer] :effort CPU effort @@ -2247,21 +2302,22 @@ class Image # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [nil] # @!method jxlsave(filename, **opts) # Save image in jpeg-xl format. -# @param filename [String] Filename to load from +# @param filename [String] Filename to save to # @param opts [Hash] Set of options # @option opts [Integer] :tier Decode speed tier # @option opts [Float] :distance Target butteraugli distance -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Integer] :effort Encoding effort # @option opts [Boolean] :lossless Enable lossless compression # @option opts [Integer] :Q Quality factor # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [nil] # @!method jxlsave_buffer(**opts) @@ -2269,13 +2325,13 @@ class Image # @param opts [Hash] Set of options # @option opts [Integer] :tier Decode speed tier # @option opts [Float] :distance Target butteraugli distance -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Integer] :effort Encoding effort # @option opts [Boolean] :lossless Enable lossless compression # @option opts [Integer] :Q Quality factor # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [VipsBlob] Buffer to save to # @!method jxlsave_target(target, **opts) @@ -2284,13 +2340,13 @@ class Image # @param opts [Hash] Set of options # @option opts [Integer] :tier Decode speed tier # @option opts [Float] :distance Target butteraugli distance -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Integer] :effort Encoding effort # @option opts [Boolean] :lossless Enable lossless compression # @option opts [Integer] :Q Quality factor # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [nil] # @!method magicksave(filename, **opts) @@ -2302,10 +2358,10 @@ class Image # @option opts [Boolean] :optimize_gif_frames Apply GIF frames optimization # @option opts [Boolean] :optimize_gif_transparency Apply GIF transparency optimization # @option opts [Integer] :bitdepth Number of bits per pixel -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [nil] # @!method magicksave_buffer(**opts) @@ -2316,10 +2372,10 @@ class Image # @option opts [Boolean] :optimize_gif_frames Apply GIF frames optimization # @option opts [Boolean] :optimize_gif_transparency Apply GIF transparency optimization # @option opts [Integer] :bitdepth Number of bits per pixel -# @option opts [String] :profile Filename of ICC profile to embed # @option opts [Vips::ForeignKeep] :keep Which metadata to retain # @option opts [Array] :background Background value # @option opts [Integer] :page_height Set page height for multipage save +# @option opts [String] :profile Filename of ICC profile to embed # @return [VipsBlob] Buffer to save to # @!method self.thumbnail(filename, width, **opts) @@ -2470,7 +2526,7 @@ class Image # Similarity transform of an image. # @param opts [Hash] Set of options # @option opts [Float] :scale Scale by this factor -# @option opts [Float] :angle Rotate anticlockwise by this many degrees +# @option opts [Float] :angle Rotate clockwise by this many degrees # @option opts [Vips::Interpolate] :interpolate Interpolate pixels with this # @option opts [Array] :background Background value # @option opts [Float] :odx Horizontal output displacement @@ -2481,7 +2537,7 @@ class Image # @!method rotate(angle, **opts) # Rotate an image by a number of degrees. -# @param angle [Float] Rotate anticlockwise by this many degrees +# @param angle [Float] Rotate clockwise by this many degrees # @param opts [Hash] Set of options # @option opts [Vips::Interpolate] :interpolate Interpolate pixels with this # @option opts [Array] :background Background value diff --git a/lib/vips/operation.rb b/lib/vips/operation.rb index aebe5981..7d58bc18 100644 --- a/lib/vips/operation.rb +++ b/lib/vips/operation.rb @@ -218,7 +218,7 @@ def initialize value raise Vips::Error if value.null? end - super(value) + super end def build From bafd88c211063131f27ce5c51a37d13bac5299f7 Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Mon, 4 Nov 2024 10:04:35 +0100 Subject: [PATCH 48/50] Ensure variadic call is null-terminated --- CHANGELOG.md | 2 ++ lib/vips/image.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index caabbb52..9bb5fd7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## master +* fix `Image#add_alpha()` with libvips 8.16 [kleisauke] + ## Version 2.2.2 (2024-07-17) * fix compat with unified (semistatic) libvips binaries [kleisauke] diff --git a/lib/vips/image.rb b/lib/vips/image.rb index 45bd2edd..e777d472 100644 --- a/lib/vips/image.rb +++ b/lib/vips/image.rb @@ -973,7 +973,7 @@ def has_alpha? # @return [Image] new image def add_alpha ptr = GenericPtr.new - result = Vips.vips_addalpha self, ptr + result = Vips.vips_addalpha self, ptr, :pointer, nil raise Vips::Error if result != 0 Vips::Image.new ptr[:value] From ff74ca67b9de320d0ee36a94f8fe974cd6ef0a1b Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Thu, 6 Feb 2025 10:37:01 +0100 Subject: [PATCH 49/50] Ensure correct FFI function definitions for `gboolean` parameters `gboolean` is a typedef for `int` in GLib. Resolves: #410. --- CHANGELOG.md | 1 + lib/vips.rb | 12 ++++++------ lib/vips/image.rb | 8 ++++---- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9bb5fd7d..7c09392b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## master * fix `Image#add_alpha()` with libvips 8.16 [kleisauke] +* fix FFI function definitions for `gboolean` parameters [kleisauke] ## Version 2.2.2 (2024-07-17) diff --git a/lib/vips.rb b/lib/vips.rb index 92af2e2d..aed3f1ab 100644 --- a/lib/vips.rb +++ b/lib/vips.rb @@ -810,13 +810,13 @@ def self.at_least_libvips?(x, y) end if at_least_libvips?(8, 13) - attach_function :vips_block_untrusted_set, [:bool], :void - attach_function :vips_operation_block_set, %i[string bool], :void + attach_function :vips_block_untrusted_set, [:int], :void + attach_function :vips_operation_block_set, [:string, :int], :void # Block/unblock all untrusted operations from running. # Use `vips -l` at the command-line to see the class hierarchy and which operations are marked as untrusted. - def self.block_untrusted(enabled) - vips_block_untrusted_set(enabled) + def self.block_untrusted(state) + vips_block_untrusted_set(state ? 1 : 0) end # Block/unblock all operations in the libvips class hierarchy at specified *operation_name* and below. @@ -829,8 +829,8 @@ def self.block_untrusted(enabled) # Use `vips -l` at the command-line to see the class hierarchy. # This call does nothing if the named operation is not found. # - def self.block(operation_name, enabled) - vips_operation_block_set(operation_name, enabled) + def self.block(operation_name, state) + vips_operation_block_set(operation_name, state ? 1 : 0) end end diff --git a/lib/vips/image.rb b/lib/vips/image.rb index e777d472..ea8b1af5 100644 --- a/lib/vips/image.rb +++ b/lib/vips/image.rb @@ -14,8 +14,8 @@ module Vips attach_function :vips_image_copy_memory, [:pointer], :pointer - attach_function :vips_image_set_progress, [:pointer, :bool], :void - attach_function :vips_image_set_kill, [:pointer, :bool], :void + attach_function :vips_image_set_progress, [:pointer, :int], :void + attach_function :vips_image_set_kill, [:pointer, :int], :void attach_function :vips_filename_get_filename, [:string], :pointer attach_function :vips_filename_get_options, [:string], :pointer @@ -716,7 +716,7 @@ def write_to_memory # @see Object#signal_connect # @param state [Boolean] progress signalling state def set_progress state - Vips.vips_image_set_progress self, state + Vips.vips_image_set_progress(self, state ? 1 : 0) end # Kill computation of this time. @@ -727,7 +727,7 @@ def set_progress state # @see Object#signal_connect # @param kill [Boolean] stop computation def set_kill kill - Vips.vips_image_set_kill self, kill + Vips.vips_image_set_kill(self, kill ? 1 : 0) end # Get the `GType` of a metadata field. The result is 0 if no such field From 9fb56ce86652c63d36f361991033f3787884dc8d Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Thu, 6 Feb 2025 07:30:41 -0800 Subject: [PATCH 50/50] bump version to 2.2.3 --- CHANGELOG.md | 2 ++ VERSION | 2 +- lib/vips/version.rb | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c09392b..876f8fa2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## master +## Version 2.2.3 (2025-02-06) + * fix `Image#add_alpha()` with libvips 8.16 [kleisauke] * fix FFI function definitions for `gboolean` parameters [kleisauke] diff --git a/VERSION b/VERSION index b1b25a5f..58594069 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.2.2 +2.2.3 diff --git a/lib/vips/version.rb b/lib/vips/version.rb index 44e9f330..7e19f84f 100644 --- a/lib/vips/version.rb +++ b/lib/vips/version.rb @@ -1,3 +1,3 @@ module Vips - VERSION = "2.2.2" + VERSION = "2.2.3" end