diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5492d03..a7216f4 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 @@ -36,10 +29,8 @@ jobs: strategy: matrix: - os-version: [ 'ubuntu-20.04' ] + os-version: [ 'ubuntu-24.04' ] ruby-version: - - '2.1' - - '2.2' - '2.3' - '2.4' - '2.5' @@ -64,19 +55,11 @@ 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 --fix-missing -qq -o Acquire::Retries=3 - libvips + sudo apt-get install --no-install-recommends libvips - name: Run Tests run: bundle exec rake spec diff --git a/CHANGELOG.md b/CHANGELOG.md index 38a12a4..1eb1e61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,18 @@ ## master +## Version 2.2.4 (2025-06-05) + +* fix write to target test with libvips 8.17 [jcupitt] +* update docs for libvips 8.17 [jcupitt] + +## Version 2.2.3 (2025-02-06) + +* fix `Image#add_alpha()` with libvips 8.16 [kleisauke] +* fix FFI function definitions for `gboolean` parameters [kleisauke] + +## 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..530cdd9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.2.1 +2.2.4 diff --git a/lib/vips.rb b/lib/vips.rb index 45c103d..aed3f1a 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 @@ -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 @@ -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 45bd2ed..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 @@ -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] diff --git a/lib/vips/methods.rb b/lib/vips/methods.rb index 2a436b2..9f1fea1 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 @@ -989,8 +1018,19 @@ class Image # @option opts [Vips::ForeignFlags] :flags Output Flags for this file # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items +# @!method self.ppmload_buffer(buffer, **opts) +# Load ppm from buffer. +# @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.ppmload_source(source, **opts) -# Load ppm base class. +# Load ppm from source. # @param source [Vips::Source] Source to load from # @param opts [Hash] Set of options # @option opts [Boolean] :memory Force open via memory @@ -1040,6 +1080,8 @@ class Image # @option opts [Float] :dpi Render at this DPI # @option opts [Float] :scale Scale output by this factor # @option opts [Boolean] :unlimited Allow SVG of any size +# @option opts [String] :stylesheet Custom CSS +# @option opts [Boolean] :high_bitdepth Enable scRGB 128-bit output (32-bit per channel) # @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 @@ -1054,6 +1096,8 @@ class Image # @option opts [Float] :dpi Render at this DPI # @option opts [Float] :scale Scale output by this factor # @option opts [Boolean] :unlimited Allow SVG of any size +# @option opts [String] :stylesheet Custom CSS +# @option opts [Boolean] :high_bitdepth Enable scRGB 128-bit output (32-bit per channel) # @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 @@ -1068,6 +1112,8 @@ class Image # @option opts [Float] :dpi Render at this DPI # @option opts [Float] :scale Scale output by this factor # @option opts [Boolean] :unlimited Allow SVG of any size +# @option opts [String] :stylesheet Custom CSS +# @option opts [Boolean] :high_bitdepth Enable scRGB 128-bit output (32-bit per channel) # @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 @@ -1080,6 +1126,7 @@ class Image # @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 [Boolean] :oneshot Load images a frame at a time # @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 @@ -1092,6 +1139,7 @@ class Image # @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 [Boolean] :oneshot Load images a frame at a time # @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 @@ -1104,6 +1152,7 @@ class Image # @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 [Boolean] :oneshot Load images a frame at a time # @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 @@ -1286,9 +1335,10 @@ class 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] :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 [Integer] :subifd Subifd index +# @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 @@ -1301,9 +1351,10 @@ class 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] :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 [Integer] :subifd Subifd index +# @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 @@ -1316,9 +1367,10 @@ class 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] :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 [Integer] :subifd Subifd index +# @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 @@ -1462,6 +1514,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 +1527,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 +1540,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 @@ -1543,7 +1601,7 @@ class Image # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items # @!method self.magickload(filename, **opts) -# Load file with imagemagick. +# Load file with imagemagick7. # @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 @@ -1557,7 +1615,7 @@ class Image # @return [Vips::Image, Hash Object>] Output image, Hash of optional output items # @!method self.magickload_buffer(buffer, **opts) -# Load buffer with imagemagick. +# Load buffer with imagemagick7. # @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 @@ -1574,91 +1632,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 +1734,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 +1747,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 +1795,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 +1809,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 +1817,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 +1824,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,15 +1833,16 @@ 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 # @option opts [Float] :interpalette_maxerror Maximum inter-palette error for palette reusage # @option opts [Boolean] :interlace Generate an interlaced (progressive) GIF +# @option opts [Boolean] :keep_duplicate_frames Keep duplicate frames in the output instead of combining them # @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,15 +1850,16 @@ 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 # @option opts [Float] :interpalette_maxerror Maximum inter-palette error for palette reusage # @option opts [Boolean] :interlace Generate an interlaced (progressive) GIF +# @option opts [Boolean] :keep_duplicate_frames Keep duplicate frames in the output instead of combining them # @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,15 +1868,16 @@ 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 # @option opts [Float] :interpalette_maxerror Maximum inter-palette error for palette reusage # @option opts [Boolean] :interlace Generate an interlaced (progressive) GIF +# @option opts [Boolean] :keep_duplicate_frames Keep duplicate frames in the output instead of combining them # @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 +1889,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 +1901,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 +1912,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 +1924,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 +1936,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 +1948,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 +1966,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 +1983,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 +1992,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 +2001,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 +2009,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 +2020,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 +2038,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 +2046,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 +2057,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 +2075,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 +2084,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 +2092,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 +2107,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 +2115,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 +2131,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 +2139,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 +2154,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 +2162,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 +2181,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 +2191,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 +2199,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 +2210,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 +2220,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 +2228,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 +2240,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 +2250,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 +2258,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 +2287,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 +2295,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 +2303,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 +2311,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 +2320,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 +2328,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 +2351,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 +2366,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 +2384,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 +2398,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) @@ -2332,8 +2414,8 @@ class Image # @option opts [Boolean] :no_rotate Don't use orientation tags to rotate image upright # @option opts [Vips::Interesting] :crop Reduce to fill target rectangle, then crop # @option opts [Boolean] :linear Reduce in linear light -# @option opts [String] :import_profile Fallback import profile -# @option opts [String] :export_profile Fallback export profile +# @option opts [String] :input_profile Fallback input profile +# @option opts [String] :output_profile Fallback output profile # @option opts [Vips::Intent] :intent Rendering intent # @option opts [Vips::FailOn] :fail_on Error level to fail on # @return [Vips::Image] Output image @@ -2349,8 +2431,8 @@ class Image # @option opts [Boolean] :no_rotate Don't use orientation tags to rotate image upright # @option opts [Vips::Interesting] :crop Reduce to fill target rectangle, then crop # @option opts [Boolean] :linear Reduce in linear light -# @option opts [String] :import_profile Fallback import profile -# @option opts [String] :export_profile Fallback export profile +# @option opts [String] :input_profile Fallback input profile +# @option opts [String] :output_profile Fallback output profile # @option opts [Vips::Intent] :intent Rendering intent # @option opts [Vips::FailOn] :fail_on Error level to fail on # @return [Vips::Image] Output image @@ -2364,8 +2446,8 @@ class Image # @option opts [Boolean] :no_rotate Don't use orientation tags to rotate image upright # @option opts [Vips::Interesting] :crop Reduce to fill target rectangle, then crop # @option opts [Boolean] :linear Reduce in linear light -# @option opts [String] :import_profile Fallback import profile -# @option opts [String] :export_profile Fallback export profile +# @option opts [String] :input_profile Fallback input profile +# @option opts [String] :output_profile Fallback output profile # @option opts [Vips::Intent] :intent Rendering intent # @option opts [Vips::FailOn] :fail_on Error level to fail on # @return [Vips::Image] Output image @@ -2381,8 +2463,8 @@ class Image # @option opts [Boolean] :no_rotate Don't use orientation tags to rotate image upright # @option opts [Vips::Interesting] :crop Reduce to fill target rectangle, then crop # @option opts [Boolean] :linear Reduce in linear light -# @option opts [String] :import_profile Fallback import profile -# @option opts [String] :export_profile Fallback export profile +# @option opts [String] :input_profile Fallback input profile +# @option opts [String] :output_profile Fallback output profile # @option opts [Vips::Intent] :intent Rendering intent # @option opts [Vips::FailOn] :fail_on Error level to fail on # @return [Vips::Image] Output image @@ -2470,7 +2552,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 +2563,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 @@ -2549,6 +2631,16 @@ 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 @@ -2594,6 +2686,17 @@ class Image # @param opts [Hash] Set of options # @return [Vips::Image] Output image +# @!method sRGB2scRGB(**opts) +# Convert an srgb image to scrgb. +# @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 sRGB2HSV(**opts) # Transform srgb to hsv. # @param opts [Hash] Set of options @@ -2604,6 +2707,12 @@ class Image # @param opts [Hash] Set of options # @return [Vips::Image] Output image +# @!method scRGB2sRGB(**opts) +# Convert scrgb to srgb. +# @param opts [Hash] Set of options +# @option opts [Integer] :depth Output device space depth in bits +# @return [Vips::Image] Output image + # @!method icc_import(**opts) # Import from device with icc profile. # @param opts [Hash] Set of options @@ -2654,33 +2763,6 @@ class Image # @param opts [Hash] Set of options # @return [Vips::Image] Output image -# @!method sRGB2scRGB(**opts) -# Convert an srgb image to scrgb. -# @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 -# @option opts [Integer] :depth Output device space depth in bits -# @return [Vips::Image] Output image - # @!method CMYK2XYZ(**opts) # Transform cmyk to xyz. # @param opts [Hash] Set of options @@ -3067,7 +3149,13 @@ class Image # @return [Vips::Image] Output image # @!method matrixinvert(**opts) -# Invert an matrix. +# Invert a matrix. +# @param opts [Hash] Set of options +# @return [Vips::Image] Output matrix + +# @!method matrixmultiply(right, **opts) +# Multiply two matrices. +# @param right [Vips::Image] Second matrix to multiply # @param opts [Hash] Set of options # @return [Vips::Image] Output matrix @@ -3094,6 +3182,13 @@ class Image # @param opts [Hash] Set of options # @option opts [Float] :gamma Image gamma # @option opts [Boolean] :int_output Integer output +# @return [Vips::Image] Output image + +# @!method remosaic(old_str, new_str, **opts) +# Rebuild an mosaiced image. +# @param old_str [String] Search for this string +# @param new_str [String] And swap for this string +# @param opts [Hash] Set of options # @return [Vips::Image] Output image end 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 diff --git a/lib/vips/version.rb b/lib/vips/version.rb index c60474f..e00f5c8 100644 --- a/lib/vips/version.rb +++ b/lib/vips/version.rb @@ -1,3 +1,3 @@ module Vips - VERSION = "2.2.1" + VERSION = "2.2.4" end 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"] diff --git a/spec/connection_spec.rb b/spec/connection_spec.rb index 10dc4c7..35f3c25 100644 --- a/spec/connection_spec.rb +++ b/spec/connection_spec.rb @@ -66,7 +66,9 @@ it "can't create a target to a bad filename" do expect { - Vips::Target.new_to_file "/banana/monkey" + target = Vips::Target.new_to_file "/banana/monkey" + image = Vips::Image.black 1, 1 + image.write_to_target(target, "") }.to raise_exception(Vips::Error) end