@img/sharp-libvips-dev 1.1.0-rc2 → 1.1.0-rc3

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.
@@ -52,6 +52,8 @@ extern "C" {
52
52
  // 1.14 3 5 1 1 1 1
53
53
  // 1.15 4 5 1 1 1 1
54
54
  // 1.16 5 6 1 1 1 1
55
+ // 1.18 5 7 1 1 1 1
56
+ // 1.19 6 7 2 1 1 1
55
57
 
56
58
  #if defined(_MSC_VER) && !defined(LIBHEIF_STATIC_BUILD)
57
59
  #ifdef LIBHEIF_EXPORTS
@@ -133,7 +135,10 @@ enum heif_error_code
133
135
  heif_error_Color_profile_does_not_exist = 10,
134
136
 
135
137
  // Error loading a dynamic plugin
136
- heif_error_Plugin_loading_error = 11
138
+ heif_error_Plugin_loading_error = 11,
139
+
140
+ // Operation has been canceled
141
+ heif_error_Canceled = 12
137
142
  };
138
143
 
139
144
 
@@ -244,6 +249,11 @@ enum heif_suberror_code
244
249
  // icbr is only needed in some situations, this error is for those cases
245
250
  heif_suberror_No_icbr_box = 142,
246
251
 
252
+ heif_suberror_No_avcC_box = 143,
253
+
254
+ // we got a mini box, but could not read it properly
255
+ heif_suberror_Invalid_mini_box = 149,
256
+
247
257
  // Decompressing generic compression or header compression data failed (e.g. bitstream corruption)
248
258
  heif_suberror_Decompression_invalid_data = 150,
249
259
 
@@ -308,6 +318,8 @@ enum heif_suberror_code
308
318
  // Generically compressed data used an unsupported compression method
309
319
  heif_suberror_Unsupported_generic_compression_method = 3006,
310
320
 
321
+ heif_suberror_Unsupported_essential_property = 3007,
322
+
311
323
  // --- Encoder_plugin_error ---
312
324
 
313
325
  heif_suberror_Unsupported_bit_depth = 4000,
@@ -398,7 +410,7 @@ enum heif_compression_format
398
410
  */
399
411
  heif_compression_AV1 = 4,
400
412
  /**
401
- * VVC compression. (Currently unused in libheif.)
413
+ * VVC compression.
402
414
  *
403
415
  * The compression format is defined in ISO/IEC 23090-3. This is equivalent to H.266.
404
416
  *
@@ -408,7 +420,7 @@ enum heif_compression_format
408
420
  /**
409
421
  * EVC compression. (Currently unused in libheif.)
410
422
  *
411
- * The compression format is defined in ISO/IEC 23094-1. This is equivalent to H.266.
423
+ * The compression format is defined in ISO/IEC 23094-1.
412
424
  *
413
425
  * The encapsulation is defined in ISO/IEC 23008-12:2022 Annex M.
414
426
  */
@@ -423,7 +435,7 @@ enum heif_compression_format
423
435
  /**
424
436
  * Uncompressed encoding.
425
437
  *
426
- * This is defined in ISO/IEC 23001-17:2023 (Final Draft International Standard).
438
+ * This is defined in ISO/IEC 23001-17:2024.
427
439
  */
428
440
  heif_compression_uncompressed = 8,
429
441
  /**
@@ -482,7 +494,10 @@ enum heif_colorspace
482
494
  heif_colorspace_RGB = 1,
483
495
 
484
496
  // heif_colorspace_monochrome should only be used with heif_chroma = heif_chroma_monochrome
485
- heif_colorspace_monochrome = 2
497
+ heif_colorspace_monochrome = 2,
498
+
499
+ // Indicates that this image has no visual channels.
500
+ heif_colorspace_nonvisual = 3
486
501
  };
487
502
 
488
503
  enum heif_channel
@@ -494,9 +509,21 @@ enum heif_channel
494
509
  heif_channel_G = 4,
495
510
  heif_channel_B = 5,
496
511
  heif_channel_Alpha = 6,
497
- heif_channel_interleaved = 10
512
+ heif_channel_interleaved = 10,
513
+ heif_channel_filter_array = 11,
514
+ heif_channel_depth = 12,
515
+ heif_channel_disparity = 13
498
516
  };
499
517
 
518
+ enum heif_metadata_compression
519
+ {
520
+ heif_metadata_compression_off = 0,
521
+ heif_metadata_compression_auto = 1,
522
+ heif_metadata_compression_unknown = 2, // only used when reading unknown method from input file
523
+ heif_metadata_compression_deflate = 3,
524
+ heif_metadata_compression_zlib = 4, // do not use for header data
525
+ heif_metadata_compression_brotli = 5
526
+ };
500
527
 
501
528
  // ========================= library initialization ======================
502
529
 
@@ -536,6 +563,10 @@ struct heif_error heif_init(struct heif_init_params*);
536
563
  * You should call heif_init() when you start using libheif and heif_deinit() when you are finished.
537
564
  * These calls are reference counted. Each call to heif_init() should be matched by one call to heif_deinit().
538
565
  *
566
+ * Note: heif_deinit() must not be called after exit(), for example in a global C++ object's destructor.
567
+ * If you do, global variables in libheif might have already been released when heif_deinit() is running,
568
+ * leading to a crash.
569
+ *
539
570
  * \sa heif_init()
540
571
  */
541
572
  LIBHEIF_API
@@ -749,6 +780,13 @@ typedef uint32_t heif_brand2;
749
780
  */
750
781
  #define heif_brand2_mif2 heif_fourcc('m','i','f','2')
751
782
 
783
+ /**
784
+ * HEIF image structural brand (`mif3`).
785
+ *
786
+ * This indicates the low-overhead (ftyp+mini) structure.
787
+ */
788
+ #define heif_brand2_mif3 heif_fourcc('m','i','f','3')
789
+
752
790
  /**
753
791
  * HEIF image sequence structural brand (`msf1`).
754
792
  *
@@ -850,6 +888,10 @@ typedef uint32_t heif_brand2;
850
888
  LIBHEIF_API
851
889
  heif_brand2 heif_read_main_brand(const uint8_t* data, int len);
852
890
 
891
+ // input data should be at least 16 bytes
892
+ LIBHEIF_API
893
+ heif_brand2 heif_read_minor_version_brand(const uint8_t* data, int len);
894
+
853
895
  // 'brand_fourcc' must be 4 character long, but need not be 0-terminated
854
896
  LIBHEIF_API
855
897
  heif_brand2 heif_fourcc_to_brand(const char* brand_fourcc);
@@ -912,15 +954,33 @@ LIBHEIF_API
912
954
  void heif_context_free(struct heif_context*);
913
955
 
914
956
 
957
+
915
958
  struct heif_reading_options;
916
959
 
917
960
  enum heif_reader_grow_status
918
961
  {
919
- heif_reader_grow_status_size_reached, // requested size has been reached, we can read until this point
920
- heif_reader_grow_status_timeout, // size has not been reached yet, but it may still grow further
921
- heif_reader_grow_status_size_beyond_eof // size has not been reached and never will. The file has grown to its full size
962
+ heif_reader_grow_status_size_reached, // requested size has been reached, we can read until this point
963
+ heif_reader_grow_status_timeout, // size has not been reached yet, but it may still grow further (deprecated)
964
+ heif_reader_grow_status_size_beyond_eof, // size has not been reached and never will. The file has grown to its full size
965
+ heif_reader_grow_status_error // an error has occurred
922
966
  };
923
967
 
968
+ struct heif_reader_range_request_result
969
+ {
970
+ enum heif_reader_grow_status status; // should not return 'heif_reader_grow_status_timeout'
971
+
972
+ // Indicates up to what position the file has been read.
973
+ // If we cannot read the whole file range (status == 'heif_reader_grow_status_size_beyond_eof'), this is the actual end position.
974
+ // On the other hand, it may be that the reader was reading more data than requested. In that case, it should indicate the full size here
975
+ // and libheif may decide to make use of the additional data (e.g. for filling 'tili' offset tables).
976
+ uint64_t range_end;
977
+
978
+ // for status == 'heif_reader_grow_status_error'
979
+ int reader_error_code; // a reader specific error code
980
+ const char* reader_error_msg; // libheif will call heif_reader.release_error_msg on this if it is not NULL
981
+ };
982
+
983
+
924
984
  struct heif_reader
925
985
  {
926
986
  // API version supported by this reader
@@ -929,7 +989,7 @@ struct heif_reader
929
989
  // --- version 1 functions ---
930
990
  int64_t (* get_position)(void* userdata);
931
991
 
932
- // The functions read(), and seek() return heif_error_ok on success.
992
+ // The functions read(), and seek() return 0 on success.
933
993
  // Generally, libheif will make sure that we do not read past the file size.
934
994
  int (* read)(void* data,
935
995
  size_t size,
@@ -947,6 +1007,47 @@ struct heif_reader
947
1007
  // detection whether the target_size is above the (fixed) file length
948
1008
  // (in this case, return 'size_beyond_eof').
949
1009
  enum heif_reader_grow_status (* wait_for_file_size)(int64_t target_size, void* userdata);
1010
+
1011
+ // --- version 2 functions ---
1012
+
1013
+ // These two functions are for applications that want to stream HEIF files on demand.
1014
+ // For example, a large HEIF file that is served over HTTPS and we only want to download
1015
+ // it partially to decode individual tiles.
1016
+ // If you do not have this use case, you do not have to implement these functions and
1017
+ // you can set them to NULL. For simple linear loading, you may use the 'wait_for_file_size'
1018
+ // function above instead.
1019
+
1020
+ // If this function is defined, libheif will often request a file range before accessing it.
1021
+ // The purpose of this function is that libheif will usually read very small chunks of data with the
1022
+ // read() callback above. However, it is inefficient to request such a small chunk of data over a network
1023
+ // and the network delay will significantly increase the decoding time.
1024
+ // Thus, libheif will call request_range() with a larger block of data that should be preloaded and the
1025
+ // subsequent read() calls will work within the requested ranges.
1026
+ //
1027
+ // Note: `end_pos` is one byte after the last position to be read.
1028
+ // You should return
1029
+ // - 'heif_reader_grow_status_size_reached' if the requested range is available, or
1030
+ // - 'heif_reader_grow_status_size_beyond_eof' if the requested range exceeds the file size
1031
+ // (the valid part of the range has been read).
1032
+ struct heif_reader_range_request_result (*request_range)(uint64_t start_pos, uint64_t end_pos, void* userdata);
1033
+
1034
+ // libheif might issue hints when it assumes that a file range might be needed in the future.
1035
+ // This may happen, for example, when your are doing selective tile accesses and libheif proposes
1036
+ // to preload offset pointer tables.
1037
+ // Another difference to request_file_range() is that this call should be non-blocking.
1038
+ // If you preload any data, do this in a background thread.
1039
+ void (*preload_range_hint)(uint64_t start_pos, uint64_t end_pos, void* userdata);
1040
+
1041
+ // If libheif does not need access to a file range anymore, it may call this function to
1042
+ // give a hint to the reader that it may release the range from a cache.
1043
+ // If you do not maintain a file cache that wants to reduce its size dynamically, you do not
1044
+ // need to implement this function.
1045
+ void (*release_file_range)(uint64_t start_pos, uint64_t end_pos, void* userdata);
1046
+
1047
+ // Release an error message that was returned by heif_reader in an earlier call.
1048
+ // If this function is NULL, the error message string will not be released.
1049
+ // This is a viable option if you are only returning static strings.
1050
+ void (*release_error_msg)(const char* msg);
950
1051
  };
951
1052
 
952
1053
 
@@ -1015,6 +1116,9 @@ LIBHEIF_API
1015
1116
  void heif_context_debug_dump_boxes_to_file(struct heif_context* ctx, int fd);
1016
1117
 
1017
1118
 
1119
+ // Set the maximum image size security limit. This function will set the maximum image area (number of pixels)
1120
+ // to maximum_width ^ 2. Alternatively to using this function, you can also set the maximum image area
1121
+ // in the security limits structure returned by heif_context_get_security_limits().
1018
1122
  LIBHEIF_API
1019
1123
  void heif_context_set_maximum_image_size_limit(struct heif_context* ctx, int maximum_width);
1020
1124
 
@@ -1027,6 +1131,53 @@ LIBHEIF_API
1027
1131
  void heif_context_set_max_decoding_threads(struct heif_context* ctx, int max_threads);
1028
1132
 
1029
1133
 
1134
+ // --- security limits
1135
+
1136
+ // If you set a limit to 0, the limit is disabled.
1137
+ struct heif_security_limits {
1138
+ uint8_t version;
1139
+
1140
+ // --- version 1
1141
+
1142
+ // Limit on the maximum image size to avoid allocating too much memory.
1143
+ // For example, setting this to 32768^2 pixels = 1 Gigapixels results
1144
+ // in 1.5 GB memory need for YUV-4:2:0 or 4 GB for RGB32.
1145
+ uint64_t max_image_size_pixels;
1146
+ uint64_t max_number_of_tiles;
1147
+ uint32_t max_bayer_pattern_pixels;
1148
+ uint32_t max_items;
1149
+
1150
+ uint32_t max_color_profile_size;
1151
+ uint64_t max_memory_block_size;
1152
+
1153
+ uint32_t max_components;
1154
+
1155
+ uint32_t max_iloc_extents_per_item;
1156
+ uint32_t max_size_entity_group;
1157
+
1158
+ uint32_t max_children_per_box; // for all boxes that are not covered by other limits
1159
+ };
1160
+
1161
+ // The global security limits are the default for new heif_contexts.
1162
+ // These global limits cannot be changed, but you can override the limits for a specific heif_context.
1163
+ LIBHEIF_API
1164
+ const struct heif_security_limits* heif_get_global_security_limits();
1165
+
1166
+ // Returns a set of fully disabled security limits. Use with care and only after user confirmation.
1167
+ LIBHEIF_API
1168
+ const struct heif_security_limits* heif_get_disabled_security_limits();
1169
+
1170
+ // Returns the security limits for a heif_context.
1171
+ // By default, the limits are set to the global limits, but you can change them in the returned object.
1172
+ LIBHEIF_API
1173
+ struct heif_security_limits* heif_context_get_security_limits(const struct heif_context*);
1174
+
1175
+ // Overwrites the security limits of a heif_context.
1176
+ // This is a convenience function to easily copy limits.
1177
+ LIBHEIF_API
1178
+ struct heif_error heif_context_set_security_limits(struct heif_context*, const struct heif_security_limits*);
1179
+
1180
+
1030
1181
  // ========================= heif_image_handle =========================
1031
1182
 
1032
1183
  // An heif_image_handle is a handle to a logical image in the HEIF file.
@@ -1062,17 +1213,21 @@ LIBHEIF_API
1062
1213
  int heif_image_handle_is_premultiplied_alpha(const struct heif_image_handle*);
1063
1214
 
1064
1215
  // Returns -1 on error, e.g. if this information is not present in the image.
1216
+ // Only defined for images coded in the YCbCr or monochrome colorspace.
1065
1217
  LIBHEIF_API
1066
1218
  int heif_image_handle_get_luma_bits_per_pixel(const struct heif_image_handle*);
1067
1219
 
1068
1220
  // Returns -1 on error, e.g. if this information is not present in the image.
1221
+ // Only defined for images coded in the YCbCr colorspace.
1069
1222
  LIBHEIF_API
1070
1223
  int heif_image_handle_get_chroma_bits_per_pixel(const struct heif_image_handle*);
1071
1224
 
1072
1225
  // Return the colorspace that libheif proposes to use for decoding.
1073
1226
  // Usually, these will be either YCbCr or Monochrome, but it may also propose RGB for images
1074
- // encoded with matrix_coefficients=0.
1227
+ // encoded with matrix_coefficients=0 or for images coded natively in RGB.
1075
1228
  // It may also return *_undefined if the file misses relevant information to determine this without decoding.
1229
+ // These are only proposed values that avoid colorspace conversions as much as possible.
1230
+ // You can still request the output in your preferred colorspace, but this may involve an internal conversion.
1076
1231
  LIBHEIF_API
1077
1232
  struct heif_error heif_image_handle_get_preferred_decoding_colorspace(const struct heif_image_handle* image_handle,
1078
1233
  enum heif_colorspace* out_colorspace,
@@ -1099,6 +1254,83 @@ LIBHEIF_API
1099
1254
  struct heif_context* heif_image_handle_get_context(const struct heif_image_handle* handle);
1100
1255
 
1101
1256
 
1257
+ struct heif_image_tiling
1258
+ {
1259
+ int version;
1260
+
1261
+ // --- version 1
1262
+
1263
+ uint32_t num_columns;
1264
+ uint32_t num_rows;
1265
+ uint32_t tile_width;
1266
+ uint32_t tile_height;
1267
+
1268
+ uint32_t image_width;
1269
+ uint32_t image_height;
1270
+
1271
+ // Position of the top left tile.
1272
+ // Usually, this is (0;0), but if a tiled image is rotated or cropped, it may be that the top left tile should be placed at a negative position.
1273
+ // The offsets define this negative shift.
1274
+ uint32_t top_offset;
1275
+ uint32_t left_offset;
1276
+
1277
+ uint8_t number_of_extra_dimensions; // 0 for normal images, 1 for volumetric (3D), ...
1278
+ uint32_t extra_dimension_size[8]; // size of extra dimensions (first 8 dimensions)
1279
+ };
1280
+
1281
+
1282
+ // If 'process_image_transformations' is true, this returns modified sizes.
1283
+ // If it is false, the top_offset and left_offset will always be (0;0).
1284
+ LIBHEIF_API
1285
+ struct heif_error heif_image_handle_get_image_tiling(const struct heif_image_handle* handle, int process_image_transformations, struct heif_image_tiling* out_tiling);
1286
+
1287
+
1288
+ // For grid images, return the image item ID of a specific grid tile.
1289
+ // If 'process_image_transformations' is true, the tile positions are given in the transformed image coordinate system and
1290
+ // are internally mapped to the original image tile positions.
1291
+ LIBHEIF_API
1292
+ struct heif_error heif_image_handle_get_grid_image_tile_id(const struct heif_image_handle* handle,
1293
+ int process_image_transformations,
1294
+ uint32_t tile_x, uint32_t tile_y,
1295
+ heif_item_id* out_tile_item_id);
1296
+
1297
+
1298
+ struct heif_decoding_options;
1299
+
1300
+ // The tile position is given in tile indices, not in pixel coordinates.
1301
+ // If the image transformations are processed (option->ignore_image_transformations==false), the tile position
1302
+ // is given in the transformed coordinates.
1303
+ LIBHEIF_API
1304
+ struct heif_error heif_image_handle_decode_image_tile(const struct heif_image_handle* in_handle,
1305
+ struct heif_image** out_img,
1306
+ enum heif_colorspace colorspace,
1307
+ enum heif_chroma chroma,
1308
+ const struct heif_decoding_options* options,
1309
+ uint32_t tile_x, uint32_t tile_y);
1310
+
1311
+
1312
+ // ------------------------- entity groups ------------------------
1313
+
1314
+ typedef uint32_t heif_entity_group_id;
1315
+
1316
+ struct heif_entity_group
1317
+ {
1318
+ heif_entity_group_id entity_group_id;
1319
+ uint32_t entity_group_type; // this is a FourCC constant
1320
+ heif_item_id* entities;
1321
+ uint32_t num_entities;
1322
+ };
1323
+
1324
+ // Use 0 for `type_filter` or `item_filter` to disable the filter.
1325
+ // Returns an array of heif_entity_group structs with *out_num_groups entries.
1326
+ LIBHEIF_API
1327
+ struct heif_entity_group* heif_context_get_entity_groups(const struct heif_context*, uint32_t type_filter, uint32_t item_filter, int* out_num_groups);
1328
+
1329
+ // Release an array of entity groups returned by heif_context_get_entity_groups().
1330
+ LIBHEIF_API
1331
+ void heif_entity_groups_release(struct heif_entity_group*, int num_groups);
1332
+
1333
+
1102
1334
  // ------------------------- depth images -------------------------
1103
1335
 
1104
1336
  LIBHEIF_API
@@ -1394,13 +1626,17 @@ struct heif_color_profile_nclx* heif_nclx_color_profile_alloc(void);
1394
1626
  LIBHEIF_API
1395
1627
  void heif_nclx_color_profile_free(struct heif_color_profile_nclx* nclx_profile);
1396
1628
 
1397
-
1629
+ // Note: in early versions of HEIF, there could only be one color profile per image. However, this has been changed.
1630
+ // This function will now return ICC if one is present and NCLX only if there is no ICC.
1631
+ // You may better avoid this function and simply query for NCLX and ICC directly.
1398
1632
  LIBHEIF_API
1399
1633
  enum heif_color_profile_type heif_image_get_color_profile_type(const struct heif_image* image);
1400
1634
 
1635
+ // Returns the size of the ICC profile if one is assigned to the image. Otherwise, it returns 0.
1401
1636
  LIBHEIF_API
1402
1637
  size_t heif_image_get_raw_color_profile_size(const struct heif_image* image);
1403
1638
 
1639
+ // Returns the ICC profile if one is assigned to the image. Otherwise, it returns an error.
1404
1640
  LIBHEIF_API
1405
1641
  struct heif_error heif_image_get_raw_color_profile(const struct heif_image* image,
1406
1642
  void* out_data);
@@ -1482,8 +1718,10 @@ enum heif_chroma_upsampling_algorithm
1482
1718
  heif_chroma_upsampling_bilinear = 2
1483
1719
  };
1484
1720
 
1721
+
1485
1722
  struct heif_color_conversion_options
1486
1723
  {
1724
+ // 'version' must be 1.
1487
1725
  uint8_t version;
1488
1726
 
1489
1727
  // --- version 1 options
@@ -1498,8 +1736,15 @@ struct heif_color_conversion_options
1498
1736
  // Set this field to 'true' if you want to make sure that the specified algorithm is used even
1499
1737
  // at the cost of slightly higher computation times.
1500
1738
  uint8_t only_use_preferred_chroma_algorithm;
1739
+
1740
+ // --- Note that we cannot extend this struct because it is embedded in
1741
+ // other structs (heif_decoding_options and heif_encoding_options).
1501
1742
  };
1502
1743
 
1744
+ // Assumes that it is a version=1 struct.
1745
+ LIBHEIF_API
1746
+ void heif_color_conversion_options_set_defaults(struct heif_color_conversion_options*);
1747
+
1503
1748
 
1504
1749
  struct heif_decoding_options
1505
1750
  {
@@ -1511,6 +1756,7 @@ struct heif_decoding_options
1511
1756
  // Default: false (do not ignore).
1512
1757
  uint8_t ignore_transformations;
1513
1758
 
1759
+ // Any of the progress functions may be called from background threads.
1514
1760
  void (* start_progress)(enum heif_progress_step step, int max_progress, void* progress_user_data);
1515
1761
 
1516
1762
  void (* on_progress)(enum heif_progress_step step, int progress, void* progress_user_data);
@@ -1536,10 +1782,13 @@ struct heif_decoding_options
1536
1782
  // The priority is defined in the plugin.
1537
1783
  const char* decoder_id;
1538
1784
 
1539
-
1540
1785
  // version 5 options
1541
1786
 
1542
1787
  struct heif_color_conversion_options color_conversion_options;
1788
+
1789
+ // version 6 options
1790
+
1791
+ int (* cancel_decoding)(void* progress_user_data);
1543
1792
  };
1544
1793
 
1545
1794
 
@@ -1629,7 +1878,6 @@ struct heif_error heif_image_crop(struct heif_image* img,
1629
1878
  LIBHEIF_API
1630
1879
  int heif_image_get_bits_per_pixel(const struct heif_image*, enum heif_channel channel);
1631
1880
 
1632
-
1633
1881
  // Get the number of bits per pixel in the given image channel. This function returns
1634
1882
  // the number of bits used for representing the pixel value, which might be smaller
1635
1883
  // than the number of bits used in memory.
@@ -1657,6 +1905,7 @@ uint8_t* heif_image_get_plane(struct heif_image*,
1657
1905
  int* out_stride);
1658
1906
 
1659
1907
 
1908
+
1660
1909
  struct heif_scaling_options;
1661
1910
 
1662
1911
  // Currently, heif_scaling_options is not defined yet. Pass a NULL pointer.
@@ -1666,6 +1915,12 @@ struct heif_error heif_image_scale_image(const struct heif_image* input,
1666
1915
  int width, int height,
1667
1916
  const struct heif_scaling_options* options);
1668
1917
 
1918
+ // Extends the image size to match the given size by extending the right and bottom borders.
1919
+ // The border areas are filled with zero.
1920
+ LIBHEIF_API
1921
+ struct heif_error heif_image_extend_to_size_fill_with_zero(struct heif_image* image,
1922
+ uint32_t width, uint32_t height);
1923
+
1669
1924
  // The color profile is not attached to the image handle because we might need it
1670
1925
  // for color space transform and encoding.
1671
1926
  LIBHEIF_API
@@ -1719,6 +1974,10 @@ int heif_image_has_content_light_level(const struct heif_image*);
1719
1974
  LIBHEIF_API
1720
1975
  void heif_image_get_content_light_level(const struct heif_image*, struct heif_content_light_level* out);
1721
1976
 
1977
+ // Returns whether the image has 'content light level' information. If 0 is returned, the output is not filled.
1978
+ LIBHEIF_API
1979
+ int heif_image_handle_get_content_light_level(const struct heif_image_handle*, struct heif_content_light_level* out);
1980
+
1722
1981
  LIBHEIF_API
1723
1982
  void heif_image_set_content_light_level(const struct heif_image*, const struct heif_content_light_level* in);
1724
1983
 
@@ -1745,15 +2004,27 @@ struct heif_decoded_mastering_display_colour_volume
1745
2004
  double min_display_mastering_luminance;
1746
2005
  };
1747
2006
 
2007
+ struct heif_ambient_viewing_environment
2008
+ {
2009
+ uint32_t ambient_illumination;
2010
+ uint16_t ambient_light_x;
2011
+ uint16_t ambient_light_y;
2012
+ };
2013
+
1748
2014
  LIBHEIF_API
1749
2015
  int heif_image_has_mastering_display_colour_volume(const struct heif_image*);
1750
2016
 
1751
2017
  LIBHEIF_API
1752
2018
  void heif_image_get_mastering_display_colour_volume(const struct heif_image*, struct heif_mastering_display_colour_volume* out);
1753
2019
 
2020
+ // Returns whether the image has 'mastering display colour volume' information. If 0 is returned, the output is not filled.
2021
+ LIBHEIF_API
2022
+ int heif_image_handle_get_mastering_display_colour_volume(const struct heif_image_handle*, struct heif_mastering_display_colour_volume* out);
2023
+
1754
2024
  LIBHEIF_API
1755
2025
  void heif_image_set_mastering_display_colour_volume(const struct heif_image*, const struct heif_mastering_display_colour_volume* in);
1756
2026
 
2027
+
1757
2028
  // Converts the internal numeric representation of heif_mastering_display_colour_volume to the
1758
2029
  // normalized values, collected in heif_decoded_mastering_display_colour_volume.
1759
2030
  // Values that are out-of-range are decoded to 0, indicating an undefined value (as specified in ISO/IEC 23008-2).
@@ -1764,6 +2035,10 @@ struct heif_error heif_mastering_display_colour_volume_decode(const struct heif_
1764
2035
  LIBHEIF_API
1765
2036
  void heif_image_get_pixel_aspect_ratio(const struct heif_image*, uint32_t* aspect_h, uint32_t* aspect_v);
1766
2037
 
2038
+ // Returns whether the image has 'pixel aspect ratio information' information. If 0 is returned, the output is filled with the 1:1 default.
2039
+ LIBHEIF_API
2040
+ int heif_image_handle_get_pixel_aspect_ratio(const struct heif_image_handle*, uint32_t* aspect_h, uint32_t* aspect_v);
2041
+
1767
2042
  LIBHEIF_API
1768
2043
  void heif_image_set_pixel_aspect_ratio(struct heif_image*, uint32_t aspect_h, uint32_t aspect_v);
1769
2044
 
@@ -2088,7 +2363,7 @@ struct heif_encoding_options
2088
2363
 
2089
2364
  // Set this to the NCLX parameters to be used in the output image or set to NULL
2090
2365
  // when the same parameters as in the input image should be used.
2091
- struct heif_color_profile_nclx* output_nclx_profile;
2366
+ const struct heif_color_profile_nclx* output_nclx_profile;
2092
2367
 
2093
2368
  uint8_t macOS_compatibility_workaround_no_nclx_profile;
2094
2369
 
@@ -2103,7 +2378,7 @@ struct heif_encoding_options
2103
2378
 
2104
2379
  // version 7 options
2105
2380
 
2106
- // Set this to true to use compressed form of uncC where possible
2381
+ // Set this to true to use compressed form of uncC where possible.
2107
2382
  uint8_t prefer_uncC_short_form;
2108
2383
  };
2109
2384
 
@@ -2147,6 +2422,34 @@ struct heif_error heif_context_encode_grid(struct heif_context* ctx,
2147
2422
  const struct heif_encoding_options* input_options,
2148
2423
  struct heif_image_handle** out_image_handle);
2149
2424
 
2425
+ LIBHEIF_API
2426
+ struct heif_error heif_context_add_grid_image(struct heif_context* ctx,
2427
+ uint32_t image_width,
2428
+ uint32_t image_height,
2429
+ uint32_t tile_columns,
2430
+ uint32_t tile_rows,
2431
+ const struct heif_encoding_options* encoding_options,
2432
+ struct heif_image_handle** out_grid_image_handle);
2433
+
2434
+ LIBHEIF_API
2435
+ struct heif_error heif_context_add_image_tile(struct heif_context* ctx,
2436
+ struct heif_image_handle* tiled_image,
2437
+ uint32_t tile_x, uint32_t tile_y,
2438
+ const struct heif_image* image,
2439
+ struct heif_encoder* encoder);
2440
+
2441
+ // offsets[] should either be NULL (all offsets==0) or an array of size 2*nImages with x;y offset pairs.
2442
+ // If background_rgba is NULL, the background is transparent.
2443
+ LIBHEIF_API
2444
+ struct heif_error heif_context_add_overlay_image(struct heif_context* ctx,
2445
+ uint32_t image_width,
2446
+ uint32_t image_height,
2447
+ uint16_t nImages,
2448
+ const heif_item_id* image_ids,
2449
+ int32_t* offsets,
2450
+ const uint16_t background_rgba[4],
2451
+ struct heif_image_handle** out_iovl_image_handle);
2452
+
2150
2453
  LIBHEIF_API
2151
2454
  struct heif_error heif_context_set_primary_image(struct heif_context*,
2152
2455
  struct heif_image_handle* image_handle);
@@ -2167,16 +2470,6 @@ struct heif_error heif_context_encode_thumbnail(struct heif_context*,
2167
2470
  int bbox_size,
2168
2471
  struct heif_image_handle** out_thumb_image_handle);
2169
2472
 
2170
- enum heif_metadata_compression
2171
- {
2172
- heif_metadata_compression_off = 0,
2173
- heif_metadata_compression_auto = 1,
2174
- heif_metadata_compression_unknown = 2, // only used when reading unknown method from input file
2175
- heif_metadata_compression_deflate = 3,
2176
- heif_metadata_compression_zlib = 4, // do not use for header data
2177
- heif_metadata_compression_brotli = 5
2178
- };
2179
-
2180
2473
  // Assign 'thumbnail_image' as the thumbnail image of 'master_image'.
2181
2474
  LIBHEIF_API
2182
2475
  struct heif_error heif_context_assign_thumbnail(struct heif_context*,
@@ -38,7 +38,9 @@ enum heif_item_property_type
38
38
  heif_item_property_type_transform_rotation = heif_fourcc('i', 'r', 'o', 't'),
39
39
  heif_item_property_type_transform_crop = heif_fourcc('c', 'l', 'a', 'p'),
40
40
  heif_item_property_type_image_size = heif_fourcc('i', 's', 'p', 'e'),
41
- heif_item_property_type_uuid = heif_fourcc('u', 'u', 'i', 'd')
41
+ heif_item_property_type_uuid = heif_fourcc('u', 'u', 'i', 'd'),
42
+ heif_item_property_type_tai_clock_info = heif_fourcc('t', 'a', 'i', 'c'),
43
+ heif_item_property_type_tai_timestamp = heif_fourcc('i', 't', 'a', 'i')
42
44
  };
43
45
 
44
46
  // Get the heif_property_id for a heif_item_id.
@@ -132,7 +134,6 @@ void heif_item_get_property_transform_crop_borders(const struct heif_context* co
132
134
  int image_width, int image_height,
133
135
  int* left, int* top, int* right, int* bottom);
134
136
 
135
-
136
137
  /**
137
138
  * @param context
138
139
  * @param itemId The image item id to which this property belongs.
@@ -167,6 +168,25 @@ struct heif_error heif_item_get_property_raw_data(const struct heif_context* con
167
168
  heif_property_id propertyId,
168
169
  uint8_t* out_data);
169
170
 
171
+ /**
172
+ * Get the extended type for an extended "uuid" box.
173
+ *
174
+ * This provides the UUID for the extended box.
175
+ *
176
+ * This method should only be called on properties of type `heif_item_property_type_uuid`.
177
+ *
178
+ * @param context the heif_context containing the HEIF file
179
+ * @param itemId the image item id to which this property belongs.
180
+ * @param propertyID the property index (1-based) to get the extended type for
181
+ * @param extended_type output of the call, must be a pointer to at least 16-bytes.
182
+ * @return heif_error_success or an error indicating the failure
183
+ */
184
+ LIBHEIF_API
185
+ struct heif_error heif_item_get_property_uuid_type(const struct heif_context* context,
186
+ heif_item_id itemId,
187
+ heif_property_id propertyId,
188
+ uint8_t out_extended_type[16]);
189
+
170
190
  #ifdef __cplusplus
171
191
  }
172
192
  #endif
@@ -28,10 +28,10 @@
28
28
  #define LIBHEIF_HEIF_VERSION_H
29
29
 
30
30
  /* Numeric representation of the version */
31
- #define LIBHEIF_NUMERIC_VERSION ((1<<24) | (18<<16) | (2<<8) | 0)
31
+ #define LIBHEIF_NUMERIC_VERSION ((1<<24) | (19<<16) | (1<<8) | 0)
32
32
 
33
33
  /* Version string */
34
- #define LIBHEIF_VERSION "1.18.2"
34
+ #define LIBHEIF_VERSION "1.19.1"
35
35
 
36
36
  #define LIBHEIF_PLUGIN_DIRECTORY "/target/lib/libheif"
37
37
 
@@ -7,7 +7,7 @@
7
7
 
8
8
  #define LIBRSVG_MAJOR_VERSION (2)
9
9
  #define LIBRSVG_MINOR_VERSION (59)
10
- #define LIBRSVG_MICRO_VERSION (1)
11
- #define LIBRSVG_VERSION "2.59.1"
10
+ #define LIBRSVG_MICRO_VERSION (2)
11
+ #define LIBRSVG_VERSION "2.59.2"
12
12
 
13
13
  #endif
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@img/sharp-libvips-dev",
3
- "version": "1.1.0-rc2",
3
+ "version": "1.1.0-rc3",
4
4
  "description": "Header files and C++ sources for libvips and dependencies required when compiling sharp from source",
5
5
  "author": "Lovell Fuller <npm@lovell.info>",
6
6
  "homepage": "https://sharp.pixelplumbing.com",
package/versions.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "fribidi": "1.0.16",
12
12
  "glib": "2.82.2",
13
13
  "harfbuzz": "10.0.1",
14
- "heif": "1.18.2",
14
+ "heif": "1.19.1",
15
15
  "highway": "1.2.0",
16
16
  "imagequant": "2.4.1",
17
17
  "lcms": "2.16",
@@ -20,10 +20,10 @@
20
20
  "pixman": "0.43.4",
21
21
  "png": "1.6.44",
22
22
  "proxy-libintl": "0.4",
23
- "rsvg": "2.59.1",
23
+ "rsvg": "2.59.2",
24
24
  "spng": "0.7.4",
25
25
  "tiff": "4.7.0",
26
- "vips": "8.16.0-rc2",
26
+ "vips": "8.16.0",
27
27
  "webp": "1.4.0",
28
28
  "xml": "2.13.4",
29
29
  "zlib-ng": "2.2.2"