ruby-vips 2.2.3 → 2.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 94d18bf3b8d377111af5d5b537deeb0bc391bf92968e5d757607f393d35eff59
4
- data.tar.gz: c83b03c317e3717aa21fdeecbd940890351c5be5290a6dd4cafbd3efd8ab3da7
3
+ metadata.gz: cbcb710d3c731107872917d35da6b921cae90ebdafb88d7fc917e8556bf7c2fe
4
+ data.tar.gz: 3e594a080fb2258609ae1b427e5df60ede8d8aee2730102ce2045c9b96f4e830
5
5
  SHA512:
6
- metadata.gz: d3dfb006f74d11ca1af36bd423185a5336849bf34d63966f02ed6f5d9a14ab5f89ddf8b86d029569b5d609a393dec0dfbe21843fa0514a8d179026bb706cc3de
7
- data.tar.gz: cdb4469a96a362af3cf1377bb64d50e1327c4711cc0aa2b6222e6d0b08e1f38541bc4fb2e9adc42e3ded39316d6ec87f6a08fa9ff8752a023a1da4c684497213
6
+ metadata.gz: d85ea128b1db40b818a9beb854cb2ae26ae28efd55fd6f31cbceb88a46661e804fd6ed273f78406e7e5cc781e9bfdb99c35421e9ca995c15cc8446a4e2056ae1
7
+ data.tar.gz: 1e47faba504bc492b279a0d4ca8760c48c15e59a5c4eb9feaf88cb6ff8b453d6f08af63dd33ee7b3ef65daabf9badf37930157a10cc98447acc71930f1419543
data/CHANGELOG.md CHANGED
@@ -2,6 +2,17 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## Version 2.2.5 (2025-08-20)
6
+
7
+ * improve NULL pointer handling [dloebl]
8
+ * improve GFlags argument handling [jcupitt]
9
+ * add missing flag and enum docs [jcupitt]
10
+
11
+ ## Version 2.2.4 (2025-06-05)
12
+
13
+ * fix write to target test with libvips 8.17 [jcupitt]
14
+ * update docs for libvips 8.17 [jcupitt]
15
+
5
16
  ## Version 2.2.3 (2025-02-06)
6
17
 
7
18
  * fix `Image#add_alpha()` with libvips 8.16 [kleisauke]
@@ -13,8 +24,8 @@
13
24
 
14
25
  ## Version 2.2.1 (2024-02-21)
15
26
 
16
- * add `Vips.block_untrusted` method to block all untrusted operations. Only for libvips >= 8.13. [Docs](https://www.libvips.org/API/current/libvips-vips.html#vips-block-untrusted-set). [#382](https://github.com/libvips/ruby-vips/pull/382) [aglushkov](https://github.com/aglushkov)
17
- * add `Vips.block` method to block specific operation. Only for libvips >= 8.13. [Docs](https://www.libvips.org/API/current/VipsOperation.html#vips-operation-block-set). [#382](https://github.com/libvips/ruby-vips/pull/382) [aglushkov](https://github.com/aglushkov)
27
+ * add `Vips.block_untrusted` method to block all untrusted operations. Only for libvips >= 8.13. [Docs](https://www.libvips.org/API/current/func.block_untrusted_set.html). [#382](https://github.com/libvips/ruby-vips/pull/382) [aglushkov](https://github.com/aglushkov)
28
+ * add `Vips.block` method to block specific operation. Only for libvips >= 8.13. [Docs](https://www.libvips.org/API/current/type_func.Operation.block_set.html). [#382](https://github.com/libvips/ruby-vips/pull/382) [aglushkov](https://github.com/aglushkov)
18
29
  * `new_from_source` keeps a ref to the source object [taylorthurlow]
19
30
  * some fixes to object references system
20
31
 
data/README.md CHANGED
@@ -52,7 +52,7 @@ im = Vips::Image.new_from_file filename
52
52
  # put im at position (100, 100) in a 3000 x 3000 pixel image,
53
53
  # make the other pixels in the image by mirroring im up / down /
54
54
  # left / right, see
55
- # https://libvips.github.io/libvips/API/current/libvips-conversion.html#vips-embed
55
+ # https://www.libvips.org/API/current/method.Image.embed.html
56
56
  im = im.embed 100, 100, 3000, 3000, extend: :mirror
57
57
 
58
58
  # multiply the green (middle) band by 2, leave the other two alone
@@ -80,7 +80,7 @@ should always work.
80
80
  See the `Vips` section in the docs for a [tutorial introduction with
81
81
  examples](https://www.rubydoc.info/gems/ruby-vips/Vips).
82
82
 
83
- The [libvips reference manual](https://libvips.github.io/libvips/API/current/)
83
+ The [libvips reference manual](https://www.libvips.org/API/current/)
84
84
  has a complete explanation of every method.
85
85
 
86
86
  The [`example/`](https://github.com/libvips/ruby-vips/tree/master/example)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.2.3
1
+ 2.2.5
@@ -0,0 +1,10 @@
1
+ module Vips
2
+ # How to combine values, see for example {Image#compass}.
3
+ #
4
+ # * `:max` take the maximum of the possible values
5
+ # * `:sum` sum all the values
6
+ # * `:min` take the minimum value
7
+
8
+ class Combine < Symbol
9
+ end
10
+ end
@@ -0,0 +1,15 @@
1
+ module Vips
2
+ # How sensitive loaders are to errors, from never stop (very insensitive),
3
+ # to stop on the smallest warning (very sensitive).
4
+ #
5
+ # Each implies the ones before it, so `:error` implies `:truncated`, for
6
+ # example.
7
+ #
8
+ # * `:none` never stop
9
+ # * `:truncated` stop on image truncated, nothing else
10
+ # * `:error` stop on serious error or truncation
11
+ # * `:warning` stop on anything, even warnings
12
+
13
+ class FailOn < Symbol
14
+ end
15
+ end
@@ -0,0 +1,10 @@
1
+ module Vips
2
+ # The container format to use
3
+ #
4
+ # * `:fs` write tiles to the filesystem
5
+ # * `:zip` write tiles to a zip file
6
+ # * `:szi` write to a szi file
7
+
8
+ class ForeignDzContainer < Symbol
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ module Vips
2
+ # How many pyramid layers to create.
3
+ #
4
+ # * `:onepixel` create layers down to 1x1 pixel
5
+ # * `:onetile` create layers down to 1x1 tile
6
+ # * `:one` only create a single layer
7
+
8
+ class ForeignDzDepth < Symbol
9
+ end
10
+ end
@@ -0,0 +1,12 @@
1
+ module Vips
2
+ # What directory layout and metadata standard to use.
3
+ #
4
+ # * `:dz` use DeepZoom directory layout
5
+ # * `:zoomify` use Zoomify directory layout
6
+ # * `:google` use Google maps directory layout
7
+ # * `:iiif` use IIIF v2 directory layout
8
+ # * `:iiif3` use IIIF v3 directory layout
9
+
10
+ class ForeignDzLayout < Symbol
11
+ end
12
+ end
@@ -0,0 +1,11 @@
1
+ module Vips
2
+ # The compression format to use inside a HEIF container
3
+ #
4
+ # * `:hevc` x265
5
+ # * `:avc` x264
6
+ # * `:jpeg` jpeg
7
+ # * `:av1` aom
8
+
9
+ class ForeignHeifCompression < Symbol
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ module Vips
2
+ # The selected encoder to use.
3
+ #
4
+ # * `:auto` auto
5
+ # * `:rav1e` RAV1E
6
+ # * `:svt` SVT-AV1
7
+ # * `:x265` x265
8
+
9
+ class ForeignHeifEncoder < Symbol
10
+ end
11
+ end
@@ -0,0 +1,13 @@
1
+ module Vips
2
+ # Savers can be given a set of metadata items to keep.
3
+ #
4
+ # * `:none` remove all metadata
5
+ # * `:exif` keep EXIF metadata
6
+ # * `:xmp` keep XMP metadata
7
+ # * `:iptc` keep IPTC metadata
8
+ # * `:icc` keep ICC profiles
9
+ # * `:other` keep other metadata
10
+
11
+ class ForeignKeep < Symbol
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ module Vips
2
+ # The set of filters for PNG save. See http://www.w3.org/TR/PNG-Filters.html
3
+ #
4
+ # * `:none` no filtering
5
+ # * `:sub` difference to the left
6
+ # * `:up` difference up
7
+ # * `:avg` average of left and up
8
+ # * `:paeth` pick best neighbor predictor automatically
9
+ # * `:all` adaptive
10
+
11
+ class ForeignPngFilter < Symbol
12
+ end
13
+ end
@@ -0,0 +1,12 @@
1
+ module Vips
2
+ # The netpbm file format to save as.
3
+ #
4
+ # * `:pbm` portable bitmap
5
+ # * `:pgm` portable greymap
6
+ # * `:ppm` portable pixmap
7
+ # * `:pfm` portable float map
8
+ # * `:pnm` portable anymap
9
+
10
+ class ForeignPpmFormat < Symbol
11
+ end
12
+ end
@@ -0,0 +1,10 @@
1
+ module Vips
2
+ # Set subsampling mode.
3
+ #
4
+ # * `:auto` prevent subsampling when quality >= 90
5
+ # * `:on` always perform subsampling
6
+ # * `:off` never perform subsampling
7
+
8
+ class ForeignSubsample < Symbol
9
+ end
10
+ end
@@ -0,0 +1,16 @@
1
+ module Vips
2
+ # The compression types supported by the tiff writer.
3
+ #
4
+ # * `:none` no compression
5
+ # * `:jpeg` jpeg compression
6
+ # * `:deflate` deflate (zip) compression
7
+ # * `:packbits` packbits compression
8
+ # * `:ccittfax4` fax4 compression
9
+ # * `:lzw` LZW compression
10
+ # * `:webp` WEBP compression
11
+ # * `:zstd` ZSTD compression
12
+ # * `:jp2k` JP2K compression
13
+
14
+ class ForeignTiffCompression < Symbol
15
+ end
16
+ end
@@ -0,0 +1,10 @@
1
+ module Vips
2
+ # The predictor can help deflate and lzw compression.
3
+ #
4
+ # * `:none` no prediction
5
+ # * `:horizontal` horizontal differencing
6
+ # * `:float` float predictor
7
+
8
+ class ForeignTiffPredictor < Symbol
9
+ end
10
+ end
@@ -0,0 +1,9 @@
1
+ module Vips
2
+ # Use inches or centimeters as the resolution unit for a tiff file.
3
+ #
4
+ # * `:cm` use centimeters
5
+ # * `:inch` use inches
6
+
7
+ class ForeignTiffResunit < Symbol
8
+ end
9
+ end
@@ -0,0 +1,13 @@
1
+ module Vips
2
+ # Tune lossy encoder settings for different image types.
3
+ #
4
+ # * `:default` default preset
5
+ # * `:picture` digital picture, like portrait, inner shot
6
+ # * `:photo` outdoor photograph, with natural lighting
7
+ # * `:drawing` hand or line drawing, with high-contrast details
8
+ # * `:icon` small-sized colorful images
9
+ # * `:text` text-like
10
+
11
+ class ForeignWebpPreset < Symbol
12
+ end
13
+ end
data/lib/vips/gvalue.rb CHANGED
@@ -25,7 +25,7 @@ module GObject
25
25
  :data, [:ulong_long, 2]
26
26
 
27
27
  # convert an enum value (str/symb/int) into an int ready for libvips
28
- def self.from_nick(gtype, value)
28
+ def self.enum_from_nick(gtype, value)
29
29
  value = value.to_s if value.is_a? Symbol
30
30
 
31
31
  if value.is_a? String
@@ -40,6 +40,43 @@ module GObject
40
40
  value
41
41
  end
42
42
 
43
+ # compatibility ... we used to call it this, perhaps someone has used this
44
+ # internal method
45
+ def self.from_nick(gtype, value)
46
+ GValue.enum_from_nick(gtype, value)
47
+ end
48
+
49
+ # convert an flags value (array[str/symb/int] | str/symb/int) into an
50
+ # int ready for libvips
51
+ def self.flags_from_nick(gtype, value)
52
+ if value.is_a? String
53
+ # libvips will parse strings like "sub|up" etc.
54
+ name = value.tr("_", "-")
55
+ value = Vips.vips_flags_from_nick "ruby-vips", gtype, name
56
+ else
57
+ value = [value] if !value.is_a? Array
58
+
59
+ # convert each item to a set of bits, OR them together
60
+ result = 0
61
+ value.map do |item|
62
+ item = item.to_s if item.is_a? Symbol
63
+ if item.is_a? String
64
+ name = item.tr("_", "-")
65
+ item = Vips.vips_flags_from_nick "ruby-vips", gtype, name
66
+ if item == -1
67
+ raise Vips::Error
68
+ end
69
+ end
70
+
71
+ result |= item
72
+ end
73
+
74
+ value = result
75
+ end
76
+
77
+ value
78
+ end
79
+
43
80
  # convert an int enum back into a symbol
44
81
  def self.to_nick(gtype, enum_value)
45
82
  enum_name = Vips.vips_enum_nick gtype, enum_value
@@ -148,10 +185,11 @@ module GObject
148
185
  else
149
186
  case fundamental
150
187
  when GFLAGS_TYPE
151
- ::GObject.g_value_set_flags self, value
188
+ flags_value = GValue.flags_from_nick(self[:gtype], value)
189
+ ::GObject.g_value_set_flags self, flags_value
152
190
 
153
191
  when GENUM_TYPE
154
- enum_value = GValue.from_nick(self[:gtype], value)
192
+ enum_value = GValue.enum_from_nick(self[:gtype], value)
155
193
  ::GObject.g_value_set_enum self, enum_value
156
194
 
157
195
  when GOBJECT_TYPE
data/lib/vips/image.rb CHANGED
@@ -114,12 +114,12 @@ module Vips
114
114
  end
115
115
 
116
116
  def self.complex? format
117
- format_number = GObject::GValue.from_nick BAND_FORMAT_TYPE, format
117
+ format_number = GObject::GValue.enum_from_nick BAND_FORMAT_TYPE, format
118
118
  Vips.vips_band_format_iscomplex(format_number) != 0
119
119
  end
120
120
 
121
121
  def self.float? format
122
- format_number = GObject::GValue.from_nick BAND_FORMAT_TYPE, format
122
+ format_number = GObject::GValue.enum_from_nick BAND_FORMAT_TYPE, format
123
123
  Vips.vips_band_format_isfloat(format_number) != 0
124
124
  end
125
125
 
@@ -380,7 +380,7 @@ module Vips
380
380
  size = data.bytesize
381
381
  end
382
382
 
383
- format_number = GObject::GValue.from_nick BAND_FORMAT_TYPE, format
383
+ format_number = GObject::GValue.enum_from_nick BAND_FORMAT_TYPE, format
384
384
  vi = Vips.vips_image_new_from_memory data, size,
385
385
  width, height, bands, format_number
386
386
  raise Vips::Error if vi.null?
@@ -405,7 +405,7 @@ module Vips
405
405
  # @param format [Symbol] band format
406
406
  # @return [Image] the loaded image
407
407
  def self.new_from_memory_copy data, width, height, bands, format
408
- format_number = GObject::GValue.from_nick BAND_FORMAT_TYPE, format
408
+ format_number = GObject::GValue.enum_from_nick BAND_FORMAT_TYPE, format
409
409
 
410
410
  if data.is_a?(FFI::Pointer)
411
411
  if data.size == UNKNOWN_POINTER_SIZE
@@ -471,9 +471,10 @@ module Vips
471
471
  def self.matrix_from_array width, height, array
472
472
  ptr = FFI::MemoryPointer.new :double, array.length
473
473
  ptr.write_array_of_double array
474
- image = Vips.vips_image_new_matrix_from_array width, height,
474
+ img_ptr = Vips.vips_image_new_matrix_from_array width, height,
475
475
  ptr, array.length
476
- Vips::Image.new image
476
+ raise Vips::Error if img_ptr.null?
477
+ Vips::Image.new img_ptr
477
478
  end
478
479
 
479
480
  # Create a new Image from a 1D or 2D array. A 1D array becomes an
@@ -534,7 +535,6 @@ module Vips
534
535
  end
535
536
 
536
537
  image = Vips::Image.matrix_from_array width, height, array
537
- raise Vips::Error if image.nil?
538
538
 
539
539
  image.mutate do |mutable|
540
540
  # be careful to set them as double
@@ -700,7 +700,7 @@ module Vips
700
700
  def write_to_memory
701
701
  len = Vips::SizeStruct.new
702
702
  ptr = Vips.vips_image_write_to_memory self, len
703
- raise Vips::Error if ptr.nil?
703
+ raise Vips::Error if ptr.null?
704
704
 
705
705
  # wrap up as an autopointer
706
706
  ptr = FFI::AutoPointer.new(ptr, GLib::G_FREE)
@@ -1319,7 +1319,7 @@ module Vips
1319
1319
  end
1320
1320
 
1321
1321
  mode = mode.map do |x|
1322
- GObject::GValue.from_nick Vips::BLEND_MODE_TYPE, x
1322
+ GObject::GValue.enum_from_nick Vips::BLEND_MODE_TYPE, x
1323
1323
  end
1324
1324
 
1325
1325
  Vips::Image.composite([self] + overlay, mode, **opts)
@@ -0,0 +1,12 @@
1
+ module Vips
2
+ # The rendering intent.
3
+ #
4
+ # * `:perceptual` perceptual rendering intent
5
+ # * `:relative` relative colorimetric rendering intent
6
+ # * `:saturation` saturation rendering intent
7
+ # * `:absolute` absolute colorimetric rendering intent
8
+ # * `:auto` the rendering intent that the profile suggests
9
+
10
+ class Intent < Symbol
11
+ end
12
+ end
@@ -50,7 +50,7 @@ module Vips
50
50
  def initialize name
51
51
  name = name.to_s if name.is_a? Symbol
52
52
  pointer = Vips.vips_interpolate_new name
53
- raise Vips::Error if pointer.nil?
53
+ raise Vips::Error if pointer.null?
54
54
 
55
55
  super(pointer)
56
56
  end
@@ -6,7 +6,6 @@ module Vips
6
6
  # * `:multiband` generic many-band image
7
7
  # * `:b_w` some kind of single-band image
8
8
  # * `:histogram` a 1D image, eg. histogram or lookup table
9
- # * `:fourier` image is in fourier space
10
9
  # * `:xyz` the first three bands are CIE XYZ
11
10
  # * `:lab` pixels are in CIE Lab space
12
11
  # * `:cmyk` the first four bands are in CMYK space
@@ -16,12 +15,14 @@ module Vips
16
15
  # * `:lch` pixels are in CIE LCh space
17
16
  # * `:labs` CIE LAB coded as three signed 16-bit values
18
17
  # * `:srgb` pixels are sRGB
19
- # * `:hsv` pixels are HSV
20
- # * `:scrgb` pixels are scRGB
21
18
  # * `:yxy` pixels are CIE Yxy
19
+ # * `:fourier` image is in fourier space
22
20
  # * `:rgb16` generic 16-bit RGB
23
21
  # * `:grey16` generic 16-bit mono
24
22
  # * `:matrix` a matrix
23
+ # * `:scrgb` pixels are scRGB
24
+ # * `:hsv` pixels are HSV
25
+
25
26
  class Interpretation < Symbol
26
27
  end
27
28
  end
data/lib/vips/kernel.rb CHANGED
@@ -4,16 +4,19 @@ module Vips
4
4
  #
5
5
  # At least these should be available:
6
6
  #
7
- # * `:nearest` Nearest-neighbour interpolation.
8
- # * `:linear` Linear interpolation.
9
- # * `:cubic` Cubic interpolation.
10
- # * `:lanczos2` Two-lobe Lanczos
11
- # * `:lanczos3` Three-lobe Lanczos
7
+ # * `:nearest` nearest-neighbour interpolation
8
+ # * `:linear` linear interpolation
9
+ # * `:cubic` cubic interpolation
10
+ # * `:mitchell` Mitchell interpolation
11
+ # * `:lanczos2` two-lobe Lanczos
12
+ # * `:lanczos3` three-lobe Lanczos
13
+ # * `:mks2013` convolve with Magic Kernel Sharp 2013
14
+ # * `:mks2021` convolve with Magic Kernel Sharp 2021
12
15
  #
13
16
  # For example:
14
17
  #
15
18
  # ```ruby
16
- # im = im.resize 3, :kernel => :lanczos2
19
+ # im = im.resize 3, kernel: :lanczos2
17
20
  # ```
18
21
 
19
22
  class Kernel < Symbol
data/lib/vips/methods.rb CHANGED
@@ -1018,8 +1018,19 @@ module Vips
1018
1018
  # @option opts [Vips::ForeignFlags] :flags Output Flags for this file
1019
1019
  # @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
1020
1020
 
1021
+ # @!method self.ppmload_buffer(buffer, **opts)
1022
+ # Load ppm from buffer.
1023
+ # @param buffer [VipsBlob] Buffer to load from
1024
+ # @param opts [Hash] Set of options
1025
+ # @option opts [Boolean] :memory Force open via memory
1026
+ # @option opts [Vips::Access] :access Required access pattern for this file
1027
+ # @option opts [Vips::FailOn] :fail_on Error level to fail on
1028
+ # @option opts [Boolean] :revalidate Don't use a cached result for this operation
1029
+ # @option opts [Vips::ForeignFlags] :flags Output Flags for this file
1030
+ # @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
1031
+
1021
1032
  # @!method self.ppmload_source(source, **opts)
1022
- # Load ppm base class.
1033
+ # Load ppm from source.
1023
1034
  # @param source [Vips::Source] Source to load from
1024
1035
  # @param opts [Hash] Set of options
1025
1036
  # @option opts [Boolean] :memory Force open via memory
@@ -1069,6 +1080,8 @@ module Vips
1069
1080
  # @option opts [Float] :dpi Render at this DPI
1070
1081
  # @option opts [Float] :scale Scale output by this factor
1071
1082
  # @option opts [Boolean] :unlimited Allow SVG of any size
1083
+ # @option opts [String] :stylesheet Custom CSS
1084
+ # @option opts [Boolean] :high_bitdepth Enable scRGB 128-bit output (32-bit per channel)
1072
1085
  # @option opts [Boolean] :memory Force open via memory
1073
1086
  # @option opts [Vips::Access] :access Required access pattern for this file
1074
1087
  # @option opts [Vips::FailOn] :fail_on Error level to fail on
@@ -1083,6 +1096,8 @@ module Vips
1083
1096
  # @option opts [Float] :dpi Render at this DPI
1084
1097
  # @option opts [Float] :scale Scale output by this factor
1085
1098
  # @option opts [Boolean] :unlimited Allow SVG of any size
1099
+ # @option opts [String] :stylesheet Custom CSS
1100
+ # @option opts [Boolean] :high_bitdepth Enable scRGB 128-bit output (32-bit per channel)
1086
1101
  # @option opts [Boolean] :memory Force open via memory
1087
1102
  # @option opts [Vips::Access] :access Required access pattern for this file
1088
1103
  # @option opts [Vips::FailOn] :fail_on Error level to fail on
@@ -1097,6 +1112,8 @@ module Vips
1097
1112
  # @option opts [Float] :dpi Render at this DPI
1098
1113
  # @option opts [Float] :scale Scale output by this factor
1099
1114
  # @option opts [Boolean] :unlimited Allow SVG of any size
1115
+ # @option opts [String] :stylesheet Custom CSS
1116
+ # @option opts [Boolean] :high_bitdepth Enable scRGB 128-bit output (32-bit per channel)
1100
1117
  # @option opts [Boolean] :memory Force open via memory
1101
1118
  # @option opts [Vips::Access] :access Required access pattern for this file
1102
1119
  # @option opts [Vips::FailOn] :fail_on Error level to fail on
@@ -1109,6 +1126,7 @@ module Vips
1109
1126
  # @param filename [String] Filename to load from
1110
1127
  # @param opts [Hash] Set of options
1111
1128
  # @option opts [Integer] :page Load this page from the image
1129
+ # @option opts [Boolean] :oneshot Load images a frame at a time
1112
1130
  # @option opts [Boolean] :memory Force open via memory
1113
1131
  # @option opts [Vips::Access] :access Required access pattern for this file
1114
1132
  # @option opts [Vips::FailOn] :fail_on Error level to fail on
@@ -1121,6 +1139,7 @@ module Vips
1121
1139
  # @param buffer [VipsBlob] Buffer to load from
1122
1140
  # @param opts [Hash] Set of options
1123
1141
  # @option opts [Integer] :page Load this page from the image
1142
+ # @option opts [Boolean] :oneshot Load images a frame at a time
1124
1143
  # @option opts [Boolean] :memory Force open via memory
1125
1144
  # @option opts [Vips::Access] :access Required access pattern for this file
1126
1145
  # @option opts [Vips::FailOn] :fail_on Error level to fail on
@@ -1133,6 +1152,7 @@ module Vips
1133
1152
  # @param source [Vips::Source] Source to load from
1134
1153
  # @param opts [Hash] Set of options
1135
1154
  # @option opts [Integer] :page Load this page from the image
1155
+ # @option opts [Boolean] :oneshot Load images a frame at a time
1136
1156
  # @option opts [Boolean] :memory Force open via memory
1137
1157
  # @option opts [Vips::Access] :access Required access pattern for this file
1138
1158
  # @option opts [Vips::FailOn] :fail_on Error level to fail on
@@ -1315,9 +1335,10 @@ module Vips
1315
1335
  # @param filename [String] Filename to load from
1316
1336
  # @param opts [Hash] Set of options
1317
1337
  # @option opts [Integer] :page First page to load
1318
- # @option opts [Integer] :subifd Subifd index
1319
1338
  # @option opts [Integer] :n Number of pages to load, -1 for all
1320
1339
  # @option opts [Boolean] :autorotate Rotate image using orientation tag
1340
+ # @option opts [Integer] :subifd Subifd index
1341
+ # @option opts [Boolean] :unlimited Remove all denial of service limits
1321
1342
  # @option opts [Boolean] :memory Force open via memory
1322
1343
  # @option opts [Vips::Access] :access Required access pattern for this file
1323
1344
  # @option opts [Vips::FailOn] :fail_on Error level to fail on
@@ -1330,9 +1351,10 @@ module Vips
1330
1351
  # @param buffer [VipsBlob] Buffer to load from
1331
1352
  # @param opts [Hash] Set of options
1332
1353
  # @option opts [Integer] :page First page to load
1333
- # @option opts [Integer] :subifd Subifd index
1334
1354
  # @option opts [Integer] :n Number of pages to load, -1 for all
1335
1355
  # @option opts [Boolean] :autorotate Rotate image using orientation tag
1356
+ # @option opts [Integer] :subifd Subifd index
1357
+ # @option opts [Boolean] :unlimited Remove all denial of service limits
1336
1358
  # @option opts [Boolean] :memory Force open via memory
1337
1359
  # @option opts [Vips::Access] :access Required access pattern for this file
1338
1360
  # @option opts [Vips::FailOn] :fail_on Error level to fail on
@@ -1345,9 +1367,10 @@ module Vips
1345
1367
  # @param source [Vips::Source] Source to load from
1346
1368
  # @param opts [Hash] Set of options
1347
1369
  # @option opts [Integer] :page First page to load
1348
- # @option opts [Integer] :subifd Subifd index
1349
1370
  # @option opts [Integer] :n Number of pages to load, -1 for all
1350
1371
  # @option opts [Boolean] :autorotate Rotate image using orientation tag
1372
+ # @option opts [Integer] :subifd Subifd index
1373
+ # @option opts [Boolean] :unlimited Remove all denial of service limits
1351
1374
  # @option opts [Boolean] :memory Force open via memory
1352
1375
  # @option opts [Vips::Access] :access Required access pattern for this file
1353
1376
  # @option opts [Vips::FailOn] :fail_on Error level to fail on
@@ -1578,7 +1601,7 @@ module Vips
1578
1601
  # @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
1579
1602
 
1580
1603
  # @!method self.magickload(filename, **opts)
1581
- # Load file with imagemagick.
1604
+ # Load file with imagemagick7.
1582
1605
  # @param filename [String] Filename to load from
1583
1606
  # @param opts [Hash] Set of options
1584
1607
  # @option opts [String] :density Canvas resolution for rendering vector formats like SVG
@@ -1592,7 +1615,7 @@ module Vips
1592
1615
  # @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
1593
1616
 
1594
1617
  # @!method self.magickload_buffer(buffer, **opts)
1595
- # Load buffer with imagemagick.
1618
+ # Load buffer with imagemagick7.
1596
1619
  # @param buffer [VipsBlob] Buffer to load from
1597
1620
  # @param opts [Hash] Set of options
1598
1621
  # @option opts [String] :density Canvas resolution for rendering vector formats like SVG
@@ -1815,6 +1838,7 @@ module Vips
1815
1838
  # @option opts [Boolean] :reuse Reuse palette from input
1816
1839
  # @option opts [Float] :interpalette_maxerror Maximum inter-palette error for palette reusage
1817
1840
  # @option opts [Boolean] :interlace Generate an interlaced (progressive) GIF
1841
+ # @option opts [Boolean] :keep_duplicate_frames Keep duplicate frames in the output instead of combining them
1818
1842
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
1819
1843
  # @option opts [Array<Double>] :background Background value
1820
1844
  # @option opts [Integer] :page_height Set page height for multipage save
@@ -1831,6 +1855,7 @@ module Vips
1831
1855
  # @option opts [Boolean] :reuse Reuse palette from input
1832
1856
  # @option opts [Float] :interpalette_maxerror Maximum inter-palette error for palette reusage
1833
1857
  # @option opts [Boolean] :interlace Generate an interlaced (progressive) GIF
1858
+ # @option opts [Boolean] :keep_duplicate_frames Keep duplicate frames in the output instead of combining them
1834
1859
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
1835
1860
  # @option opts [Array<Double>] :background Background value
1836
1861
  # @option opts [Integer] :page_height Set page height for multipage save
@@ -1848,6 +1873,7 @@ module Vips
1848
1873
  # @option opts [Boolean] :reuse Reuse palette from input
1849
1874
  # @option opts [Float] :interpalette_maxerror Maximum inter-palette error for palette reusage
1850
1875
  # @option opts [Boolean] :interlace Generate an interlaced (progressive) GIF
1876
+ # @option opts [Boolean] :keep_duplicate_frames Keep duplicate frames in the output instead of combining them
1851
1877
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
1852
1878
  # @option opts [Array<Double>] :background Background value
1853
1879
  # @option opts [Integer] :page_height Set page height for multipage save
@@ -2388,8 +2414,8 @@ module Vips
2388
2414
  # @option opts [Boolean] :no_rotate Don't use orientation tags to rotate image upright
2389
2415
  # @option opts [Vips::Interesting] :crop Reduce to fill target rectangle, then crop
2390
2416
  # @option opts [Boolean] :linear Reduce in linear light
2391
- # @option opts [String] :import_profile Fallback import profile
2392
- # @option opts [String] :export_profile Fallback export profile
2417
+ # @option opts [String] :input_profile Fallback input profile
2418
+ # @option opts [String] :output_profile Fallback output profile
2393
2419
  # @option opts [Vips::Intent] :intent Rendering intent
2394
2420
  # @option opts [Vips::FailOn] :fail_on Error level to fail on
2395
2421
  # @return [Vips::Image] Output image
@@ -2405,8 +2431,8 @@ module Vips
2405
2431
  # @option opts [Boolean] :no_rotate Don't use orientation tags to rotate image upright
2406
2432
  # @option opts [Vips::Interesting] :crop Reduce to fill target rectangle, then crop
2407
2433
  # @option opts [Boolean] :linear Reduce in linear light
2408
- # @option opts [String] :import_profile Fallback import profile
2409
- # @option opts [String] :export_profile Fallback export profile
2434
+ # @option opts [String] :input_profile Fallback input profile
2435
+ # @option opts [String] :output_profile Fallback output profile
2410
2436
  # @option opts [Vips::Intent] :intent Rendering intent
2411
2437
  # @option opts [Vips::FailOn] :fail_on Error level to fail on
2412
2438
  # @return [Vips::Image] Output image
@@ -2420,8 +2446,8 @@ module Vips
2420
2446
  # @option opts [Boolean] :no_rotate Don't use orientation tags to rotate image upright
2421
2447
  # @option opts [Vips::Interesting] :crop Reduce to fill target rectangle, then crop
2422
2448
  # @option opts [Boolean] :linear Reduce in linear light
2423
- # @option opts [String] :import_profile Fallback import profile
2424
- # @option opts [String] :export_profile Fallback export profile
2449
+ # @option opts [String] :input_profile Fallback input profile
2450
+ # @option opts [String] :output_profile Fallback output profile
2425
2451
  # @option opts [Vips::Intent] :intent Rendering intent
2426
2452
  # @option opts [Vips::FailOn] :fail_on Error level to fail on
2427
2453
  # @return [Vips::Image] Output image
@@ -2437,8 +2463,8 @@ module Vips
2437
2463
  # @option opts [Boolean] :no_rotate Don't use orientation tags to rotate image upright
2438
2464
  # @option opts [Vips::Interesting] :crop Reduce to fill target rectangle, then crop
2439
2465
  # @option opts [Boolean] :linear Reduce in linear light
2440
- # @option opts [String] :import_profile Fallback import profile
2441
- # @option opts [String] :export_profile Fallback export profile
2466
+ # @option opts [String] :input_profile Fallback input profile
2467
+ # @option opts [String] :output_profile Fallback output profile
2442
2468
  # @option opts [Vips::Intent] :intent Rendering intent
2443
2469
  # @option opts [Vips::FailOn] :fail_on Error level to fail on
2444
2470
  # @return [Vips::Image] Output image
@@ -2605,6 +2631,16 @@ module Vips
2605
2631
  # @param opts [Hash] Set of options
2606
2632
  # @return [Vips::Image] Output image
2607
2633
 
2634
+ # @!method scRGB2XYZ(**opts)
2635
+ # Transform scrgb to xyz.
2636
+ # @param opts [Hash] Set of options
2637
+ # @return [Vips::Image] Output image
2638
+
2639
+ # @!method XYZ2scRGB(**opts)
2640
+ # Transform xyz to scrgb.
2641
+ # @param opts [Hash] Set of options
2642
+ # @return [Vips::Image] Output image
2643
+
2608
2644
  # @!method LabQ2Lab(**opts)
2609
2645
  # Unpack a labq image to float lab.
2610
2646
  # @param opts [Hash] Set of options
@@ -2650,6 +2686,17 @@ module Vips
2650
2686
  # @param opts [Hash] Set of options
2651
2687
  # @return [Vips::Image] Output image
2652
2688
 
2689
+ # @!method sRGB2scRGB(**opts)
2690
+ # Convert an srgb image to scrgb.
2691
+ # @param opts [Hash] Set of options
2692
+ # @return [Vips::Image] Output image
2693
+
2694
+ # @!method scRGB2BW(**opts)
2695
+ # Convert scrgb to bw.
2696
+ # @param opts [Hash] Set of options
2697
+ # @option opts [Integer] :depth Output device space depth in bits
2698
+ # @return [Vips::Image] Output image
2699
+
2653
2700
  # @!method sRGB2HSV(**opts)
2654
2701
  # Transform srgb to hsv.
2655
2702
  # @param opts [Hash] Set of options
@@ -2660,6 +2707,12 @@ module Vips
2660
2707
  # @param opts [Hash] Set of options
2661
2708
  # @return [Vips::Image] Output image
2662
2709
 
2710
+ # @!method scRGB2sRGB(**opts)
2711
+ # Convert scrgb to srgb.
2712
+ # @param opts [Hash] Set of options
2713
+ # @option opts [Integer] :depth Output device space depth in bits
2714
+ # @return [Vips::Image] Output image
2715
+
2663
2716
  # @!method icc_import(**opts)
2664
2717
  # Import from device with icc profile.
2665
2718
  # @param opts [Hash] Set of options
@@ -2710,33 +2763,6 @@ module Vips
2710
2763
  # @param opts [Hash] Set of options
2711
2764
  # @return [Vips::Image] Output image
2712
2765
 
2713
- # @!method sRGB2scRGB(**opts)
2714
- # Convert an srgb image to scrgb.
2715
- # @param opts [Hash] Set of options
2716
- # @return [Vips::Image] Output image
2717
-
2718
- # @!method scRGB2XYZ(**opts)
2719
- # Transform scrgb to xyz.
2720
- # @param opts [Hash] Set of options
2721
- # @return [Vips::Image] Output image
2722
-
2723
- # @!method scRGB2BW(**opts)
2724
- # Convert scrgb to bw.
2725
- # @param opts [Hash] Set of options
2726
- # @option opts [Integer] :depth Output device space depth in bits
2727
- # @return [Vips::Image] Output image
2728
-
2729
- # @!method XYZ2scRGB(**opts)
2730
- # Transform xyz to scrgb.
2731
- # @param opts [Hash] Set of options
2732
- # @return [Vips::Image] Output image
2733
-
2734
- # @!method scRGB2sRGB(**opts)
2735
- # Convert an scrgb image to srgb.
2736
- # @param opts [Hash] Set of options
2737
- # @option opts [Integer] :depth Output device space depth in bits
2738
- # @return [Vips::Image] Output image
2739
-
2740
2766
  # @!method CMYK2XYZ(**opts)
2741
2767
  # Transform cmyk to xyz.
2742
2768
  # @param opts [Hash] Set of options
@@ -3123,7 +3149,13 @@ module Vips
3123
3149
  # @return [Vips::Image] Output image
3124
3150
 
3125
3151
  # @!method matrixinvert(**opts)
3126
- # Invert an matrix.
3152
+ # Invert a matrix.
3153
+ # @param opts [Hash] Set of options
3154
+ # @return [Vips::Image] Output matrix
3155
+
3156
+ # @!method matrixmultiply(right, **opts)
3157
+ # Multiply two matrices.
3158
+ # @param right [Vips::Image] Second matrix to multiply
3127
3159
  # @param opts [Hash] Set of options
3128
3160
  # @return [Vips::Image] Output matrix
3129
3161
 
@@ -3150,6 +3182,13 @@ module Vips
3150
3182
  # @param opts [Hash] Set of options
3151
3183
  # @option opts [Float] :gamma Image gamma
3152
3184
  # @option opts [Boolean] :int_output Integer output
3185
+ # @return [Vips::Image] Output image
3186
+
3187
+ # @!method remosaic(old_str, new_str, **opts)
3188
+ # Rebuild an mosaiced image.
3189
+ # @param old_str [String] Search for this string
3190
+ # @param new_str [String] And swap for this string
3191
+ # @param opts [Hash] Set of options
3153
3192
  # @return [Vips::Image] Output image
3154
3193
 
3155
3194
  end
data/lib/vips/object.rb CHANGED
@@ -125,6 +125,7 @@ module Vips
125
125
 
126
126
  attach_function :vips_enum_from_nick, [:string, :GType, :string], :int
127
127
  attach_function :vips_enum_nick, [:GType, :int], :string
128
+ attach_function :vips_flags_from_nick, [:string, :GType, :string], :int
128
129
 
129
130
  attach_function :vips_value_set_ref_string,
130
131
  [GObject::GValue.ptr, :string], :void
@@ -0,0 +1,9 @@
1
+ module Vips
2
+ # Pick a morphological operator.
3
+ #
4
+ # * `:erode` true if all set
5
+ # * `:dilate` true if any set
6
+
7
+ class OperationMorphology < Symbol
8
+ end
9
+ end
data/lib/vips/pcs.rb ADDED
@@ -0,0 +1,10 @@
1
+ module Vips
2
+ # Pick a Profile Connection Space for {Image#icc_import} and
3
+ # {Image#icc_export}`.
4
+ #
5
+ # * `:lab` use CIELAB D65 as the Profile Connection Space
6
+ # * `:xyz` use XYZ as the Profile Connection Space
7
+
8
+ class PCS < Symbol
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ module Vips
2
+ # How accurate an operation should be.
3
+ #
4
+ # * `:integer` int everywhere
5
+ # * `:float` float everywhere
6
+ # * `:approximate` approximate integer output
7
+
8
+ class Precision < Symbol
9
+ end
10
+ end
@@ -0,0 +1,13 @@
1
+ module Vips
2
+ # ow to calculate the output pixels when shrinking a 2x2 region.
3
+ #
4
+ # * `:mean` use the average
5
+ # * `:median` use the median
6
+ # * `:mode` use the mode
7
+ # * `:max` use the maximum
8
+ # * `:min` use the minimum
9
+ # * `:nearest` use the top-left pixel
10
+
11
+ class RegionShrink < Symbol
12
+ end
13
+ end
@@ -0,0 +1,11 @@
1
+ module Vips
2
+ # The SDF to generate, see {Image.sdf}.
3
+ #
4
+ # * `:circle` a circle at @a, radius @r
5
+ # * `:box` a box from @a to @b
6
+ # * `:rounded_box` a box with rounded @corners from @a to @b
7
+ # * `:line` a line from @a to @b
8
+
9
+ class SdfShape < Symbol
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ module Vips
2
+ # Sets the word wrapping style for {Image#text} when used with a
3
+ # maximum width.
4
+ #
5
+ # * `:char` wrap at character boundaries
6
+ # * `:word_char` wrap at word boundaries, but fall back to character boundaries if there is not enough space for a full word
7
+ # * `:none` no wrapping
8
+
9
+ class TextWrap < Symbol
10
+ end
11
+ end
data/lib/vips/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Vips
2
- VERSION = "2.2.3"
2
+ VERSION = "2.2.5"
3
3
  end
data/lib/vips.rb CHANGED
@@ -443,7 +443,7 @@ require "vips/gvalue"
443
443
  # It examines libvips and writes a summary of each operation and the arguments
444
444
  # and options that that operation expects.
445
445
  #
446
- # Use the [C API # docs](https://libvips.github.io/libvips/API/current)
446
+ # Use the [C API docs](https://www.libvips.org/API/current/)
447
447
  # for more detail.
448
448
  #
449
449
  # # Enums
@@ -452,6 +452,19 @@ require "vips/gvalue"
452
452
  # like `:uchar`. They are documented as a set of classes for convenience, see
453
453
  # {Vips::BandFormat}, for example.
454
454
  #
455
+ # # Flags
456
+ #
457
+ # Some operations take a set of flags as an argument, for example
458
+ # {Image#pngsave} can be given a set of filters to use. These are documented
459
+ # as a set of classes, see {Vips::ForeignPngFilter}, for
460
+ # example.
461
+ #
462
+ # You can set flag arguments with an array of symbols, perhaps:
463
+ #
464
+ # ```ruby
465
+ # image.pngsave "x.png", filter: [:sub, :up]
466
+ # ```
467
+ #
455
468
  # # Draw operations
456
469
  #
457
470
  # There are two ways of calling the libvips draw operations, like
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-vips
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.3
4
+ version: 2.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Cupitt
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2025-02-06 00:00:00.000000000 Z
10
+ date: 2025-08-20 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: ffi
@@ -164,13 +163,29 @@ files:
164
163
  - lib/vips/bandformat.rb
165
164
  - lib/vips/blend_mode.rb
166
165
  - lib/vips/coding.rb
166
+ - lib/vips/combine.rb
167
167
  - lib/vips/compass_direction.rb
168
168
  - lib/vips/connection.rb
169
169
  - lib/vips/direction.rb
170
170
  - lib/vips/extend.rb
171
+ - lib/vips/fail_on.rb
172
+ - lib/vips/foreign_dz_container.rb
173
+ - lib/vips/foreign_dz_depth.rb
174
+ - lib/vips/foreign_dz_layout.rb
175
+ - lib/vips/foreign_heif_compression.rb
176
+ - lib/vips/foreign_heif_encoder.rb
177
+ - lib/vips/foreign_keep.rb
178
+ - lib/vips/foreign_png_filter.rb
179
+ - lib/vips/foreign_ppm_format.rb
180
+ - lib/vips/foreign_subsample.rb
181
+ - lib/vips/foreign_tiff_compression.rb
182
+ - lib/vips/foreign_tiff_predictor.rb
183
+ - lib/vips/foreign_tiff_resunit.rb
184
+ - lib/vips/foreign_webp_preset.rb
171
185
  - lib/vips/gobject.rb
172
186
  - lib/vips/gvalue.rb
173
187
  - lib/vips/image.rb
188
+ - lib/vips/intent.rb
174
189
  - lib/vips/interesting.rb
175
190
  - lib/vips/interpolate.rb
176
191
  - lib/vips/interpretation.rb
@@ -179,6 +194,7 @@ files:
179
194
  - lib/vips/mutableimage.rb
180
195
  - lib/vips/object.rb
181
196
  - lib/vips/operation.rb
197
+ - lib/vips/operation_morphology.rb
182
198
  - lib/vips/operationboolean.rb
183
199
  - lib/vips/operationcomplex.rb
184
200
  - lib/vips/operationcomplex2.rb
@@ -187,12 +203,17 @@ files:
187
203
  - lib/vips/operationmath2.rb
188
204
  - lib/vips/operationrelational.rb
189
205
  - lib/vips/operationround.rb
206
+ - lib/vips/pcs.rb
207
+ - lib/vips/precision.rb
190
208
  - lib/vips/region.rb
209
+ - lib/vips/region_shrink.rb
210
+ - lib/vips/sdf_shape.rb
191
211
  - lib/vips/size.rb
192
212
  - lib/vips/source.rb
193
213
  - lib/vips/sourcecustom.rb
194
214
  - lib/vips/target.rb
195
215
  - lib/vips/targetcustom.rb
216
+ - lib/vips/text_wrap.rb
196
217
  - lib/vips/version.rb
197
218
  - ruby-vips.gemspec
198
219
  homepage: http://github.com/libvips/ruby-vips
@@ -205,7 +226,6 @@ metadata:
205
226
  homepage_uri: http://github.com/libvips/ruby-vips
206
227
  source_code_uri: https://github.com/libvips/ruby-vips
207
228
  msys2_mingw_dependencies: libvips
208
- post_install_message:
209
229
  rdoc_options: []
210
230
  require_paths:
211
231
  - lib
@@ -220,8 +240,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
220
240
  - !ruby/object:Gem::Version
221
241
  version: '0'
222
242
  requirements: []
223
- rubygems_version: 3.4.20
224
- signing_key:
243
+ rubygems_version: 3.6.3
225
244
  specification_version: 4
226
245
  summary: A fast image processing library with low memory needs
227
246
  test_files: []