ruby-vips 2.2.1 → 2.2.3

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: faf388c9ee4f7b130b34c0a30954da1d9efd08b09799befe88d676bca7c79f64
4
- data.tar.gz: 015463ac062367c72195e8349669c8ed80123c81cb88710951130d030b6a4018
3
+ metadata.gz: 94d18bf3b8d377111af5d5b537deeb0bc391bf92968e5d757607f393d35eff59
4
+ data.tar.gz: c83b03c317e3717aa21fdeecbd940890351c5be5290a6dd4cafbd3efd8ab3da7
5
5
  SHA512:
6
- metadata.gz: e05333180a545ecae8a7aa4da0a0fa1382e2b8e0233338b2e818cfcaa7de6e2a14c9be0d6f11510393ffb4343e5ad84a7100ba665c158546fd8dfcb71e83462e
7
- data.tar.gz: b4edb03ea9b62fd30c41fc51bb9cfb94214b4929e83df24c62742de63f7dbff1d13220e57a234da8592816f33e09f0122a9a60c790c9d459b236e655c7691467
6
+ metadata.gz: d3dfb006f74d11ca1af36bd423185a5336849bf34d63966f02ed6f5d9a14ab5f89ddf8b86d029569b5d609a393dec0dfbe21843fa0514a8d179026bb706cc3de
7
+ data.tar.gz: cdb4469a96a362af3cf1377bb64d50e1327c4711cc0aa2b6222e6d0b08e1f38541bc4fb2e9adc42e3ded39316d6ec87f6a08fa9ff8752a023a1da4c684497213
@@ -1,13 +1,6 @@
1
1
  name: Test
2
2
 
3
- on:
4
- push:
5
- branches:
6
- - master
7
- pull_request:
8
- pull_request_target:
9
- branches:
10
- - master
3
+ on: [push, pull_request]
11
4
 
12
5
  env:
13
6
  NOKOGIRI_USE_SYSTEM_LIBRARIES: true
@@ -36,10 +29,8 @@ jobs:
36
29
 
37
30
  strategy:
38
31
  matrix:
39
- os-version: [ 'ubuntu-20.04' ]
32
+ os-version: [ 'ubuntu-24.04' ]
40
33
  ruby-version:
41
- - '2.1'
42
- - '2.2'
43
34
  - '2.3'
44
35
  - '2.4'
45
36
  - '2.5'
@@ -48,6 +39,7 @@ jobs:
48
39
  - '3.0'
49
40
  - '3.1'
50
41
  - '3.2'
42
+ - '3.3'
51
43
  - jruby
52
44
  fail-fast: true
53
45
 
@@ -63,19 +55,11 @@ jobs:
63
55
  ruby-version: ${{ matrix.ruby-version }}
64
56
  bundler-cache: true
65
57
 
66
- - name: Update apt
67
- env:
68
- DEBIAN_FRONTEND: noninteractive
69
- run:
70
- sudo apt-get update -qq -o Acquire::Retries=3
71
-
72
58
  - name: Install libvips
73
- env:
74
- DEBIAN_FRONTEND: noninteractive
75
- run:
59
+ run: |
60
+ sudo apt-get update
76
61
  # we only need the library
77
- sudo apt-get install --fix-missing -qq -o Acquire::Retries=3
78
- libvips
62
+ sudo apt-get install --no-install-recommends libvips
79
63
 
80
64
  - name: Run Tests
81
65
  run: bundle exec rake spec
data/CHANGELOG.md CHANGED
@@ -2,7 +2,16 @@
2
2
 
3
3
  ## master
4
4
 
5
- ## Version 2.2.1 (2023-02-21)
5
+ ## Version 2.2.3 (2025-02-06)
6
+
7
+ * fix `Image#add_alpha()` with libvips 8.16 [kleisauke]
8
+ * fix FFI function definitions for `gboolean` parameters [kleisauke]
9
+
10
+ ## Version 2.2.2 (2024-07-17)
11
+
12
+ * fix compat with unified (semistatic) libvips binaries [kleisauke]
13
+
14
+ ## Version 2.2.1 (2024-02-21)
6
15
 
7
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)
8
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)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.2.1
1
+ 2.2.3
data/lib/vips/image.rb CHANGED
@@ -14,8 +14,8 @@ module Vips
14
14
 
15
15
  attach_function :vips_image_copy_memory, [:pointer], :pointer
16
16
 
17
- attach_function :vips_image_set_progress, [:pointer, :bool], :void
18
- attach_function :vips_image_set_kill, [:pointer, :bool], :void
17
+ attach_function :vips_image_set_progress, [:pointer, :int], :void
18
+ attach_function :vips_image_set_kill, [:pointer, :int], :void
19
19
 
20
20
  attach_function :vips_filename_get_filename, [:string], :pointer
21
21
  attach_function :vips_filename_get_options, [:string], :pointer
@@ -716,7 +716,7 @@ module Vips
716
716
  # @see Object#signal_connect
717
717
  # @param state [Boolean] progress signalling state
718
718
  def set_progress state
719
- Vips.vips_image_set_progress self, state
719
+ Vips.vips_image_set_progress(self, state ? 1 : 0)
720
720
  end
721
721
 
722
722
  # Kill computation of this time.
@@ -727,7 +727,7 @@ module Vips
727
727
  # @see Object#signal_connect
728
728
  # @param kill [Boolean] stop computation
729
729
  def set_kill kill
730
- Vips.vips_image_set_kill self, kill
730
+ Vips.vips_image_set_kill(self, kill ? 1 : 0)
731
731
  end
732
732
 
733
733
  # Get the `GType` of a metadata field. The result is 0 if no such field
@@ -973,7 +973,7 @@ module Vips
973
973
  # @return [Image] new image
974
974
  def add_alpha
975
975
  ptr = GenericPtr.new
976
- result = Vips.vips_addalpha self, ptr
976
+ result = Vips.vips_addalpha self, ptr, :pointer, nil
977
977
  raise Vips::Error if result != 0
978
978
 
979
979
  Vips::Image.new ptr[:value]
data/lib/vips/methods.rb CHANGED
@@ -18,6 +18,18 @@ module Vips
18
18
  # @param opts [Hash] Set of options
19
19
  # @return [Vips::Image] Output image
20
20
 
21
+ # @!method minpair(right, **opts)
22
+ # Minimum of a pair of images.
23
+ # @param right [Vips::Image] Right-hand image argument
24
+ # @param opts [Hash] Set of options
25
+ # @return [Vips::Image] Output image
26
+
27
+ # @!method maxpair(right, **opts)
28
+ # Maximum of a pair of images.
29
+ # @param right [Vips::Image] Right-hand image argument
30
+ # @param opts [Hash] Set of options
31
+ # @return [Vips::Image] Output image
32
+
21
33
  # @!method subtract(right, **opts)
22
34
  # Subtract two images.
23
35
  # @param right [Vips::Image] Right-hand image argument
@@ -76,10 +88,11 @@ module Vips
76
88
  # @param opts [Hash] Set of options
77
89
  # @return [Vips::Image] Output image
78
90
 
79
- # @!method self.sum(im, **opts)
80
- # Sum an array of images.
81
- # @param im [Array<Image>] Array of input images
91
+ # @!method clamp(**opts)
92
+ # Clamp values of an image.
82
93
  # @param opts [Hash] Set of options
94
+ # @option opts [Float] :min Minimum value
95
+ # @option opts [Float] :max Maximum value
83
96
  # @return [Vips::Image] Output image
84
97
 
85
98
  # @!method invert(**opts)
@@ -156,6 +169,12 @@ module Vips
156
169
  # @param opts [Hash] Set of options
157
170
  # @return [Vips::Image] Output image
158
171
 
172
+ # @!method self.sum(im, **opts)
173
+ # Sum an array of images.
174
+ # @param im [Array<Image>] Array of input images
175
+ # @param opts [Hash] Set of options
176
+ # @return [Vips::Image] Output image
177
+
159
178
  # @!method avg(**opts)
160
179
  # Find image average.
161
180
  # @param opts [Hash] Set of options
@@ -253,6 +272,7 @@ module Vips
253
272
  # @param x [Integer] Point to read
254
273
  # @param y [Integer] Point to read
255
274
  # @param opts [Hash] Set of options
275
+ # @option opts [Boolean] :unpack_complex Complex pixels should be unpacked
256
276
  # @return [Array<Double>] Array of output values
257
277
 
258
278
  # @!method find_trim(**opts)
@@ -304,14 +324,6 @@ module Vips
304
324
  # @option opts [Integer] :tile_height Tile height in pixels
305
325
  # @return [Vips::Image] Output image
306
326
 
307
- # @!method cache(**opts)
308
- # Cache an image.
309
- # @param opts [Hash] Set of options
310
- # @option opts [Integer] :max_tiles Maximum number of tiles to cache
311
- # @option opts [Integer] :tile_height Tile height in pixels
312
- # @option opts [Integer] :tile_width Tile width in pixels
313
- # @return [Vips::Image] Output image
314
-
315
327
  # @!method embed(x, y, width, height, **opts)
316
328
  # Embed an image in a larger image.
317
329
  # @param x [Integer] Left edge of input in output
@@ -573,6 +585,11 @@ module Vips
573
585
  # @option opts [Boolean] :premultiplied Images have premultiplied alpha
574
586
  # @return [Vips::Image] Output image
575
587
 
588
+ # @!method addalpha(**opts)
589
+ # Append an alpha channel.
590
+ # @param opts [Hash] Set of options
591
+ # @return [Vips::Image] Output image
592
+
576
593
  # @!method self.black(width, height, **opts)
577
594
  # Make a black image.
578
595
  # @param width [Integer] Image width in pixels
@@ -636,6 +653,18 @@ module Vips
636
653
  # @option opts [Integer] :autofit_dpi Output DPI selected by autofit
637
654
  # @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
638
655
 
656
+ # @!method self.sdf(width, height, shape, **opts)
657
+ # Create an sdf image.
658
+ # @param width [Integer] Image width in pixels
659
+ # @param height [Integer] Image height in pixels
660
+ # @param shape [Vips::SdfShape] SDF shape to create
661
+ # @param opts [Hash] Set of options
662
+ # @option opts [Float] :r Radius
663
+ # @option opts [Array<Double>] :a Point a
664
+ # @option opts [Array<Double>] :b Point b
665
+ # @option opts [Array<Double>] :corners Corner radii
666
+ # @return [Vips::Image] Output image
667
+
639
668
  # @!method self.eye(width, height, **opts)
640
669
  # Make an image showing the eye's spatial response.
641
670
  # @param width [Integer] Image width in pixels
@@ -1462,6 +1491,8 @@ module Vips
1462
1491
  # Load jpeg-xl image.
1463
1492
  # @param filename [String] Filename to load from
1464
1493
  # @param opts [Hash] Set of options
1494
+ # @option opts [Integer] :page First page to load
1495
+ # @option opts [Integer] :n Number of pages to load, -1 for all
1465
1496
  # @option opts [Boolean] :memory Force open via memory
1466
1497
  # @option opts [Vips::Access] :access Required access pattern for this file
1467
1498
  # @option opts [Vips::FailOn] :fail_on Error level to fail on
@@ -1473,6 +1504,8 @@ module Vips
1473
1504
  # Load jpeg-xl image.
1474
1505
  # @param buffer [VipsBlob] Buffer to load from
1475
1506
  # @param opts [Hash] Set of options
1507
+ # @option opts [Integer] :page First page to load
1508
+ # @option opts [Integer] :n Number of pages to load, -1 for all
1476
1509
  # @option opts [Boolean] :memory Force open via memory
1477
1510
  # @option opts [Vips::Access] :access Required access pattern for this file
1478
1511
  # @option opts [Vips::FailOn] :fail_on Error level to fail on
@@ -1484,6 +1517,8 @@ module Vips
1484
1517
  # Load jpeg-xl image.
1485
1518
  # @param source [Vips::Source] Source to load from
1486
1519
  # @param opts [Hash] Set of options
1520
+ # @option opts [Integer] :page First page to load
1521
+ # @option opts [Integer] :n Number of pages to load, -1 for all
1487
1522
  # @option opts [Boolean] :memory Force open via memory
1488
1523
  # @option opts [Vips::Access] :access Required access pattern for this file
1489
1524
  # @option opts [Vips::FailOn] :fail_on Error level to fail on
@@ -1574,91 +1609,100 @@ module Vips
1574
1609
  # Save image to csv.
1575
1610
  # @param filename [String] Filename to save to
1576
1611
  # @param opts [Hash] Set of options
1577
- # @option opts [String] :profile Filename of ICC profile to embed
1578
1612
  # @option opts [String] :separator Separator characters
1579
1613
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
1580
1614
  # @option opts [Array<Double>] :background Background value
1581
1615
  # @option opts [Integer] :page_height Set page height for multipage save
1616
+ # @option opts [String] :profile Filename of ICC profile to embed
1582
1617
  # @return [nil]
1583
1618
 
1584
1619
  # @!method csvsave_target(target, **opts)
1585
1620
  # Save image to csv.
1586
1621
  # @param target [Vips::Target] Target to save to
1587
1622
  # @param opts [Hash] Set of options
1588
- # @option opts [String] :profile Filename of ICC profile to embed
1589
1623
  # @option opts [String] :separator Separator characters
1590
1624
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
1591
1625
  # @option opts [Array<Double>] :background Background value
1592
1626
  # @option opts [Integer] :page_height Set page height for multipage save
1627
+ # @option opts [String] :profile Filename of ICC profile to embed
1593
1628
  # @return [nil]
1594
1629
 
1595
1630
  # @!method matrixsave(filename, **opts)
1596
1631
  # Save image to matrix.
1597
1632
  # @param filename [String] Filename to save to
1598
1633
  # @param opts [Hash] Set of options
1599
- # @option opts [String] :profile Filename of ICC profile to embed
1600
1634
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
1601
1635
  # @option opts [Array<Double>] :background Background value
1602
1636
  # @option opts [Integer] :page_height Set page height for multipage save
1637
+ # @option opts [String] :profile Filename of ICC profile to embed
1603
1638
  # @return [nil]
1604
1639
 
1605
1640
  # @!method matrixsave_target(target, **opts)
1606
1641
  # Save image to matrix.
1607
1642
  # @param target [Vips::Target] Target to save to
1608
1643
  # @param opts [Hash] Set of options
1609
- # @option opts [String] :profile Filename of ICC profile to embed
1610
1644
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
1611
1645
  # @option opts [Array<Double>] :background Background value
1612
1646
  # @option opts [Integer] :page_height Set page height for multipage save
1647
+ # @option opts [String] :profile Filename of ICC profile to embed
1613
1648
  # @return [nil]
1614
1649
 
1615
1650
  # @!method matrixprint(**opts)
1616
1651
  # Print matrix.
1617
1652
  # @param opts [Hash] Set of options
1618
- # @option opts [String] :profile Filename of ICC profile to embed
1619
1653
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
1620
1654
  # @option opts [Array<Double>] :background Background value
1621
1655
  # @option opts [Integer] :page_height Set page height for multipage save
1656
+ # @option opts [String] :profile Filename of ICC profile to embed
1622
1657
  # @return [nil]
1623
1658
 
1624
1659
  # @!method rawsave(filename, **opts)
1625
1660
  # Save image to raw file.
1626
1661
  # @param filename [String] Filename to save to
1627
1662
  # @param opts [Hash] Set of options
1628
- # @option opts [String] :profile Filename of ICC profile to embed
1629
1663
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
1630
1664
  # @option opts [Array<Double>] :background Background value
1631
1665
  # @option opts [Integer] :page_height Set page height for multipage save
1666
+ # @option opts [String] :profile Filename of ICC profile to embed
1632
1667
  # @return [nil]
1633
1668
 
1634
- # @!method rawsave_fd(fd, **opts)
1635
- # Write raw image to file descriptor.
1636
- # @param fd [Integer] File descriptor to write to
1669
+ # @!method rawsave_buffer(**opts)
1670
+ # Write raw image to buffer.
1637
1671
  # @param opts [Hash] Set of options
1672
+ # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
1673
+ # @option opts [Array<Double>] :background Background value
1674
+ # @option opts [Integer] :page_height Set page height for multipage save
1638
1675
  # @option opts [String] :profile Filename of ICC profile to embed
1676
+ # @return [VipsBlob] Buffer to save to
1677
+
1678
+ # @!method rawsave_target(target, **opts)
1679
+ # Write raw image to target.
1680
+ # @param target [Vips::Target] Target to save to
1681
+ # @param opts [Hash] Set of options
1639
1682
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
1640
1683
  # @option opts [Array<Double>] :background Background value
1641
1684
  # @option opts [Integer] :page_height Set page height for multipage save
1685
+ # @option opts [String] :profile Filename of ICC profile to embed
1642
1686
  # @return [nil]
1643
1687
 
1644
1688
  # @!method vipssave(filename, **opts)
1645
1689
  # Save image to file in vips format.
1646
1690
  # @param filename [String] Filename to save to
1647
1691
  # @param opts [Hash] Set of options
1648
- # @option opts [String] :profile Filename of ICC profile to embed
1649
1692
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
1650
1693
  # @option opts [Array<Double>] :background Background value
1651
1694
  # @option opts [Integer] :page_height Set page height for multipage save
1695
+ # @option opts [String] :profile Filename of ICC profile to embed
1652
1696
  # @return [nil]
1653
1697
 
1654
1698
  # @!method vipssave_target(target, **opts)
1655
1699
  # Save image to target in vips format.
1656
1700
  # @param target [Vips::Target] Target to save to
1657
1701
  # @param opts [Hash] Set of options
1658
- # @option opts [String] :profile Filename of ICC profile to embed
1659
1702
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
1660
1703
  # @option opts [Array<Double>] :background Background value
1661
1704
  # @option opts [Integer] :page_height Set page height for multipage save
1705
+ # @option opts [String] :profile Filename of ICC profile to embed
1662
1706
  # @return [nil]
1663
1707
 
1664
1708
  # @!method ppmsave(filename, **opts)
@@ -1667,11 +1711,11 @@ module Vips
1667
1711
  # @param opts [Hash] Set of options
1668
1712
  # @option opts [Vips::ForeignPpmFormat] :format Format to save in
1669
1713
  # @option opts [Boolean] :ascii Save as ascii
1670
- # @option opts [String] :profile Filename of ICC profile to embed
1671
1714
  # @option opts [Integer] :bitdepth Set to 1 to write as a 1 bit image
1672
1715
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
1673
1716
  # @option opts [Array<Double>] :background Background value
1674
1717
  # @option opts [Integer] :page_height Set page height for multipage save
1718
+ # @option opts [String] :profile Filename of ICC profile to embed
1675
1719
  # @return [nil]
1676
1720
 
1677
1721
  # @!method ppmsave_target(target, **opts)
@@ -1680,48 +1724,47 @@ module Vips
1680
1724
  # @param opts [Hash] Set of options
1681
1725
  # @option opts [Vips::ForeignPpmFormat] :format Format to save in
1682
1726
  # @option opts [Boolean] :ascii Save as ascii
1683
- # @option opts [String] :profile Filename of ICC profile to embed
1684
1727
  # @option opts [Integer] :bitdepth Set to 1 to write as a 1 bit image
1685
1728
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
1686
1729
  # @option opts [Array<Double>] :background Background value
1687
1730
  # @option opts [Integer] :page_height Set page height for multipage save
1731
+ # @option opts [String] :profile Filename of ICC profile to embed
1688
1732
  # @return [nil]
1689
1733
 
1690
1734
  # @!method radsave(filename, **opts)
1691
1735
  # Save image to radiance file.
1692
1736
  # @param filename [String] Filename to save to
1693
1737
  # @param opts [Hash] Set of options
1694
- # @option opts [String] :profile Filename of ICC profile to embed
1695
1738
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
1696
1739
  # @option opts [Array<Double>] :background Background value
1697
1740
  # @option opts [Integer] :page_height Set page height for multipage save
1741
+ # @option opts [String] :profile Filename of ICC profile to embed
1698
1742
  # @return [nil]
1699
1743
 
1700
1744
  # @!method radsave_buffer(**opts)
1701
1745
  # Save image to radiance buffer.
1702
1746
  # @param opts [Hash] Set of options
1703
- # @option opts [String] :profile Filename of ICC profile to embed
1704
1747
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
1705
1748
  # @option opts [Array<Double>] :background Background value
1706
1749
  # @option opts [Integer] :page_height Set page height for multipage save
1750
+ # @option opts [String] :profile Filename of ICC profile to embed
1707
1751
  # @return [VipsBlob] Buffer to save to
1708
1752
 
1709
1753
  # @!method radsave_target(target, **opts)
1710
1754
  # Save image to radiance target.
1711
1755
  # @param target [Vips::Target] Target to save to
1712
1756
  # @param opts [Hash] Set of options
1713
- # @option opts [String] :profile Filename of ICC profile to embed
1714
1757
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
1715
1758
  # @option opts [Array<Double>] :background Background value
1716
1759
  # @option opts [Integer] :page_height Set page height for multipage save
1760
+ # @option opts [String] :profile Filename of ICC profile to embed
1717
1761
  # @return [nil]
1718
1762
 
1719
1763
  # @!method jp2ksave(filename, **opts)
1720
1764
  # Save image in jpeg2000 format.
1721
- # @param filename [String] Filename to load from
1765
+ # @param filename [String] Filename to save to
1722
1766
  # @param opts [Hash] Set of options
1723
1767
  # @option opts [Integer] :tile_width Tile width in pixels
1724
- # @option opts [String] :profile Filename of ICC profile to embed
1725
1768
  # @option opts [Integer] :tile_height Tile height in pixels
1726
1769
  # @option opts [Boolean] :lossless Enable lossless compression
1727
1770
  # @option opts [Integer] :Q Q factor
@@ -1729,13 +1772,13 @@ module Vips
1729
1772
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
1730
1773
  # @option opts [Array<Double>] :background Background value
1731
1774
  # @option opts [Integer] :page_height Set page height for multipage save
1775
+ # @option opts [String] :profile Filename of ICC profile to embed
1732
1776
  # @return [nil]
1733
1777
 
1734
1778
  # @!method jp2ksave_buffer(**opts)
1735
1779
  # Save image in jpeg2000 format.
1736
1780
  # @param opts [Hash] Set of options
1737
1781
  # @option opts [Integer] :tile_width Tile width in pixels
1738
- # @option opts [String] :profile Filename of ICC profile to embed
1739
1782
  # @option opts [Integer] :tile_height Tile height in pixels
1740
1783
  # @option opts [Boolean] :lossless Enable lossless compression
1741
1784
  # @option opts [Integer] :Q Q factor
@@ -1743,6 +1786,7 @@ module Vips
1743
1786
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
1744
1787
  # @option opts [Array<Double>] :background Background value
1745
1788
  # @option opts [Integer] :page_height Set page height for multipage save
1789
+ # @option opts [String] :profile Filename of ICC profile to embed
1746
1790
  # @return [VipsBlob] Buffer to save to
1747
1791
 
1748
1792
  # @!method jp2ksave_target(target, **opts)
@@ -1750,7 +1794,6 @@ module Vips
1750
1794
  # @param target [Vips::Target] Target to save to
1751
1795
  # @param opts [Hash] Set of options
1752
1796
  # @option opts [Integer] :tile_width Tile width in pixels
1753
- # @option opts [String] :profile Filename of ICC profile to embed
1754
1797
  # @option opts [Integer] :tile_height Tile height in pixels
1755
1798
  # @option opts [Boolean] :lossless Enable lossless compression
1756
1799
  # @option opts [Integer] :Q Q factor
@@ -1758,6 +1801,7 @@ module Vips
1758
1801
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
1759
1802
  # @option opts [Array<Double>] :background Background value
1760
1803
  # @option opts [Integer] :page_height Set page height for multipage save
1804
+ # @option opts [String] :profile Filename of ICC profile to embed
1761
1805
  # @return [nil]
1762
1806
 
1763
1807
  # @!method gifsave(filename, **opts)
@@ -1766,7 +1810,6 @@ module Vips
1766
1810
  # @param opts [Hash] Set of options
1767
1811
  # @option opts [Float] :dither Amount of dithering
1768
1812
  # @option opts [Integer] :effort Quantisation effort
1769
- # @option opts [String] :profile Filename of ICC profile to embed
1770
1813
  # @option opts [Integer] :bitdepth Number of bits per pixel
1771
1814
  # @option opts [Float] :interframe_maxerror Maximum inter-frame error for transparency
1772
1815
  # @option opts [Boolean] :reuse Reuse palette from input
@@ -1775,6 +1818,7 @@ module Vips
1775
1818
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
1776
1819
  # @option opts [Array<Double>] :background Background value
1777
1820
  # @option opts [Integer] :page_height Set page height for multipage save
1821
+ # @option opts [String] :profile Filename of ICC profile to embed
1778
1822
  # @return [nil]
1779
1823
 
1780
1824
  # @!method gifsave_buffer(**opts)
@@ -1782,7 +1826,6 @@ module Vips
1782
1826
  # @param opts [Hash] Set of options
1783
1827
  # @option opts [Float] :dither Amount of dithering
1784
1828
  # @option opts [Integer] :effort Quantisation effort
1785
- # @option opts [String] :profile Filename of ICC profile to embed
1786
1829
  # @option opts [Integer] :bitdepth Number of bits per pixel
1787
1830
  # @option opts [Float] :interframe_maxerror Maximum inter-frame error for transparency
1788
1831
  # @option opts [Boolean] :reuse Reuse palette from input
@@ -1791,6 +1834,7 @@ module Vips
1791
1834
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
1792
1835
  # @option opts [Array<Double>] :background Background value
1793
1836
  # @option opts [Integer] :page_height Set page height for multipage save
1837
+ # @option opts [String] :profile Filename of ICC profile to embed
1794
1838
  # @return [VipsBlob] Buffer to save to
1795
1839
 
1796
1840
  # @!method gifsave_target(target, **opts)
@@ -1799,7 +1843,6 @@ module Vips
1799
1843
  # @param opts [Hash] Set of options
1800
1844
  # @option opts [Float] :dither Amount of dithering
1801
1845
  # @option opts [Integer] :effort Quantisation effort
1802
- # @option opts [String] :profile Filename of ICC profile to embed
1803
1846
  # @option opts [Integer] :bitdepth Number of bits per pixel
1804
1847
  # @option opts [Float] :interframe_maxerror Maximum inter-frame error for transparency
1805
1848
  # @option opts [Boolean] :reuse Reuse palette from input
@@ -1808,6 +1851,7 @@ module Vips
1808
1851
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
1809
1852
  # @option opts [Array<Double>] :background Background value
1810
1853
  # @option opts [Integer] :page_height Set page height for multipage save
1854
+ # @option opts [String] :profile Filename of ICC profile to embed
1811
1855
  # @return [nil]
1812
1856
 
1813
1857
  # @!method dzsave(filename, **opts)
@@ -1819,7 +1863,6 @@ module Vips
1819
1863
  # @option opts [String] :suffix Filename suffix for tiles
1820
1864
  # @option opts [Integer] :overlap Tile overlap in pixels
1821
1865
  # @option opts [Integer] :tile_size Tile size in pixels
1822
- # @option opts [String] :profile Filename of ICC profile to embed
1823
1866
  # @option opts [Boolean] :centre Center image in tile
1824
1867
  # @option opts [Vips::ForeignDzDepth] :depth Pyramid depth
1825
1868
  # @option opts [Vips::Angle] :angle Rotate image during save
@@ -1832,6 +1875,7 @@ module Vips
1832
1875
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
1833
1876
  # @option opts [Array<Double>] :background Background value
1834
1877
  # @option opts [Integer] :page_height Set page height for multipage save
1878
+ # @option opts [String] :profile Filename of ICC profile to embed
1835
1879
  # @return [nil]
1836
1880
 
1837
1881
  # @!method dzsave_buffer(**opts)
@@ -1842,7 +1886,6 @@ module Vips
1842
1886
  # @option opts [String] :suffix Filename suffix for tiles
1843
1887
  # @option opts [Integer] :overlap Tile overlap in pixels
1844
1888
  # @option opts [Integer] :tile_size Tile size in pixels
1845
- # @option opts [String] :profile Filename of ICC profile to embed
1846
1889
  # @option opts [Boolean] :centre Center image in tile
1847
1890
  # @option opts [Vips::ForeignDzDepth] :depth Pyramid depth
1848
1891
  # @option opts [Vips::Angle] :angle Rotate image during save
@@ -1855,6 +1898,7 @@ module Vips
1855
1898
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
1856
1899
  # @option opts [Array<Double>] :background Background value
1857
1900
  # @option opts [Integer] :page_height Set page height for multipage save
1901
+ # @option opts [String] :profile Filename of ICC profile to embed
1858
1902
  # @return [VipsBlob] Buffer to save to
1859
1903
 
1860
1904
  # @!method dzsave_target(target, **opts)
@@ -1866,7 +1910,6 @@ module Vips
1866
1910
  # @option opts [String] :suffix Filename suffix for tiles
1867
1911
  # @option opts [Integer] :overlap Tile overlap in pixels
1868
1912
  # @option opts [Integer] :tile_size Tile size in pixels
1869
- # @option opts [String] :profile Filename of ICC profile to embed
1870
1913
  # @option opts [Boolean] :centre Center image in tile
1871
1914
  # @option opts [Vips::ForeignDzDepth] :depth Pyramid depth
1872
1915
  # @option opts [Vips::Angle] :angle Rotate image during save
@@ -1879,16 +1922,16 @@ module Vips
1879
1922
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
1880
1923
  # @option opts [Array<Double>] :background Background value
1881
1924
  # @option opts [Integer] :page_height Set page height for multipage save
1925
+ # @option opts [String] :profile Filename of ICC profile to embed
1882
1926
  # @return [nil]
1883
1927
 
1884
1928
  # @!method pngsave(filename, **opts)
1885
- # Save image to png file.
1929
+ # Save image to file as png.
1886
1930
  # @param filename [String] Filename to save to
1887
1931
  # @param opts [Hash] Set of options
1888
1932
  # @option opts [Integer] :compression Compression factor
1889
1933
  # @option opts [Boolean] :interlace Interlace image
1890
- # @option opts [String] :profile Filename of ICC profile to embed
1891
- # @option opts [Vips::ForeignPngFilter] :filter libpng row filter flag(s)
1934
+ # @option opts [Vips::ForeignPngFilter] :filter libspng row filter flag(s)
1892
1935
  # @option opts [Boolean] :palette Quantise to 8bpp palette
1893
1936
  # @option opts [Integer] :Q Quantisation quality
1894
1937
  # @option opts [Float] :dither Amount of dithering
@@ -1897,15 +1940,15 @@ module Vips
1897
1940
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
1898
1941
  # @option opts [Array<Double>] :background Background value
1899
1942
  # @option opts [Integer] :page_height Set page height for multipage save
1943
+ # @option opts [String] :profile Filename of ICC profile to embed
1900
1944
  # @return [nil]
1901
1945
 
1902
1946
  # @!method pngsave_buffer(**opts)
1903
- # Save image to png buffer.
1947
+ # Save image to buffer as png.
1904
1948
  # @param opts [Hash] Set of options
1905
1949
  # @option opts [Integer] :compression Compression factor
1906
1950
  # @option opts [Boolean] :interlace Interlace image
1907
- # @option opts [String] :profile Filename of ICC profile to embed
1908
- # @option opts [Vips::ForeignPngFilter] :filter libpng row filter flag(s)
1951
+ # @option opts [Vips::ForeignPngFilter] :filter libspng row filter flag(s)
1909
1952
  # @option opts [Boolean] :palette Quantise to 8bpp palette
1910
1953
  # @option opts [Integer] :Q Quantisation quality
1911
1954
  # @option opts [Float] :dither Amount of dithering
@@ -1914,6 +1957,7 @@ module Vips
1914
1957
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
1915
1958
  # @option opts [Array<Double>] :background Background value
1916
1959
  # @option opts [Integer] :page_height Set page height for multipage save
1960
+ # @option opts [String] :profile Filename of ICC profile to embed
1917
1961
  # @return [VipsBlob] Buffer to save to
1918
1962
 
1919
1963
  # @!method pngsave_target(target, **opts)
@@ -1922,8 +1966,7 @@ module Vips
1922
1966
  # @param opts [Hash] Set of options
1923
1967
  # @option opts [Integer] :compression Compression factor
1924
1968
  # @option opts [Boolean] :interlace Interlace image
1925
- # @option opts [String] :profile Filename of ICC profile to embed
1926
- # @option opts [Vips::ForeignPngFilter] :filter libpng row filter flag(s)
1969
+ # @option opts [Vips::ForeignPngFilter] :filter libspng row filter flag(s)
1927
1970
  # @option opts [Boolean] :palette Quantise to 8bpp palette
1928
1971
  # @option opts [Integer] :Q Quantisation quality
1929
1972
  # @option opts [Float] :dither Amount of dithering
@@ -1932,6 +1975,7 @@ module Vips
1932
1975
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
1933
1976
  # @option opts [Array<Double>] :background Background value
1934
1977
  # @option opts [Integer] :page_height Set page height for multipage save
1978
+ # @option opts [String] :profile Filename of ICC profile to embed
1935
1979
  # @return [nil]
1936
1980
 
1937
1981
  # @!method jpegsave(filename, **opts)
@@ -1939,7 +1983,6 @@ module Vips
1939
1983
  # @param filename [String] Filename to save to
1940
1984
  # @param opts [Hash] Set of options
1941
1985
  # @option opts [Integer] :Q Q factor
1942
- # @option opts [String] :profile Filename of ICC profile to embed
1943
1986
  # @option opts [Boolean] :optimize_coding Compute optimal Huffman coding tables
1944
1987
  # @option opts [Boolean] :interlace Generate an interlaced (progressive) jpeg
1945
1988
  # @option opts [Boolean] :trellis_quant Apply trellis quantisation to each 8x8 block
@@ -1951,13 +1994,13 @@ module Vips
1951
1994
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
1952
1995
  # @option opts [Array<Double>] :background Background value
1953
1996
  # @option opts [Integer] :page_height Set page height for multipage save
1997
+ # @option opts [String] :profile Filename of ICC profile to embed
1954
1998
  # @return [nil]
1955
1999
 
1956
2000
  # @!method jpegsave_buffer(**opts)
1957
2001
  # Save image to jpeg buffer.
1958
2002
  # @param opts [Hash] Set of options
1959
2003
  # @option opts [Integer] :Q Q factor
1960
- # @option opts [String] :profile Filename of ICC profile to embed
1961
2004
  # @option opts [Boolean] :optimize_coding Compute optimal Huffman coding tables
1962
2005
  # @option opts [Boolean] :interlace Generate an interlaced (progressive) jpeg
1963
2006
  # @option opts [Boolean] :trellis_quant Apply trellis quantisation to each 8x8 block
@@ -1969,6 +2012,7 @@ module Vips
1969
2012
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
1970
2013
  # @option opts [Array<Double>] :background Background value
1971
2014
  # @option opts [Integer] :page_height Set page height for multipage save
2015
+ # @option opts [String] :profile Filename of ICC profile to embed
1972
2016
  # @return [VipsBlob] Buffer to save to
1973
2017
 
1974
2018
  # @!method jpegsave_target(target, **opts)
@@ -1976,7 +2020,6 @@ module Vips
1976
2020
  # @param target [Vips::Target] Target to save to
1977
2021
  # @param opts [Hash] Set of options
1978
2022
  # @option opts [Integer] :Q Q factor
1979
- # @option opts [String] :profile Filename of ICC profile to embed
1980
2023
  # @option opts [Boolean] :optimize_coding Compute optimal Huffman coding tables
1981
2024
  # @option opts [Boolean] :interlace Generate an interlaced (progressive) jpeg
1982
2025
  # @option opts [Boolean] :trellis_quant Apply trellis quantisation to each 8x8 block
@@ -1988,13 +2031,13 @@ module Vips
1988
2031
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
1989
2032
  # @option opts [Array<Double>] :background Background value
1990
2033
  # @option opts [Integer] :page_height Set page height for multipage save
2034
+ # @option opts [String] :profile Filename of ICC profile to embed
1991
2035
  # @return [nil]
1992
2036
 
1993
2037
  # @!method jpegsave_mime(**opts)
1994
2038
  # Save image to jpeg mime.
1995
2039
  # @param opts [Hash] Set of options
1996
2040
  # @option opts [Integer] :Q Q factor
1997
- # @option opts [String] :profile Filename of ICC profile to embed
1998
2041
  # @option opts [Boolean] :optimize_coding Compute optimal Huffman coding tables
1999
2042
  # @option opts [Boolean] :interlace Generate an interlaced (progressive) jpeg
2000
2043
  # @option opts [Boolean] :trellis_quant Apply trellis quantisation to each 8x8 block
@@ -2006,6 +2049,7 @@ module Vips
2006
2049
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
2007
2050
  # @option opts [Array<Double>] :background Background value
2008
2051
  # @option opts [Integer] :page_height Set page height for multipage save
2052
+ # @option opts [String] :profile Filename of ICC profile to embed
2009
2053
  # @return [nil]
2010
2054
 
2011
2055
  # @!method webpsave(filename, **opts)
@@ -2014,7 +2058,6 @@ module Vips
2014
2058
  # @param opts [Hash] Set of options
2015
2059
  # @option opts [Integer] :Q Q factor
2016
2060
  # @option opts [Boolean] :lossless Enable lossless compression
2017
- # @option opts [String] :profile Filename of ICC profile to embed
2018
2061
  # @option opts [Vips::ForeignWebpPreset] :preset Preset for lossy compression
2019
2062
  # @option opts [Boolean] :smart_subsample Enable high quality chroma subsampling
2020
2063
  # @option opts [Boolean] :near_lossless Enable preprocessing in lossless mode (uses Q)
@@ -2023,10 +2066,14 @@ module Vips
2023
2066
  # @option opts [Integer] :kmin Minimum number of frames between key frames
2024
2067
  # @option opts [Integer] :kmax Maximum number of frames between key frames
2025
2068
  # @option opts [Integer] :effort Level of CPU effort to reduce file size
2069
+ # @option opts [Integer] :target_size Desired target size in bytes
2026
2070
  # @option opts [Boolean] :mixed Allow mixed encoding (might reduce file size)
2071
+ # @option opts [Boolean] :smart_deblock Enable auto-adjusting of the deblocking filter
2072
+ # @option opts [Integer] :passes Number of entropy-analysis passes (in [1..10])
2027
2073
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
2028
2074
  # @option opts [Array<Double>] :background Background value
2029
2075
  # @option opts [Integer] :page_height Set page height for multipage save
2076
+ # @option opts [String] :profile Filename of ICC profile to embed
2030
2077
  # @return [nil]
2031
2078
 
2032
2079
  # @!method webpsave_buffer(**opts)
@@ -2034,7 +2081,6 @@ module Vips
2034
2081
  # @param opts [Hash] Set of options
2035
2082
  # @option opts [Integer] :Q Q factor
2036
2083
  # @option opts [Boolean] :lossless Enable lossless compression
2037
- # @option opts [String] :profile Filename of ICC profile to embed
2038
2084
  # @option opts [Vips::ForeignWebpPreset] :preset Preset for lossy compression
2039
2085
  # @option opts [Boolean] :smart_subsample Enable high quality chroma subsampling
2040
2086
  # @option opts [Boolean] :near_lossless Enable preprocessing in lossless mode (uses Q)
@@ -2043,10 +2089,14 @@ module Vips
2043
2089
  # @option opts [Integer] :kmin Minimum number of frames between key frames
2044
2090
  # @option opts [Integer] :kmax Maximum number of frames between key frames
2045
2091
  # @option opts [Integer] :effort Level of CPU effort to reduce file size
2092
+ # @option opts [Integer] :target_size Desired target size in bytes
2046
2093
  # @option opts [Boolean] :mixed Allow mixed encoding (might reduce file size)
2094
+ # @option opts [Boolean] :smart_deblock Enable auto-adjusting of the deblocking filter
2095
+ # @option opts [Integer] :passes Number of entropy-analysis passes (in [1..10])
2047
2096
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
2048
2097
  # @option opts [Array<Double>] :background Background value
2049
2098
  # @option opts [Integer] :page_height Set page height for multipage save
2099
+ # @option opts [String] :profile Filename of ICC profile to embed
2050
2100
  # @return [VipsBlob] Buffer to save to
2051
2101
 
2052
2102
  # @!method webpsave_target(target, **opts)
@@ -2055,7 +2105,6 @@ module Vips
2055
2105
  # @param opts [Hash] Set of options
2056
2106
  # @option opts [Integer] :Q Q factor
2057
2107
  # @option opts [Boolean] :lossless Enable lossless compression
2058
- # @option opts [String] :profile Filename of ICC profile to embed
2059
2108
  # @option opts [Vips::ForeignWebpPreset] :preset Preset for lossy compression
2060
2109
  # @option opts [Boolean] :smart_subsample Enable high quality chroma subsampling
2061
2110
  # @option opts [Boolean] :near_lossless Enable preprocessing in lossless mode (uses Q)
@@ -2064,10 +2113,14 @@ module Vips
2064
2113
  # @option opts [Integer] :kmin Minimum number of frames between key frames
2065
2114
  # @option opts [Integer] :kmax Maximum number of frames between key frames
2066
2115
  # @option opts [Integer] :effort Level of CPU effort to reduce file size
2116
+ # @option opts [Integer] :target_size Desired target size in bytes
2067
2117
  # @option opts [Boolean] :mixed Allow mixed encoding (might reduce file size)
2118
+ # @option opts [Boolean] :smart_deblock Enable auto-adjusting of the deblocking filter
2119
+ # @option opts [Integer] :passes Number of entropy-analysis passes (in [1..10])
2068
2120
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
2069
2121
  # @option opts [Array<Double>] :background Background value
2070
2122
  # @option opts [Integer] :page_height Set page height for multipage save
2123
+ # @option opts [String] :profile Filename of ICC profile to embed
2071
2124
  # @return [nil]
2072
2125
 
2073
2126
  # @!method webpsave_mime(**opts)
@@ -2075,7 +2128,6 @@ module Vips
2075
2128
  # @param opts [Hash] Set of options
2076
2129
  # @option opts [Integer] :Q Q factor
2077
2130
  # @option opts [Boolean] :lossless Enable lossless compression
2078
- # @option opts [String] :profile Filename of ICC profile to embed
2079
2131
  # @option opts [Vips::ForeignWebpPreset] :preset Preset for lossy compression
2080
2132
  # @option opts [Boolean] :smart_subsample Enable high quality chroma subsampling
2081
2133
  # @option opts [Boolean] :near_lossless Enable preprocessing in lossless mode (uses Q)
@@ -2084,10 +2136,14 @@ module Vips
2084
2136
  # @option opts [Integer] :kmin Minimum number of frames between key frames
2085
2137
  # @option opts [Integer] :kmax Maximum number of frames between key frames
2086
2138
  # @option opts [Integer] :effort Level of CPU effort to reduce file size
2139
+ # @option opts [Integer] :target_size Desired target size in bytes
2087
2140
  # @option opts [Boolean] :mixed Allow mixed encoding (might reduce file size)
2141
+ # @option opts [Boolean] :smart_deblock Enable auto-adjusting of the deblocking filter
2142
+ # @option opts [Integer] :passes Number of entropy-analysis passes (in [1..10])
2088
2143
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
2089
2144
  # @option opts [Array<Double>] :background Background value
2090
2145
  # @option opts [Integer] :page_height Set page height for multipage save
2146
+ # @option opts [String] :profile Filename of ICC profile to embed
2091
2147
  # @return [nil]
2092
2148
 
2093
2149
  # @!method tiffsave(filename, **opts)
@@ -2099,7 +2155,6 @@ module Vips
2099
2155
  # @option opts [Vips::ForeignTiffPredictor] :predictor Compression prediction
2100
2156
  # @option opts [Boolean] :tile Write a tiled tiff
2101
2157
  # @option opts [Integer] :tile_width Tile width in pixels
2102
- # @option opts [String] :profile Filename of ICC profile to embed
2103
2158
  # @option opts [Integer] :tile_height Tile height in pixels
2104
2159
  # @option opts [Boolean] :pyramid Write a pyramidal tiff
2105
2160
  # @option opts [Boolean] :miniswhite Use 0 for white in 1-bit images
@@ -2110,7 +2165,7 @@ module Vips
2110
2165
  # @option opts [Boolean] :bigtiff Write a bigtiff image
2111
2166
  # @option opts [Boolean] :properties Write a properties document to IMAGEDESCRIPTION
2112
2167
  # @option opts [Vips::RegionShrink] :region_shrink Method to shrink regions
2113
- # @option opts [Integer] :level ZSTD compression level
2168
+ # @option opts [Integer] :level Deflate (1-9, default 6) or ZSTD (1-22, default 9) compression level
2114
2169
  # @option opts [Boolean] :lossless Enable WEBP lossless mode
2115
2170
  # @option opts [Vips::ForeignDzDepth] :depth Pyramid depth
2116
2171
  # @option opts [Boolean] :subifd Save pyr layers as sub-IFDs
@@ -2118,6 +2173,7 @@ module Vips
2118
2173
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
2119
2174
  # @option opts [Array<Double>] :background Background value
2120
2175
  # @option opts [Integer] :page_height Set page height for multipage save
2176
+ # @option opts [String] :profile Filename of ICC profile to embed
2121
2177
  # @return [nil]
2122
2178
 
2123
2179
  # @!method tiffsave_buffer(**opts)
@@ -2128,7 +2184,6 @@ module Vips
2128
2184
  # @option opts [Vips::ForeignTiffPredictor] :predictor Compression prediction
2129
2185
  # @option opts [Boolean] :tile Write a tiled tiff
2130
2186
  # @option opts [Integer] :tile_width Tile width in pixels
2131
- # @option opts [String] :profile Filename of ICC profile to embed
2132
2187
  # @option opts [Integer] :tile_height Tile height in pixels
2133
2188
  # @option opts [Boolean] :pyramid Write a pyramidal tiff
2134
2189
  # @option opts [Boolean] :miniswhite Use 0 for white in 1-bit images
@@ -2139,7 +2194,7 @@ module Vips
2139
2194
  # @option opts [Boolean] :bigtiff Write a bigtiff image
2140
2195
  # @option opts [Boolean] :properties Write a properties document to IMAGEDESCRIPTION
2141
2196
  # @option opts [Vips::RegionShrink] :region_shrink Method to shrink regions
2142
- # @option opts [Integer] :level ZSTD compression level
2197
+ # @option opts [Integer] :level Deflate (1-9, default 6) or ZSTD (1-22, default 9) compression level
2143
2198
  # @option opts [Boolean] :lossless Enable WEBP lossless mode
2144
2199
  # @option opts [Vips::ForeignDzDepth] :depth Pyramid depth
2145
2200
  # @option opts [Boolean] :subifd Save pyr layers as sub-IFDs
@@ -2147,6 +2202,7 @@ module Vips
2147
2202
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
2148
2203
  # @option opts [Array<Double>] :background Background value
2149
2204
  # @option opts [Integer] :page_height Set page height for multipage save
2205
+ # @option opts [String] :profile Filename of ICC profile to embed
2150
2206
  # @return [VipsBlob] Buffer to save to
2151
2207
 
2152
2208
  # @!method tiffsave_target(target, **opts)
@@ -2158,7 +2214,6 @@ module Vips
2158
2214
  # @option opts [Vips::ForeignTiffPredictor] :predictor Compression prediction
2159
2215
  # @option opts [Boolean] :tile Write a tiled tiff
2160
2216
  # @option opts [Integer] :tile_width Tile width in pixels
2161
- # @option opts [String] :profile Filename of ICC profile to embed
2162
2217
  # @option opts [Integer] :tile_height Tile height in pixels
2163
2218
  # @option opts [Boolean] :pyramid Write a pyramidal tiff
2164
2219
  # @option opts [Boolean] :miniswhite Use 0 for white in 1-bit images
@@ -2169,7 +2224,7 @@ module Vips
2169
2224
  # @option opts [Boolean] :bigtiff Write a bigtiff image
2170
2225
  # @option opts [Boolean] :properties Write a properties document to IMAGEDESCRIPTION
2171
2226
  # @option opts [Vips::RegionShrink] :region_shrink Method to shrink regions
2172
- # @option opts [Integer] :level ZSTD compression level
2227
+ # @option opts [Integer] :level Deflate (1-9, default 6) or ZSTD (1-22, default 9) compression level
2173
2228
  # @option opts [Boolean] :lossless Enable WEBP lossless mode
2174
2229
  # @option opts [Vips::ForeignDzDepth] :depth Pyramid depth
2175
2230
  # @option opts [Boolean] :subifd Save pyr layers as sub-IFDs
@@ -2177,26 +2232,27 @@ module Vips
2177
2232
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
2178
2233
  # @option opts [Array<Double>] :background Background value
2179
2234
  # @option opts [Integer] :page_height Set page height for multipage save
2235
+ # @option opts [String] :profile Filename of ICC profile to embed
2180
2236
  # @return [nil]
2181
2237
 
2182
2238
  # @!method fitssave(filename, **opts)
2183
2239
  # Save image to fits file.
2184
2240
  # @param filename [String] Filename to save to
2185
2241
  # @param opts [Hash] Set of options
2186
- # @option opts [String] :profile Filename of ICC profile to embed
2187
2242
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
2188
2243
  # @option opts [Array<Double>] :background Background value
2189
2244
  # @option opts [Integer] :page_height Set page height for multipage save
2245
+ # @option opts [String] :profile Filename of ICC profile to embed
2190
2246
  # @return [nil]
2191
2247
 
2192
2248
  # @!method niftisave(filename, **opts)
2193
2249
  # Save image to nifti file.
2194
2250
  # @param filename [String] Filename to save to
2195
2251
  # @param opts [Hash] Set of options
2196
- # @option opts [String] :profile Filename of ICC profile to embed
2197
2252
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
2198
2253
  # @option opts [Array<Double>] :background Background value
2199
2254
  # @option opts [Integer] :page_height Set page height for multipage save
2255
+ # @option opts [String] :profile Filename of ICC profile to embed
2200
2256
  # @return [nil]
2201
2257
 
2202
2258
  # @!method heifsave(filename, **opts)
@@ -2205,7 +2261,6 @@ module Vips
2205
2261
  # @param opts [Hash] Set of options
2206
2262
  # @option opts [Integer] :Q Q factor
2207
2263
  # @option opts [Integer] :bitdepth Number of bits per pixel
2208
- # @option opts [String] :profile Filename of ICC profile to embed
2209
2264
  # @option opts [Boolean] :lossless Enable lossless compression
2210
2265
  # @option opts [Vips::ForeignHeifCompression] :compression Compression format
2211
2266
  # @option opts [Integer] :effort CPU effort
@@ -2214,6 +2269,7 @@ module Vips
2214
2269
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
2215
2270
  # @option opts [Array<Double>] :background Background value
2216
2271
  # @option opts [Integer] :page_height Set page height for multipage save
2272
+ # @option opts [String] :profile Filename of ICC profile to embed
2217
2273
  # @return [nil]
2218
2274
 
2219
2275
  # @!method heifsave_buffer(**opts)
@@ -2221,7 +2277,6 @@ module Vips
2221
2277
  # @param opts [Hash] Set of options
2222
2278
  # @option opts [Integer] :Q Q factor
2223
2279
  # @option opts [Integer] :bitdepth Number of bits per pixel
2224
- # @option opts [String] :profile Filename of ICC profile to embed
2225
2280
  # @option opts [Boolean] :lossless Enable lossless compression
2226
2281
  # @option opts [Vips::ForeignHeifCompression] :compression Compression format
2227
2282
  # @option opts [Integer] :effort CPU effort
@@ -2230,6 +2285,7 @@ module Vips
2230
2285
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
2231
2286
  # @option opts [Array<Double>] :background Background value
2232
2287
  # @option opts [Integer] :page_height Set page height for multipage save
2288
+ # @option opts [String] :profile Filename of ICC profile to embed
2233
2289
  # @return [VipsBlob] Buffer to save to
2234
2290
 
2235
2291
  # @!method heifsave_target(target, **opts)
@@ -2238,7 +2294,6 @@ module Vips
2238
2294
  # @param opts [Hash] Set of options
2239
2295
  # @option opts [Integer] :Q Q factor
2240
2296
  # @option opts [Integer] :bitdepth Number of bits per pixel
2241
- # @option opts [String] :profile Filename of ICC profile to embed
2242
2297
  # @option opts [Boolean] :lossless Enable lossless compression
2243
2298
  # @option opts [Vips::ForeignHeifCompression] :compression Compression format
2244
2299
  # @option opts [Integer] :effort CPU effort
@@ -2247,21 +2302,22 @@ module Vips
2247
2302
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
2248
2303
  # @option opts [Array<Double>] :background Background value
2249
2304
  # @option opts [Integer] :page_height Set page height for multipage save
2305
+ # @option opts [String] :profile Filename of ICC profile to embed
2250
2306
  # @return [nil]
2251
2307
 
2252
2308
  # @!method jxlsave(filename, **opts)
2253
2309
  # Save image in jpeg-xl format.
2254
- # @param filename [String] Filename to load from
2310
+ # @param filename [String] Filename to save to
2255
2311
  # @param opts [Hash] Set of options
2256
2312
  # @option opts [Integer] :tier Decode speed tier
2257
2313
  # @option opts [Float] :distance Target butteraugli distance
2258
- # @option opts [String] :profile Filename of ICC profile to embed
2259
2314
  # @option opts [Integer] :effort Encoding effort
2260
2315
  # @option opts [Boolean] :lossless Enable lossless compression
2261
2316
  # @option opts [Integer] :Q Quality factor
2262
2317
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
2263
2318
  # @option opts [Array<Double>] :background Background value
2264
2319
  # @option opts [Integer] :page_height Set page height for multipage save
2320
+ # @option opts [String] :profile Filename of ICC profile to embed
2265
2321
  # @return [nil]
2266
2322
 
2267
2323
  # @!method jxlsave_buffer(**opts)
@@ -2269,13 +2325,13 @@ module Vips
2269
2325
  # @param opts [Hash] Set of options
2270
2326
  # @option opts [Integer] :tier Decode speed tier
2271
2327
  # @option opts [Float] :distance Target butteraugli distance
2272
- # @option opts [String] :profile Filename of ICC profile to embed
2273
2328
  # @option opts [Integer] :effort Encoding effort
2274
2329
  # @option opts [Boolean] :lossless Enable lossless compression
2275
2330
  # @option opts [Integer] :Q Quality factor
2276
2331
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
2277
2332
  # @option opts [Array<Double>] :background Background value
2278
2333
  # @option opts [Integer] :page_height Set page height for multipage save
2334
+ # @option opts [String] :profile Filename of ICC profile to embed
2279
2335
  # @return [VipsBlob] Buffer to save to
2280
2336
 
2281
2337
  # @!method jxlsave_target(target, **opts)
@@ -2284,13 +2340,13 @@ module Vips
2284
2340
  # @param opts [Hash] Set of options
2285
2341
  # @option opts [Integer] :tier Decode speed tier
2286
2342
  # @option opts [Float] :distance Target butteraugli distance
2287
- # @option opts [String] :profile Filename of ICC profile to embed
2288
2343
  # @option opts [Integer] :effort Encoding effort
2289
2344
  # @option opts [Boolean] :lossless Enable lossless compression
2290
2345
  # @option opts [Integer] :Q Quality factor
2291
2346
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
2292
2347
  # @option opts [Array<Double>] :background Background value
2293
2348
  # @option opts [Integer] :page_height Set page height for multipage save
2349
+ # @option opts [String] :profile Filename of ICC profile to embed
2294
2350
  # @return [nil]
2295
2351
 
2296
2352
  # @!method magicksave(filename, **opts)
@@ -2302,10 +2358,10 @@ module Vips
2302
2358
  # @option opts [Boolean] :optimize_gif_frames Apply GIF frames optimization
2303
2359
  # @option opts [Boolean] :optimize_gif_transparency Apply GIF transparency optimization
2304
2360
  # @option opts [Integer] :bitdepth Number of bits per pixel
2305
- # @option opts [String] :profile Filename of ICC profile to embed
2306
2361
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
2307
2362
  # @option opts [Array<Double>] :background Background value
2308
2363
  # @option opts [Integer] :page_height Set page height for multipage save
2364
+ # @option opts [String] :profile Filename of ICC profile to embed
2309
2365
  # @return [nil]
2310
2366
 
2311
2367
  # @!method magicksave_buffer(**opts)
@@ -2316,10 +2372,10 @@ module Vips
2316
2372
  # @option opts [Boolean] :optimize_gif_frames Apply GIF frames optimization
2317
2373
  # @option opts [Boolean] :optimize_gif_transparency Apply GIF transparency optimization
2318
2374
  # @option opts [Integer] :bitdepth Number of bits per pixel
2319
- # @option opts [String] :profile Filename of ICC profile to embed
2320
2375
  # @option opts [Vips::ForeignKeep] :keep Which metadata to retain
2321
2376
  # @option opts [Array<Double>] :background Background value
2322
2377
  # @option opts [Integer] :page_height Set page height for multipage save
2378
+ # @option opts [String] :profile Filename of ICC profile to embed
2323
2379
  # @return [VipsBlob] Buffer to save to
2324
2380
 
2325
2381
  # @!method self.thumbnail(filename, width, **opts)
@@ -2470,7 +2526,7 @@ module Vips
2470
2526
  # Similarity transform of an image.
2471
2527
  # @param opts [Hash] Set of options
2472
2528
  # @option opts [Float] :scale Scale by this factor
2473
- # @option opts [Float] :angle Rotate anticlockwise by this many degrees
2529
+ # @option opts [Float] :angle Rotate clockwise by this many degrees
2474
2530
  # @option opts [Vips::Interpolate] :interpolate Interpolate pixels with this
2475
2531
  # @option opts [Array<Double>] :background Background value
2476
2532
  # @option opts [Float] :odx Horizontal output displacement
@@ -2481,7 +2537,7 @@ module Vips
2481
2537
 
2482
2538
  # @!method rotate(angle, **opts)
2483
2539
  # Rotate an image by a number of degrees.
2484
- # @param angle [Float] Rotate anticlockwise by this many degrees
2540
+ # @param angle [Float] Rotate clockwise by this many degrees
2485
2541
  # @param opts [Hash] Set of options
2486
2542
  # @option opts [Vips::Interpolate] :interpolate Interpolate pixels with this
2487
2543
  # @option opts [Array<Double>] :background Background value
data/lib/vips/object.rb CHANGED
@@ -9,9 +9,6 @@ require "ffi"
9
9
  module Vips
10
10
  private
11
11
 
12
- # debugging support
13
- attach_function :vips_object_print_all, [], :void
14
-
15
12
  # we must init these by hand, since they are usually made on first image
16
13
  # create
17
14
  attach_function :vips_band_format_get_type, [], :GType
@@ -337,6 +334,7 @@ module Vips
337
334
  ArgumentClassPtr.ptr, ArgumentInstancePtr.ptr],
338
335
  :int
339
336
 
337
+ # debugging support
340
338
  attach_function :vips_object_print_all, [], :void
341
339
 
342
340
  attach_function :vips_object_set_from_string, [:pointer, :string], :int
@@ -218,7 +218,7 @@ module Vips
218
218
  raise Vips::Error if value.null?
219
219
  end
220
220
 
221
- super(value)
221
+ super
222
222
  end
223
223
 
224
224
  def build
data/lib/vips/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Vips
2
- VERSION = "2.2.1"
2
+ VERSION = "2.2.3"
3
3
  end
data/lib/vips.rb CHANGED
@@ -33,6 +33,30 @@ def library_name(name, abi_number)
33
33
  end
34
34
  end
35
35
 
36
+ # we can sometimes get dependent libraries from libvips -- either the platform
37
+ # will open dependencies for us automatically, or the libvips binary has been
38
+ # built to includes all main dependencies (common on windows, can happen
39
+ # elsewhere)
40
+ #
41
+ # we must get glib functions from libvips if we can, since it will be the
42
+ # one that libvips itself is using, and they will share runtime types
43
+ module Vips
44
+ extend FFI::Library
45
+
46
+ ffi_lib library_name("vips", 42)
47
+
48
+ begin
49
+ attach_function :g_malloc, [:size_t], :pointer
50
+ @@is_unified = true
51
+ rescue FFI::NotFoundError
52
+ @@is_unified = false
53
+ end
54
+
55
+ def self.unified?
56
+ @@is_unified
57
+ end
58
+ end
59
+
36
60
  module GLib
37
61
  class << self
38
62
  attr_accessor :logger
@@ -42,7 +66,11 @@ module GLib
42
66
 
43
67
  extend FFI::Library
44
68
 
45
- ffi_lib library_name("glib-2.0", 0)
69
+ if Vips.unified?
70
+ ffi_lib library_name("vips", 42)
71
+ else
72
+ ffi_lib library_name("glib-2.0", 0)
73
+ end
46
74
 
47
75
  attach_function :g_malloc, [:size_t], :pointer
48
76
 
@@ -134,7 +162,11 @@ end
134
162
  module GObject
135
163
  extend FFI::Library
136
164
 
137
- ffi_lib library_name("gobject-2.0", 0)
165
+ if Vips.unified?
166
+ ffi_lib library_name("vips", 42)
167
+ else
168
+ ffi_lib library_name("gobject-2.0", 0)
169
+ end
138
170
 
139
171
  # we can't just use ulong, windows has different int sizing rules
140
172
  if FFI::Platform::ADDRESS_SIZE == 64
@@ -568,9 +600,7 @@ require "vips/gvalue"
568
600
  # {Image#median}.
569
601
 
570
602
  module Vips
571
- extend FFI::Library
572
-
573
- ffi_lib library_name("vips", 42)
603
+ # we've already opened the libvips library
574
604
 
575
605
  LOG_DOMAIN = "VIPS"
576
606
  GLib.set_log_domain LOG_DOMAIN
@@ -780,13 +810,13 @@ module Vips
780
810
  end
781
811
 
782
812
  if at_least_libvips?(8, 13)
783
- attach_function :vips_block_untrusted_set, [:bool], :void
784
- attach_function :vips_operation_block_set, %i[string bool], :void
813
+ attach_function :vips_block_untrusted_set, [:int], :void
814
+ attach_function :vips_operation_block_set, [:string, :int], :void
785
815
 
786
816
  # Block/unblock all untrusted operations from running.
787
817
  # Use `vips -l` at the command-line to see the class hierarchy and which operations are marked as untrusted.
788
- def self.block_untrusted(enabled)
789
- vips_block_untrusted_set(enabled)
818
+ def self.block_untrusted(state)
819
+ vips_block_untrusted_set(state ? 1 : 0)
790
820
  end
791
821
 
792
822
  # Block/unblock all operations in the libvips class hierarchy at specified *operation_name* and below.
@@ -799,8 +829,8 @@ module Vips
799
829
  # Use `vips -l` at the command-line to see the class hierarchy.
800
830
  # This call does nothing if the named operation is not found.
801
831
  #
802
- def self.block(operation_name, enabled)
803
- vips_operation_block_set(operation_name, enabled)
832
+ def self.block(operation_name, state)
833
+ vips_operation_block_set(operation_name, state ? 1 : 0)
804
834
  end
805
835
  end
806
836
 
data/ruby-vips.gemspec CHANGED
@@ -36,6 +36,7 @@ Gem::Specification.new do |spec|
36
36
  spec.required_ruby_version = ">= 2.0.0"
37
37
 
38
38
  spec.add_runtime_dependency "ffi", ["~> 1.12"]
39
+ spec.add_runtime_dependency "logger"
39
40
 
40
41
  spec.add_development_dependency "rake", ["~> 12.0"]
41
42
  spec.add_development_dependency "rspec", ["~> 3.3"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-vips
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Cupitt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-21 00:00:00.000000000 Z
11
+ date: 2025-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.12'
27
+ - !ruby/object:Gem::Dependency
28
+ name: logger
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: rake
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -206,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
206
220
  - !ruby/object:Gem::Version
207
221
  version: '0'
208
222
  requirements: []
209
- rubygems_version: 3.3.15
223
+ rubygems_version: 3.4.20
210
224
  signing_key:
211
225
  specification_version: 4
212
226
  summary: A fast image processing library with low memory needs