ruby-vips 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b632e0e44fa32da791e46806757e9b6a1a9901d92e2de9b02e16682bc3f3e6b2
4
- data.tar.gz: 5d3841b9a656d13003b1b2668c05ab89cf5b65c76a52dad070a67b9a6856fe60
3
+ metadata.gz: c77f69e33910d95f8f678cff9787066e2af91cd889f24ec3834dcfaf78ee5cfc
4
+ data.tar.gz: 140effde4d987fff3e293034b0967245aa4f914ba603d8bce41010d0ec1a63ba
5
5
  SHA512:
6
- metadata.gz: 11c11a729818aa279cf5a157cda6e810174da9089b9ae3a0e92b3c7e6080362dfca5a970b07f3881aa7f31e5aa4acf3cd1a9a05a2e3ef09dc86d7464fe8987fe
7
- data.tar.gz: 41bae93d0c491699e0042acfe687bc86766af576c9ffe57da1c20a26de548e08c73c0d7685855a155630ed5d47a3a2e2e60f982df48df2a59d4a9f4bd6ccfd34
6
+ metadata.gz: 28b7309c3a0744b29c5d100b898aab3521cc07a17667d4041db3d5194db537336bdda578e25fddb79be929c0ac32a246fb47f08862c5273fc94c2e390cc5874c
7
+ data.tar.gz: d428e645d302329a9544819a188b7b010f1e265086a064cd2480dc5213d61a9ef78b0da5381a6f8bd85754ac5c8f2ce6f253701afb27e3180e157d1e807294d3
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## Version 2.1.1 (2021-5-3)
6
+
7
+ * fix "mutate" with libvips 8.9 [jcupitt]
8
+ * update autodocs for libvips 8.11 [jcupitt]
9
+
5
10
  ## Version 2.1.0 (2021-3-8)
6
11
 
7
12
  * add "mutate" system [jcupitt]
data/TODO CHANGED
@@ -37,9 +37,8 @@
37
37
 
38
38
  - Push new gem to rubygems, tag repository with version.
39
39
 
40
- gem2.5 signin --otp 111111 / enter username and passwd
40
+ gem signin --otp 111111
41
41
  bundle exec rake release
42
42
 
43
- There's an invisible prompt for the authenticator code. Enter eg. 123456,
44
- press return and the upload should work.
43
+ The otp is from authy / google authenticator / etc.
45
44
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.1.0
1
+ 2.1.1
data/lib/vips/image.rb CHANGED
@@ -1129,14 +1129,10 @@ module Vips
1129
1129
  end
1130
1130
  end
1131
1131
 
1132
- # Convert to an Array. This will be slow for large images.
1132
+ # Convert to an Enumerator. Similar to `#to_a` but lazier.
1133
1133
  #
1134
- # @return [Array] array of Fixnum
1135
- def to_a
1136
- # we render the image to a big string, then unpack
1137
- # as a Ruby array of the correct type
1138
- memory = write_to_memory
1139
-
1134
+ # @return [Enumerator] Enumerator of Enumerators of Arrays of Numerics
1135
+ def to_enum
1140
1136
  # make the template for unpack
1141
1137
  template = {
1142
1138
  char: "c",
@@ -1151,14 +1147,22 @@ module Vips
1151
1147
  dpcomplex: "d"
1152
1148
  }[format] + "*"
1153
1149
 
1154
- # and unpack into something like [1, 2, 3, 4 ..]
1155
- array = memory.unpack(template)
1150
+ # we render the image to a big string, then unpack into
1151
+ # one-dimensional array as a Ruby array of the correct type
1152
+ array = write_to_memory.unpack template
1153
+
1154
+ # gather bands of a pixel together
1155
+ pixel_array = array.each_slice bands
1156
1156
 
1157
- # gather band elements together
1158
- pixel_array = array.each_slice(bands).to_a
1157
+ # gather pixels of a row together
1158
+ pixel_array.each_slice width
1159
+ end
1159
1160
 
1160
- # build rows
1161
- pixel_array.each_slice(width).to_a
1161
+ # Convert to an Array. This will be slow for large images.
1162
+ #
1163
+ # @return [Array] Array of Arrays of Arrays of Numerics
1164
+ def to_a
1165
+ to_enum.to_a
1162
1166
  end
1163
1167
 
1164
1168
  # Return the largest integral value not greater than the argument.
data/lib/vips/methods.rb CHANGED
@@ -590,21 +590,6 @@ module Vips
590
590
  # @option opts [Integer] :seed Random number seed
591
591
  # @return [Vips::Image] Output image
592
592
 
593
- # @!method self.text(text, **opts)
594
- # Make a text image.
595
- # @param text [String] Text to render
596
- # @param opts [Hash] Set of options
597
- # @option opts [String] :font Font to render with
598
- # @option opts [Integer] :width Maximum image width in pixels
599
- # @option opts [Integer] :height Maximum image height in pixels
600
- # @option opts [Vips::Align] :align Align on the low, centre or high edge
601
- # @option opts [Integer] :dpi DPI to render at
602
- # @option opts [Boolean] :justify Justify lines
603
- # @option opts [Integer] :spacing Line spacing
604
- # @option opts [String] :fontfile Load this font file
605
- # @option opts [Integer] :autofit_dpi Output DPI selected by autofit
606
- # @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
607
-
608
593
  # @!method self.xyz(width, height, **opts)
609
594
  # Make an image where pixel values are coordinates.
610
595
  # @param width [Integer] Image width in pixels
@@ -635,6 +620,22 @@ module Vips
635
620
  # @option opts [Vips::Precision] :precision Generate with this precision
636
621
  # @return [Vips::Image] Output image
637
622
 
623
+ # @!method self.text(text, **opts)
624
+ # Make a text image.
625
+ # @param text [String] Text to render
626
+ # @param opts [Hash] Set of options
627
+ # @option opts [String] :font Font to render with
628
+ # @option opts [Integer] :width Maximum image width in pixels
629
+ # @option opts [Integer] :height Maximum image height in pixels
630
+ # @option opts [Vips::Align] :align Align on the low, centre or high edge
631
+ # @option opts [Boolean] :rgba Enable RGBA output
632
+ # @option opts [Integer] :dpi DPI to render at
633
+ # @option opts [Boolean] :justify Justify lines
634
+ # @option opts [Integer] :spacing Line spacing
635
+ # @option opts [String] :fontfile Load this font file
636
+ # @option opts [Integer] :autofit_dpi Output DPI selected by autofit
637
+ # @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
638
+
638
639
  # @!method self.eye(width, height, **opts)
639
640
  # Make an image showing the eye's spatial response.
640
641
  # @param width [Integer] Image width in pixels
@@ -961,6 +962,18 @@ module Vips
961
962
  # @option opts [Vips::ForeignFlags] :flags Output Flags for this file
962
963
  # @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
963
964
 
965
+ # @!method self.vipsload_source(source, **opts)
966
+ # Load vips from source.
967
+ # @param source [Vips::Source] Source to load from
968
+ # @param opts [Hash] Set of options
969
+ # @option opts [Boolean] :memory Force open via memory
970
+ # @option opts [Vips::Access] :access Required access pattern for this file
971
+ # @option opts [Boolean] :sequential Sequential read only
972
+ # @option opts [Boolean] :fail Fail on first error
973
+ # @option opts [Boolean] :disc Open to disc
974
+ # @option opts [Vips::ForeignFlags] :flags Output Flags for this file
975
+ # @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
976
+
964
977
  # @!method self.analyzeload(filename, **opts)
965
978
  # Load an analyze6 image.
966
979
  # @param filename [String] Filename to load from
@@ -1033,15 +1046,13 @@ module Vips
1033
1046
  # @option opts [Vips::ForeignFlags] :flags Output Flags for this file
1034
1047
  # @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
1035
1048
 
1036
- # @!method self.pdfload(filename, **opts)
1037
- # Load pdf from file.
1049
+ # @!method self.svgload(filename, **opts)
1050
+ # Load svg with rsvg.
1038
1051
  # @param filename [String] Filename to load from
1039
1052
  # @param opts [Hash] Set of options
1040
- # @option opts [Integer] :page Load this page from the file
1041
- # @option opts [Integer] :n Load this many pages
1042
1053
  # @option opts [Float] :dpi Render at this DPI
1043
1054
  # @option opts [Float] :scale Scale output by this factor
1044
- # @option opts [Array<Double>] :background Background value
1055
+ # @option opts [Boolean] :unlimited Allow SVG of any size
1045
1056
  # @option opts [Boolean] :memory Force open via memory
1046
1057
  # @option opts [Vips::Access] :access Required access pattern for this file
1047
1058
  # @option opts [Boolean] :sequential Sequential read only
@@ -1050,15 +1061,13 @@ module Vips
1050
1061
  # @option opts [Vips::ForeignFlags] :flags Output Flags for this file
1051
1062
  # @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
1052
1063
 
1053
- # @!method self.pdfload_buffer(buffer, **opts)
1054
- # Load pdf from buffer.
1064
+ # @!method self.svgload_buffer(buffer, **opts)
1065
+ # Load svg with rsvg.
1055
1066
  # @param buffer [VipsBlob] Buffer to load from
1056
1067
  # @param opts [Hash] Set of options
1057
- # @option opts [Integer] :page Load this page from the file
1058
- # @option opts [Integer] :n Load this many pages
1059
1068
  # @option opts [Float] :dpi Render at this DPI
1060
1069
  # @option opts [Float] :scale Scale output by this factor
1061
- # @option opts [Array<Double>] :background Background value
1070
+ # @option opts [Boolean] :unlimited Allow SVG of any size
1062
1071
  # @option opts [Boolean] :memory Force open via memory
1063
1072
  # @option opts [Vips::Access] :access Required access pattern for this file
1064
1073
  # @option opts [Boolean] :sequential Sequential read only
@@ -1067,15 +1076,13 @@ module Vips
1067
1076
  # @option opts [Vips::ForeignFlags] :flags Output Flags for this file
1068
1077
  # @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
1069
1078
 
1070
- # @!method self.pdfload_source(source, **opts)
1071
- # Load pdf from source.
1079
+ # @!method self.svgload_source(source, **opts)
1080
+ # Load svg from source.
1072
1081
  # @param source [Vips::Source] Source to load from
1073
1082
  # @param opts [Hash] Set of options
1074
- # @option opts [Integer] :page Load this page from the file
1075
- # @option opts [Integer] :n Load this many pages
1076
1083
  # @option opts [Float] :dpi Render at this DPI
1077
1084
  # @option opts [Float] :scale Scale output by this factor
1078
- # @option opts [Array<Double>] :background Background value
1085
+ # @option opts [Boolean] :unlimited Allow SVG of any size
1079
1086
  # @option opts [Boolean] :memory Force open via memory
1080
1087
  # @option opts [Vips::Access] :access Required access pattern for this file
1081
1088
  # @option opts [Boolean] :sequential Sequential read only
@@ -1084,13 +1091,10 @@ module Vips
1084
1091
  # @option opts [Vips::ForeignFlags] :flags Output Flags for this file
1085
1092
  # @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
1086
1093
 
1087
- # @!method self.svgload(filename, **opts)
1088
- # Load svg with rsvg.
1094
+ # @!method self.jxlload(filename, **opts)
1095
+ # Load jpeg-xl image.
1089
1096
  # @param filename [String] Filename to load from
1090
1097
  # @param opts [Hash] Set of options
1091
- # @option opts [Float] :dpi Render at this DPI
1092
- # @option opts [Float] :scale Scale output by this factor
1093
- # @option opts [Boolean] :unlimited Allow SVG of any size
1094
1098
  # @option opts [Boolean] :memory Force open via memory
1095
1099
  # @option opts [Vips::Access] :access Required access pattern for this file
1096
1100
  # @option opts [Boolean] :sequential Sequential read only
@@ -1099,13 +1103,10 @@ module Vips
1099
1103
  # @option opts [Vips::ForeignFlags] :flags Output Flags for this file
1100
1104
  # @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
1101
1105
 
1102
- # @!method self.svgload_buffer(buffer, **opts)
1103
- # Load svg with rsvg.
1106
+ # @!method self.jxlload_buffer(buffer, **opts)
1107
+ # Load jpeg-xl image.
1104
1108
  # @param buffer [VipsBlob] Buffer to load from
1105
1109
  # @param opts [Hash] Set of options
1106
- # @option opts [Float] :dpi Render at this DPI
1107
- # @option opts [Float] :scale Scale output by this factor
1108
- # @option opts [Boolean] :unlimited Allow SVG of any size
1109
1110
  # @option opts [Boolean] :memory Force open via memory
1110
1111
  # @option opts [Vips::Access] :access Required access pattern for this file
1111
1112
  # @option opts [Boolean] :sequential Sequential read only
@@ -1114,13 +1115,49 @@ module Vips
1114
1115
  # @option opts [Vips::ForeignFlags] :flags Output Flags for this file
1115
1116
  # @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
1116
1117
 
1117
- # @!method self.svgload_source(source, **opts)
1118
- # Load svg from source.
1118
+ # @!method self.jxlload_source(source, **opts)
1119
+ # Load jpeg-xl image.
1119
1120
  # @param source [Vips::Source] Source to load from
1120
1121
  # @param opts [Hash] Set of options
1121
- # @option opts [Float] :dpi Render at this DPI
1122
- # @option opts [Float] :scale Scale output by this factor
1123
- # @option opts [Boolean] :unlimited Allow SVG of any size
1122
+ # @option opts [Boolean] :memory Force open via memory
1123
+ # @option opts [Vips::Access] :access Required access pattern for this file
1124
+ # @option opts [Boolean] :sequential Sequential read only
1125
+ # @option opts [Boolean] :fail Fail on first error
1126
+ # @option opts [Boolean] :disc Open to disc
1127
+ # @option opts [Vips::ForeignFlags] :flags Output Flags for this file
1128
+ # @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
1129
+
1130
+ # @!method self.jp2kload(filename, **opts)
1131
+ # Load jpeg2000 image.
1132
+ # @param filename [String] Filename to load from
1133
+ # @param opts [Hash] Set of options
1134
+ # @option opts [Integer] :page Load this page from the image
1135
+ # @option opts [Boolean] :memory Force open via memory
1136
+ # @option opts [Vips::Access] :access Required access pattern for this file
1137
+ # @option opts [Boolean] :sequential Sequential read only
1138
+ # @option opts [Boolean] :fail Fail on first error
1139
+ # @option opts [Boolean] :disc Open to disc
1140
+ # @option opts [Vips::ForeignFlags] :flags Output Flags for this file
1141
+ # @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
1142
+
1143
+ # @!method self.jp2kload_buffer(buffer, **opts)
1144
+ # Load jpeg2000 image.
1145
+ # @param buffer [VipsBlob] Buffer to load from
1146
+ # @param opts [Hash] Set of options
1147
+ # @option opts [Integer] :page Load this page from the image
1148
+ # @option opts [Boolean] :memory Force open via memory
1149
+ # @option opts [Vips::Access] :access Required access pattern for this file
1150
+ # @option opts [Boolean] :sequential Sequential read only
1151
+ # @option opts [Boolean] :fail Fail on first error
1152
+ # @option opts [Boolean] :disc Open to disc
1153
+ # @option opts [Vips::ForeignFlags] :flags Output Flags for this file
1154
+ # @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
1155
+
1156
+ # @!method self.jp2kload_source(source, **opts)
1157
+ # Load jpeg2000 image.
1158
+ # @param source [Vips::Source] Source to load from
1159
+ # @param opts [Hash] Set of options
1160
+ # @option opts [Integer] :page Load this page from the image
1124
1161
  # @option opts [Boolean] :memory Force open via memory
1125
1162
  # @option opts [Vips::Access] :access Required access pattern for this file
1126
1163
  # @option opts [Boolean] :sequential Sequential read only
@@ -1130,11 +1167,11 @@ module Vips
1130
1167
  # @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
1131
1168
 
1132
1169
  # @!method self.gifload(filename, **opts)
1133
- # Load gif with giflib.
1170
+ # Load gif with libnsgif.
1134
1171
  # @param filename [String] Filename to load from
1135
1172
  # @param opts [Hash] Set of options
1136
- # @option opts [Integer] :page Load this page from the file
1137
1173
  # @option opts [Integer] :n Load this many pages
1174
+ # @option opts [Integer] :page Load this page from the file
1138
1175
  # @option opts [Boolean] :memory Force open via memory
1139
1176
  # @option opts [Vips::Access] :access Required access pattern for this file
1140
1177
  # @option opts [Boolean] :sequential Sequential read only
@@ -1144,11 +1181,11 @@ module Vips
1144
1181
  # @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
1145
1182
 
1146
1183
  # @!method self.gifload_buffer(buffer, **opts)
1147
- # Load gif with giflib.
1184
+ # Load gif with libnsgif.
1148
1185
  # @param buffer [VipsBlob] Buffer to load from
1149
1186
  # @param opts [Hash] Set of options
1150
- # @option opts [Integer] :page Load this page from the file
1151
1187
  # @option opts [Integer] :n Load this many pages
1188
+ # @option opts [Integer] :page Load this page from the file
1152
1189
  # @option opts [Boolean] :memory Force open via memory
1153
1190
  # @option opts [Vips::Access] :access Required access pattern for this file
1154
1191
  # @option opts [Boolean] :sequential Sequential read only
@@ -1158,11 +1195,11 @@ module Vips
1158
1195
  # @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
1159
1196
 
1160
1197
  # @!method self.gifload_source(source, **opts)
1161
- # Load gif with giflib.
1198
+ # Load gif from source.
1162
1199
  # @param source [Vips::Source] Source to load from
1163
1200
  # @param opts [Hash] Set of options
1164
- # @option opts [Integer] :page Load this page from the file
1165
1201
  # @option opts [Integer] :n Load this many pages
1202
+ # @option opts [Integer] :page Load this page from the file
1166
1203
  # @option opts [Boolean] :memory Force open via memory
1167
1204
  # @option opts [Vips::Access] :access Required access pattern for this file
1168
1205
  # @option opts [Boolean] :sequential Sequential read only
@@ -1357,14 +1394,10 @@ module Vips
1357
1394
  # @option opts [Vips::ForeignFlags] :flags Output Flags for this file
1358
1395
  # @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
1359
1396
 
1360
- # @!method self.openslideload(filename, **opts)
1361
- # Load file with openslide.
1397
+ # @!method self.fitsload(filename, **opts)
1398
+ # Load a fits image.
1362
1399
  # @param filename [String] Filename to load from
1363
1400
  # @param opts [Hash] Set of options
1364
- # @option opts [Boolean] :attach_associated Attach all asssociated images
1365
- # @option opts [Integer] :level Load this level from the file
1366
- # @option opts [Boolean] :autocrop Crop to image bounds
1367
- # @option opts [String] :associated Load this associated image
1368
1401
  # @option opts [Boolean] :memory Force open via memory
1369
1402
  # @option opts [Vips::Access] :access Required access pattern for this file
1370
1403
  # @option opts [Boolean] :sequential Sequential read only
@@ -1373,14 +1406,10 @@ module Vips
1373
1406
  # @option opts [Vips::ForeignFlags] :flags Output Flags for this file
1374
1407
  # @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
1375
1408
 
1376
- # @!method self.magickload(filename, **opts)
1377
- # Load file with imagemagick.
1378
- # @param filename [String] Filename to load from
1409
+ # @!method self.fitsload_source(source, **opts)
1410
+ # Load fits from a source.
1411
+ # @param source [Vips::Source] Source to load from
1379
1412
  # @param opts [Hash] Set of options
1380
- # @option opts [Boolean] :all_frames Read all frames from an image
1381
- # @option opts [String] :density Canvas resolution for rendering vector formats like SVG
1382
- # @option opts [Integer] :page Load this page from the file
1383
- # @option opts [Integer] :n Load this many pages
1384
1413
  # @option opts [Boolean] :memory Force open via memory
1385
1414
  # @option opts [Vips::Access] :access Required access pattern for this file
1386
1415
  # @option opts [Boolean] :sequential Sequential read only
@@ -1389,14 +1418,10 @@ module Vips
1389
1418
  # @option opts [Vips::ForeignFlags] :flags Output Flags for this file
1390
1419
  # @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
1391
1420
 
1392
- # @!method self.magickload_buffer(buffer, **opts)
1393
- # Load buffer with imagemagick.
1394
- # @param buffer [VipsBlob] Buffer to load from
1421
+ # @!method self.openexrload(filename, **opts)
1422
+ # Load an openexr image.
1423
+ # @param filename [String] Filename to load from
1395
1424
  # @param opts [Hash] Set of options
1396
- # @option opts [Boolean] :all_frames Read all frames from an image
1397
- # @option opts [String] :density Canvas resolution for rendering vector formats like SVG
1398
- # @option opts [Integer] :page Load this page from the file
1399
- # @option opts [Integer] :n Load this many pages
1400
1425
  # @option opts [Boolean] :memory Force open via memory
1401
1426
  # @option opts [Vips::Access] :access Required access pattern for this file
1402
1427
  # @option opts [Boolean] :sequential Sequential read only
@@ -1405,8 +1430,8 @@ module Vips
1405
1430
  # @option opts [Vips::ForeignFlags] :flags Output Flags for this file
1406
1431
  # @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
1407
1432
 
1408
- # @!method self.fitsload(filename, **opts)
1409
- # Load a fits image.
1433
+ # @!method self.niftiload(filename, **opts)
1434
+ # Load nifti volume.
1410
1435
  # @param filename [String] Filename to load from
1411
1436
  # @param opts [Hash] Set of options
1412
1437
  # @option opts [Boolean] :memory Force open via memory
@@ -1417,9 +1442,9 @@ module Vips
1417
1442
  # @option opts [Vips::ForeignFlags] :flags Output Flags for this file
1418
1443
  # @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
1419
1444
 
1420
- # @!method self.openexrload(filename, **opts)
1421
- # Load an openexr image.
1422
- # @param filename [String] Filename to load from
1445
+ # @!method self.niftiload_source(source, **opts)
1446
+ # Load nifti volumes.
1447
+ # @param source [Vips::Source] Source to load from
1423
1448
  # @param opts [Hash] Set of options
1424
1449
  # @option opts [Boolean] :memory Force open via memory
1425
1450
  # @option opts [Vips::Access] :access Required access pattern for this file
@@ -1429,10 +1454,30 @@ module Vips
1429
1454
  # @option opts [Vips::ForeignFlags] :flags Output Flags for this file
1430
1455
  # @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
1431
1456
 
1432
- # @!method self.niftiload(filename, **opts)
1433
- # Load a nifti image.
1457
+ # @!method self.openslideload(filename, **opts)
1458
+ # Load file with openslide.
1434
1459
  # @param filename [String] Filename to load from
1435
1460
  # @param opts [Hash] Set of options
1461
+ # @option opts [Boolean] :attach_associated Attach all associated images
1462
+ # @option opts [Integer] :level Load this level from the file
1463
+ # @option opts [Boolean] :autocrop Crop to image bounds
1464
+ # @option opts [String] :associated Load this associated image
1465
+ # @option opts [Boolean] :memory Force open via memory
1466
+ # @option opts [Vips::Access] :access Required access pattern for this file
1467
+ # @option opts [Boolean] :sequential Sequential read only
1468
+ # @option opts [Boolean] :fail Fail on first error
1469
+ # @option opts [Boolean] :disc Open to disc
1470
+ # @option opts [Vips::ForeignFlags] :flags Output Flags for this file
1471
+ # @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
1472
+
1473
+ # @!method self.openslideload_source(source, **opts)
1474
+ # Load source with openslide.
1475
+ # @param source [Vips::Source] Source to load from
1476
+ # @param opts [Hash] Set of options
1477
+ # @option opts [Boolean] :attach_associated Attach all associated images
1478
+ # @option opts [Integer] :level Load this level from the file
1479
+ # @option opts [Boolean] :autocrop Crop to image bounds
1480
+ # @option opts [String] :associated Load this associated image
1436
1481
  # @option opts [Boolean] :memory Force open via memory
1437
1482
  # @option opts [Vips::Access] :access Required access pattern for this file
1438
1483
  # @option opts [Boolean] :sequential Sequential read only
@@ -1489,6 +1534,89 @@ module Vips
1489
1534
  # @option opts [Vips::ForeignFlags] :flags Output Flags for this file
1490
1535
  # @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
1491
1536
 
1537
+ # @!method self.pdfload(filename, **opts)
1538
+ # Load pdf from file.
1539
+ # @param filename [String] Filename to load from
1540
+ # @param opts [Hash] Set of options
1541
+ # @option opts [Integer] :page Load this page from the file
1542
+ # @option opts [Integer] :n Load this many pages
1543
+ # @option opts [Float] :dpi Render at this DPI
1544
+ # @option opts [Float] :scale Scale output by this factor
1545
+ # @option opts [Array<Double>] :background Background value
1546
+ # @option opts [Boolean] :memory Force open via memory
1547
+ # @option opts [Vips::Access] :access Required access pattern for this file
1548
+ # @option opts [Boolean] :sequential Sequential read only
1549
+ # @option opts [Boolean] :fail Fail on first error
1550
+ # @option opts [Boolean] :disc Open to disc
1551
+ # @option opts [Vips::ForeignFlags] :flags Output Flags for this file
1552
+ # @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
1553
+
1554
+ # @!method self.pdfload_buffer(buffer, **opts)
1555
+ # Load pdf from buffer.
1556
+ # @param buffer [VipsBlob] Buffer to load from
1557
+ # @param opts [Hash] Set of options
1558
+ # @option opts [Integer] :page Load this page from the file
1559
+ # @option opts [Integer] :n Load this many pages
1560
+ # @option opts [Float] :dpi Render at this DPI
1561
+ # @option opts [Float] :scale Scale output by this factor
1562
+ # @option opts [Array<Double>] :background Background value
1563
+ # @option opts [Boolean] :memory Force open via memory
1564
+ # @option opts [Vips::Access] :access Required access pattern for this file
1565
+ # @option opts [Boolean] :sequential Sequential read only
1566
+ # @option opts [Boolean] :fail Fail on first error
1567
+ # @option opts [Boolean] :disc Open to disc
1568
+ # @option opts [Vips::ForeignFlags] :flags Output Flags for this file
1569
+ # @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
1570
+
1571
+ # @!method self.pdfload_source(source, **opts)
1572
+ # Load pdf from source.
1573
+ # @param source [Vips::Source] Source to load from
1574
+ # @param opts [Hash] Set of options
1575
+ # @option opts [Integer] :page Load this page from the file
1576
+ # @option opts [Integer] :n Load this many pages
1577
+ # @option opts [Float] :dpi Render at this DPI
1578
+ # @option opts [Float] :scale Scale output by this factor
1579
+ # @option opts [Array<Double>] :background Background value
1580
+ # @option opts [Boolean] :memory Force open via memory
1581
+ # @option opts [Vips::Access] :access Required access pattern for this file
1582
+ # @option opts [Boolean] :sequential Sequential read only
1583
+ # @option opts [Boolean] :fail Fail on first error
1584
+ # @option opts [Boolean] :disc Open to disc
1585
+ # @option opts [Vips::ForeignFlags] :flags Output Flags for this file
1586
+ # @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
1587
+
1588
+ # @!method self.magickload(filename, **opts)
1589
+ # Load file with imagemagick.
1590
+ # @param filename [String] Filename to load from
1591
+ # @param opts [Hash] Set of options
1592
+ # @option opts [Boolean] :all_frames Read all frames from an image
1593
+ # @option opts [String] :density Canvas resolution for rendering vector formats like SVG
1594
+ # @option opts [Integer] :page Load this page from the file
1595
+ # @option opts [Integer] :n Load this many pages
1596
+ # @option opts [Boolean] :memory Force open via memory
1597
+ # @option opts [Vips::Access] :access Required access pattern for this file
1598
+ # @option opts [Boolean] :sequential Sequential read only
1599
+ # @option opts [Boolean] :fail Fail on first error
1600
+ # @option opts [Boolean] :disc Open to disc
1601
+ # @option opts [Vips::ForeignFlags] :flags Output Flags for this file
1602
+ # @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
1603
+
1604
+ # @!method self.magickload_buffer(buffer, **opts)
1605
+ # Load buffer with imagemagick.
1606
+ # @param buffer [VipsBlob] Buffer to load from
1607
+ # @param opts [Hash] Set of options
1608
+ # @option opts [Boolean] :all_frames Read all frames from an image
1609
+ # @option opts [String] :density Canvas resolution for rendering vector formats like SVG
1610
+ # @option opts [Integer] :page Load this page from the file
1611
+ # @option opts [Integer] :n Load this many pages
1612
+ # @option opts [Boolean] :memory Force open via memory
1613
+ # @option opts [Vips::Access] :access Required access pattern for this file
1614
+ # @option opts [Boolean] :sequential Sequential read only
1615
+ # @option opts [Boolean] :fail Fail on first error
1616
+ # @option opts [Boolean] :disc Open to disc
1617
+ # @option opts [Vips::ForeignFlags] :flags Output Flags for this file
1618
+ # @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
1619
+
1492
1620
  # @!method csvsave(filename, **opts)
1493
1621
  # Save image to csv.
1494
1622
  # @param filename [String] Filename to save to
@@ -1554,7 +1682,7 @@ module Vips
1554
1682
  # @return [nil]
1555
1683
 
1556
1684
  # @!method vipssave(filename, **opts)
1557
- # Save image to vips file.
1685
+ # Save image to file in vips format.
1558
1686
  # @param filename [String] Filename to save to
1559
1687
  # @param opts [Hash] Set of options
1560
1688
  # @option opts [Boolean] :strip Strip all metadata from image
@@ -1562,6 +1690,15 @@ module Vips
1562
1690
  # @option opts [Integer] :page_height Set page height for multipage save
1563
1691
  # @return [nil]
1564
1692
 
1693
+ # @!method vipssave_target(target, **opts)
1694
+ # Save image to target in vips format.
1695
+ # @param target [Vips::Target] Target to save to
1696
+ # @param opts [Hash] Set of options
1697
+ # @option opts [Boolean] :strip Strip all metadata from image
1698
+ # @option opts [Array<Double>] :background Background value
1699
+ # @option opts [Integer] :page_height Set page height for multipage save
1700
+ # @return [nil]
1701
+
1565
1702
  # @!method ppmsave(filename, **opts)
1566
1703
  # Save image to ppm file.
1567
1704
  # @param filename [String] Filename to save to
@@ -1612,6 +1749,88 @@ module Vips
1612
1749
  # @option opts [Integer] :page_height Set page height for multipage save
1613
1750
  # @return [nil]
1614
1751
 
1752
+ # @!method jxlsave(filename, **opts)
1753
+ # Save image in jpeg-xl format.
1754
+ # @param filename [String] Filename to load from
1755
+ # @param opts [Hash] Set of options
1756
+ # @option opts [Integer] :tier Decode speed tier
1757
+ # @option opts [Float] :distance Target butteraugli distance
1758
+ # @option opts [Integer] :effort Encoding effort
1759
+ # @option opts [Boolean] :lossless Enable lossless compression
1760
+ # @option opts [Integer] :Q Quality factor
1761
+ # @option opts [Boolean] :strip Strip all metadata from image
1762
+ # @option opts [Array<Double>] :background Background value
1763
+ # @option opts [Integer] :page_height Set page height for multipage save
1764
+ # @return [nil]
1765
+
1766
+ # @!method jxlsave_buffer(**opts)
1767
+ # Save image in jpeg-xl format.
1768
+ # @param opts [Hash] Set of options
1769
+ # @option opts [Integer] :tier Decode speed tier
1770
+ # @option opts [Float] :distance Target butteraugli distance
1771
+ # @option opts [Integer] :effort Encoding effort
1772
+ # @option opts [Boolean] :lossless Enable lossless compression
1773
+ # @option opts [Integer] :Q Quality factor
1774
+ # @option opts [Boolean] :strip Strip all metadata from image
1775
+ # @option opts [Array<Double>] :background Background value
1776
+ # @option opts [Integer] :page_height Set page height for multipage save
1777
+ # @return [VipsBlob] Buffer to save to
1778
+
1779
+ # @!method jxlsave_target(target, **opts)
1780
+ # Save image in jpeg-xl format.
1781
+ # @param target [Vips::Target] Target to save to
1782
+ # @param opts [Hash] Set of options
1783
+ # @option opts [Integer] :tier Decode speed tier
1784
+ # @option opts [Float] :distance Target butteraugli distance
1785
+ # @option opts [Integer] :effort Encoding effort
1786
+ # @option opts [Boolean] :lossless Enable lossless compression
1787
+ # @option opts [Integer] :Q Quality factor
1788
+ # @option opts [Boolean] :strip Strip all metadata from image
1789
+ # @option opts [Array<Double>] :background Background value
1790
+ # @option opts [Integer] :page_height Set page height for multipage save
1791
+ # @return [nil]
1792
+
1793
+ # @!method jp2ksave(filename, **opts)
1794
+ # Save image in jpeg2000 format.
1795
+ # @param filename [String] Filename to load from
1796
+ # @param opts [Hash] Set of options
1797
+ # @option opts [Integer] :tile_width Tile width in pixels
1798
+ # @option opts [Integer] :tile_height Tile height in pixels
1799
+ # @option opts [Boolean] :lossless Enable lossless compression
1800
+ # @option opts [Integer] :Q Q factor
1801
+ # @option opts [Vips::ForeignSubsample] :subsample_mode Select chroma subsample operation mode
1802
+ # @option opts [Boolean] :strip Strip all metadata from image
1803
+ # @option opts [Array<Double>] :background Background value
1804
+ # @option opts [Integer] :page_height Set page height for multipage save
1805
+ # @return [nil]
1806
+
1807
+ # @!method jp2ksave_buffer(**opts)
1808
+ # Save image in jpeg2000 format.
1809
+ # @param opts [Hash] Set of options
1810
+ # @option opts [Integer] :tile_width Tile width in pixels
1811
+ # @option opts [Integer] :tile_height Tile height in pixels
1812
+ # @option opts [Boolean] :lossless Enable lossless compression
1813
+ # @option opts [Integer] :Q Q factor
1814
+ # @option opts [Vips::ForeignSubsample] :subsample_mode Select chroma subsample operation mode
1815
+ # @option opts [Boolean] :strip Strip all metadata from image
1816
+ # @option opts [Array<Double>] :background Background value
1817
+ # @option opts [Integer] :page_height Set page height for multipage save
1818
+ # @return [VipsBlob] Buffer to save to
1819
+
1820
+ # @!method jp2ksave_target(target, **opts)
1821
+ # Save image in jpeg2000 format.
1822
+ # @param target [Vips::Target] Target to save to
1823
+ # @param opts [Hash] Set of options
1824
+ # @option opts [Integer] :tile_width Tile width in pixels
1825
+ # @option opts [Integer] :tile_height Tile height in pixels
1826
+ # @option opts [Boolean] :lossless Enable lossless compression
1827
+ # @option opts [Integer] :Q Q factor
1828
+ # @option opts [Vips::ForeignSubsample] :subsample_mode Select chroma subsample operation mode
1829
+ # @option opts [Boolean] :strip Strip all metadata from image
1830
+ # @option opts [Array<Double>] :background Background value
1831
+ # @option opts [Integer] :page_height Set page height for multipage save
1832
+ # @return [nil]
1833
+
1615
1834
  # @!method dzsave(filename, **opts)
1616
1835
  # Save image to deepzoom file.
1617
1836
  # @param filename [String] Filename to save to
@@ -1731,7 +1950,7 @@ module Vips
1731
1950
  # @option opts [Boolean] :overshoot_deringing Apply overshooting to samples with extreme values
1732
1951
  # @option opts [Boolean] :optimize_scans Split spectrum of DCT coefficients into separate scans
1733
1952
  # @option opts [Integer] :quant_table Use predefined quantization table with given index
1734
- # @option opts [Vips::ForeignJpegSubsample] :subsample_mode Select chroma subsample operation mode
1953
+ # @option opts [Vips::ForeignSubsample] :subsample_mode Select chroma subsample operation mode
1735
1954
  # @option opts [Boolean] :strip Strip all metadata from image
1736
1955
  # @option opts [Array<Double>] :background Background value
1737
1956
  # @option opts [Integer] :page_height Set page height for multipage save
@@ -1749,7 +1968,7 @@ module Vips
1749
1968
  # @option opts [Boolean] :overshoot_deringing Apply overshooting to samples with extreme values
1750
1969
  # @option opts [Boolean] :optimize_scans Split spectrum of DCT coefficients into separate scans
1751
1970
  # @option opts [Integer] :quant_table Use predefined quantization table with given index
1752
- # @option opts [Vips::ForeignJpegSubsample] :subsample_mode Select chroma subsample operation mode
1971
+ # @option opts [Vips::ForeignSubsample] :subsample_mode Select chroma subsample operation mode
1753
1972
  # @option opts [Boolean] :strip Strip all metadata from image
1754
1973
  # @option opts [Array<Double>] :background Background value
1755
1974
  # @option opts [Integer] :page_height Set page height for multipage save
@@ -1768,7 +1987,7 @@ module Vips
1768
1987
  # @option opts [Boolean] :overshoot_deringing Apply overshooting to samples with extreme values
1769
1988
  # @option opts [Boolean] :optimize_scans Split spectrum of DCT coefficients into separate scans
1770
1989
  # @option opts [Integer] :quant_table Use predefined quantization table with given index
1771
- # @option opts [Vips::ForeignJpegSubsample] :subsample_mode Select chroma subsample operation mode
1990
+ # @option opts [Vips::ForeignSubsample] :subsample_mode Select chroma subsample operation mode
1772
1991
  # @option opts [Boolean] :strip Strip all metadata from image
1773
1992
  # @option opts [Array<Double>] :background Background value
1774
1993
  # @option opts [Integer] :page_height Set page height for multipage save
@@ -1786,7 +2005,7 @@ module Vips
1786
2005
  # @option opts [Boolean] :overshoot_deringing Apply overshooting to samples with extreme values
1787
2006
  # @option opts [Boolean] :optimize_scans Split spectrum of DCT coefficients into separate scans
1788
2007
  # @option opts [Integer] :quant_table Use predefined quantization table with given index
1789
- # @option opts [Vips::ForeignJpegSubsample] :subsample_mode Select chroma subsample operation mode
2008
+ # @option opts [Vips::ForeignSubsample] :subsample_mode Select chroma subsample operation mode
1790
2009
  # @option opts [Boolean] :strip Strip all metadata from image
1791
2010
  # @option opts [Array<Double>] :background Background value
1792
2011
  # @option opts [Integer] :page_height Set page height for multipage save
@@ -1874,9 +2093,10 @@ module Vips
1874
2093
  # @option opts [Boolean] :properties Write a properties document to IMAGEDESCRIPTION
1875
2094
  # @option opts [Vips::RegionShrink] :region_shrink Method to shrink regions
1876
2095
  # @option opts [Integer] :level ZSTD compression level
1877
- # @option opts [Boolean] :subifd Save pyr layers as sub-IFDs
1878
2096
  # @option opts [Boolean] :lossless Enable WEBP lossless mode
1879
2097
  # @option opts [Vips::ForeignDzDepth] :depth Pyramid depth
2098
+ # @option opts [Boolean] :subifd Save pyr layers as sub-IFDs
2099
+ # @option opts [Boolean] :premultiply Save with premultiplied alpha
1880
2100
  # @option opts [Boolean] :strip Strip all metadata from image
1881
2101
  # @option opts [Array<Double>] :background Background value
1882
2102
  # @option opts [Integer] :page_height Set page height for multipage save
@@ -1904,34 +2124,10 @@ module Vips
1904
2124
  # @option opts [Boolean] :properties Write a properties document to IMAGEDESCRIPTION
1905
2125
  # @option opts [Vips::RegionShrink] :region_shrink Method to shrink regions
1906
2126
  # @option opts [Integer] :level ZSTD compression level
1907
- # @option opts [Boolean] :subifd Save pyr layers as sub-IFDs
1908
2127
  # @option opts [Boolean] :lossless Enable WEBP lossless mode
1909
2128
  # @option opts [Vips::ForeignDzDepth] :depth Pyramid depth
1910
- # @option opts [Boolean] :strip Strip all metadata from image
1911
- # @option opts [Array<Double>] :background Background value
1912
- # @option opts [Integer] :page_height Set page height for multipage save
1913
- # @return [VipsBlob] Buffer to save to
1914
-
1915
- # @!method magicksave(filename, **opts)
1916
- # Save file with imagemagick.
1917
- # @param filename [String] Filename to save to
1918
- # @param opts [Hash] Set of options
1919
- # @option opts [String] :format Format to save in
1920
- # @option opts [Integer] :quality Quality to use
1921
- # @option opts [Boolean] :optimize_gif_frames Apply GIF frames optimization
1922
- # @option opts [Boolean] :optimize_gif_transparency Apply GIF transparency optimization
1923
- # @option opts [Boolean] :strip Strip all metadata from image
1924
- # @option opts [Array<Double>] :background Background value
1925
- # @option opts [Integer] :page_height Set page height for multipage save
1926
- # @return [nil]
1927
-
1928
- # @!method magicksave_buffer(**opts)
1929
- # Save image to magick buffer.
1930
- # @param opts [Hash] Set of options
1931
- # @option opts [String] :format Format to save in
1932
- # @option opts [Integer] :quality Quality to use
1933
- # @option opts [Boolean] :optimize_gif_frames Apply GIF frames optimization
1934
- # @option opts [Boolean] :optimize_gif_transparency Apply GIF transparency optimization
2129
+ # @option opts [Boolean] :subifd Save pyr layers as sub-IFDs
2130
+ # @option opts [Boolean] :premultiply Save with premultiplied alpha
1935
2131
  # @option opts [Boolean] :strip Strip all metadata from image
1936
2132
  # @option opts [Array<Double>] :background Background value
1937
2133
  # @option opts [Integer] :page_height Set page height for multipage save
@@ -1957,12 +2153,13 @@ module Vips
1957
2153
 
1958
2154
  # @!method heifsave(filename, **opts)
1959
2155
  # Save image in heif format.
1960
- # @param filename [String] Filename to load from
2156
+ # @param filename [String] Filename to save to
1961
2157
  # @param opts [Hash] Set of options
1962
2158
  # @option opts [Integer] :Q Q factor
1963
2159
  # @option opts [Boolean] :lossless Enable lossless compression
1964
2160
  # @option opts [Vips::ForeignHeifCompression] :compression Compression format
1965
2161
  # @option opts [Integer] :speed CPU effort
2162
+ # @option opts [Vips::ForeignSubsample] :subsample_mode Select chroma subsample operation mode
1966
2163
  # @option opts [Boolean] :strip Strip all metadata from image
1967
2164
  # @option opts [Array<Double>] :background Background value
1968
2165
  # @option opts [Integer] :page_height Set page height for multipage save
@@ -1975,6 +2172,7 @@ module Vips
1975
2172
  # @option opts [Boolean] :lossless Enable lossless compression
1976
2173
  # @option opts [Vips::ForeignHeifCompression] :compression Compression format
1977
2174
  # @option opts [Integer] :speed CPU effort
2175
+ # @option opts [Vips::ForeignSubsample] :subsample_mode Select chroma subsample operation mode
1978
2176
  # @option opts [Boolean] :strip Strip all metadata from image
1979
2177
  # @option opts [Array<Double>] :background Background value
1980
2178
  # @option opts [Integer] :page_height Set page height for multipage save
@@ -1988,11 +2186,37 @@ module Vips
1988
2186
  # @option opts [Boolean] :lossless Enable lossless compression
1989
2187
  # @option opts [Vips::ForeignHeifCompression] :compression Compression format
1990
2188
  # @option opts [Integer] :speed CPU effort
2189
+ # @option opts [Vips::ForeignSubsample] :subsample_mode Select chroma subsample operation mode
2190
+ # @option opts [Boolean] :strip Strip all metadata from image
2191
+ # @option opts [Array<Double>] :background Background value
2192
+ # @option opts [Integer] :page_height Set page height for multipage save
2193
+ # @return [nil]
2194
+
2195
+ # @!method magicksave(filename, **opts)
2196
+ # Save file with imagemagick.
2197
+ # @param filename [String] Filename to save to
2198
+ # @param opts [Hash] Set of options
2199
+ # @option opts [String] :format Format to save in
2200
+ # @option opts [Integer] :quality Quality to use
2201
+ # @option opts [Boolean] :optimize_gif_frames Apply GIF frames optimization
2202
+ # @option opts [Boolean] :optimize_gif_transparency Apply GIF transparency optimization
1991
2203
  # @option opts [Boolean] :strip Strip all metadata from image
1992
2204
  # @option opts [Array<Double>] :background Background value
1993
2205
  # @option opts [Integer] :page_height Set page height for multipage save
1994
2206
  # @return [nil]
1995
2207
 
2208
+ # @!method magicksave_buffer(**opts)
2209
+ # Save image to magick buffer.
2210
+ # @param opts [Hash] Set of options
2211
+ # @option opts [String] :format Format to save in
2212
+ # @option opts [Integer] :quality Quality to use
2213
+ # @option opts [Boolean] :optimize_gif_frames Apply GIF frames optimization
2214
+ # @option opts [Boolean] :optimize_gif_transparency Apply GIF transparency optimization
2215
+ # @option opts [Boolean] :strip Strip all metadata from image
2216
+ # @option opts [Array<Double>] :background Background value
2217
+ # @option opts [Integer] :page_height Set page height for multipage save
2218
+ # @return [VipsBlob] Buffer to save to
2219
+
1996
2220
  # @!method self.thumbnail(filename, width, **opts)
1997
2221
  # Generate thumbnail from file.
1998
2222
  # @param filename [String] Filename to read from
@@ -2295,6 +2519,7 @@ module Vips
2295
2519
  # @param opts [Hash] Set of options
2296
2520
  # @option opts [Vips::PCS] :pcs Set Profile Connection Space
2297
2521
  # @option opts [Vips::Intent] :intent Rendering intent
2522
+ # @option opts [Boolean] :black_point_compensation Enable black point compensation
2298
2523
  # @option opts [Boolean] :embedded Use embedded input profile, if available
2299
2524
  # @option opts [String] :input_profile Filename to load input profile from
2300
2525
  # @return [Vips::Image] Output image
@@ -2304,6 +2529,7 @@ module Vips
2304
2529
  # @param opts [Hash] Set of options
2305
2530
  # @option opts [Vips::PCS] :pcs Set Profile Connection Space
2306
2531
  # @option opts [Vips::Intent] :intent Rendering intent
2532
+ # @option opts [Boolean] :black_point_compensation Enable black point compensation
2307
2533
  # @option opts [String] :output_profile Filename to load output profile from
2308
2534
  # @option opts [Integer] :depth Output device space depth in bits
2309
2535
  # @return [Vips::Image] Output image
@@ -2314,6 +2540,7 @@ module Vips
2314
2540
  # @param opts [Hash] Set of options
2315
2541
  # @option opts [Vips::PCS] :pcs Set Profile Connection Space
2316
2542
  # @option opts [Vips::Intent] :intent Rendering intent
2543
+ # @option opts [Boolean] :black_point_compensation Enable black point compensation
2317
2544
  # @option opts [Boolean] :embedded Use embedded input profile, if available
2318
2545
  # @option opts [String] :input_profile Filename to load input profile from
2319
2546
  # @option opts [Integer] :depth Output device space depth in bits
@@ -53,8 +53,9 @@ module Vips
53
53
  # it's the thing we return at the end of the mutate block.
54
54
  copy_image = image.copy
55
55
 
56
- # use ptr since we need the raw unwrapped pointer inside the image ...
57
- # and make the ref that gobject will unref when it finishes
56
+ # Use ptr since we need the raw unwrapped pointer inside the image ...
57
+ # and make the ref that gobject will unref when it finishes.
58
+ # See also the comment on set_type! before changing this.
58
59
  pointer = copy_image.ptr
59
60
  ::GObject.g_object_ref pointer
60
61
  super pointer
@@ -79,7 +80,7 @@ module Vips
79
80
  end
80
81
 
81
82
  def respond_to_missing? name, include_all = false
82
- # respond to all vips operations by nickname
83
+ # Respond to all vips operations by nickname.
83
84
  return true if Vips.type_find("VipsOperation", name.to_s) != 0
84
85
 
85
86
  super
@@ -115,7 +116,21 @@ module Vips
115
116
  gvalue = GObject::GValue.alloc
116
117
  gvalue.init gtype
117
118
  gvalue.set value
118
- Vips.vips_image_set self, name, gvalue
119
+
120
+ # libvips 8.9.1 had a terrible misfeature which would block metadata
121
+ # modification unless the object had a ref_count of 1. MutableImage
122
+ # will always have a ref_count of at least 2 (the parent gobject keeps a
123
+ # ref, and we keep a ref to the copy ready to return to our caller),
124
+ # so we must temporarily drop the refs to 1 around metadata changes.
125
+ #
126
+ # See https://github.com/libvips/ruby-vips/issues/291
127
+ begin
128
+ ::GObject.g_object_unref ptr
129
+ Vips.vips_image_set self, name, gvalue
130
+ ensure
131
+ ::GObject.g_object_ref ptr
132
+ end
133
+
119
134
  gvalue.unset
120
135
  end
121
136
 
@@ -148,7 +163,11 @@ module Vips
148
163
  #
149
164
  # @param name [String] Metadata field to remove
150
165
  def remove! name
166
+ # See set_type! for an explanation. Image#remove can't throw an
167
+ # exception, so there's no need to ensure we unref.
168
+ ::GObject.g_object_unref ptr
151
169
  Vips.vips_image_remove self, name
170
+ ::GObject.g_object_ref ptr
152
171
  end
153
172
  end
154
173
  end
data/lib/vips/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Vips
2
- VERSION = "2.1.0"
2
+ VERSION = "2.1.1"
3
3
  end
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.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Cupitt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-08 00:00:00.000000000 Z
11
+ date: 2021-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi