Commit c23eb5de for libheif
commit c23eb5de367712a3309afb3c20d57811eaca65ca
Author: Dirk Farin <dirk.farin@gmail.com>
Date: Thu Mar 5 21:45:04 2026 +0100
only do the tili/cref checks when we enabled the uncompressed codec
diff --git a/libheif/image-items/tiled.cc b/libheif/image-items/tiled.cc
index 3afb9f73..4756980e 100644
--- a/libheif/image-items/tiled.cc
+++ b/libheif/image-items/tiled.cc
@@ -24,7 +24,9 @@
#include <algorithm>
#include "security_limits.h"
#include "codecs/hevc_dec.h"
+#if WITH_UNCOMPRESSED_CODEC
#include "codecs/uncompressed/unc_boxes.h"
+#endif
#include "api_structs.h"
@@ -556,6 +558,7 @@ Error ImageItem_Tiled::initialize_decoder()
// Filter out per-tile boxes incompatible with tili's shared template
auto props = *propertiesResult;
+#if WITH_UNCOMPRESSED_CODEC
for (const auto& box : props) {
if (box->get_short_type() == fourcc("icef")) {
auto icef = std::dynamic_pointer_cast<Box_icef>(box);
@@ -570,6 +573,7 @@ Error ImageItem_Tiled::initialize_decoder()
uint32_t type = box->get_short_type();
return type == fourcc("icef") || type == fourcc("sbpm") || type == fourcc("snuc");
});
+#endif
m_tile_item->set_properties(props);
}
@@ -581,6 +585,7 @@ Error ImageItem_Tiled::initialize_decoder()
auto tile_properties = tilC_box->get_all_child_boxes();
// Filter out per-tile boxes incompatible with tili's shared template
+#if WITH_UNCOMPRESSED_CODEC
for (const auto& box : tile_properties) {
if (box->get_short_type() == fourcc("icef")) {
auto icef = std::dynamic_pointer_cast<Box_icef>(box);
@@ -595,6 +600,7 @@ Error ImageItem_Tiled::initialize_decoder()
uint32_t type = box->get_short_type();
return type == fourcc("icef") || type == fourcc("sbpm") || type == fourcc("snuc");
});
+#endif
bool have_ispe = false;
for (const auto& property : tile_properties) {
@@ -768,8 +774,10 @@ Error ImageItem_Tiled::add_image_tile(uint32_t tile_x, uint32_t tile_y,
continue;
}
+#if WITH_UNCOMPRESSED_CODEC
// icef/sbpm/snuc contain per-tile data incompatible with tili's shared tile template
uint32_t ptype = propertyBox->get_short_type();
+
if (ptype == fourcc("icef")) {
auto icef = std::dynamic_pointer_cast<Box_icef>(propertyBox);
if (icef && icef->get_units().size() > 1) {
@@ -780,11 +788,13 @@ Error ImageItem_Tiled::add_image_tile(uint32_t tile_x, uint32_t tile_y,
// Single-unit icef can be safely skipped
continue;
}
+
if (ptype == fourcc("sbpm") || ptype == fourcc("snuc")) {
return {heif_error_Usage_error,
heif_suberror_Unspecified,
"Cannot store per-tile property (" + fourcc_to_string(ptype) + ") in tili shared tile template."};
}
+#endif
// skip properties that exist already