From 491d7d9d176f6baaa656d6126b358daf5b27d124 Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Thu, 7 Mar 2024 10:53:03 +0100 Subject: [PATCH 01/15] 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 45c103d..3d55024 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 02/15] Fix lint --- lib/vips.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/vips.rb b/lib/vips.rb index 3d55024..92af2e2 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 03/15] 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 9e70604..6f0ec85 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 04/15] 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 5492d03..54eb625 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 05/15] 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 54eb625..ed7f306 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 06/15] 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 38a12a4..caabbb5 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 c043eea..b1b25a5 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 c60474f..44e9f33 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 07/15] 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 aebe598..7d58bc1 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 08/15] 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 ed7f306..617e861 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 09/15] 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 617e861..51c7958 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 10/15] 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 51c7958..a40b6fa 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 11/15] 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 a40b6fa..a7216f4 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 12/15] 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 2a436b2..a514d71 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 aebe598..7d58bc1 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 13/15] 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 caabbb5..9bb5fd7 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 45bd2ed..e777d47 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 14/15] 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 9bb5fd7..7c09392 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 92af2e2..aed3f1a 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 e777d47..ea8b1af 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 15/15] 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 7c09392..876f8fa 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 b1b25a5..5859406 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 44e9f33..7e19f84 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