diff --git a/libheif/image-items/image_item.cc b/libheif/image-items/image_item.cc index 1e9a551970..e5c655ee89 100644 --- a/libheif/image-items/image_item.cc +++ b/libheif/image-items/image_item.cc @@ -67,6 +67,13 @@ std::shared_ptr ImageItem::get_file() const } +heif_property_id ImageItem::add_property(std::shared_ptr property, bool essential) +{ + m_properties.push_back(property); + return get_file()->add_property(get_id(), property, essential); +} + + Error ImageItem::init_decoder_from_item(heif_item_id id) { m_id = id; diff --git a/libheif/image-items/image_item.h b/libheif/image-items/image_item.h index ffafdd0fd0..d13d565bdc 100644 --- a/libheif/image-items/image_item.h +++ b/libheif/image-items/image_item.h @@ -112,6 +112,8 @@ class ImageItem : public ErrorBuffer return nullptr; } + heif_property_id add_property(std::shared_ptr property, bool essential); + void set_resolution(uint32_t w, uint32_t h) { m_width = w; diff --git a/libheif/image-items/tiled.cc b/libheif/image-items/tiled.cc index 0adf0d707c..8751adfba8 100644 --- a/libheif/image-items/tiled.cc +++ b/libheif/image-items/tiled.cc @@ -597,7 +597,7 @@ ImageItem_Tiled::add_new_tiled_item(HeifContext* ctx, const heif_tiled_image_par auto tilC_box = std::make_shared(); tilC_box->set_parameters(*parameters); tilC_box->set_compression_format(encoder->plugin->compression_format); - ctx->get_heif_file()->add_property(tild_id, tilC_box, true); + tild_image->add_property(tilC_box, true); // Create header + offset table @@ -617,10 +617,10 @@ ImageItem_Tiled::add_new_tiled_item(HeifContext* ctx, const heif_tiled_image_par } // Add ISPE property - file->add_ispe_property(tild_id, - static_cast(parameters->image_width), - static_cast(parameters->image_height), - true); + auto ispe = std::make_shared(); + ispe->set_size(static_cast(parameters->image_width), + static_cast(parameters->image_height)); + tild_image->add_property(ispe, true); #if 0 // TODO