diff --git a/libheif/box.cc b/libheif/box.cc index 8fa723c571d..e01946a3e66 100644 --- a/libheif/box.cc +++ b/libheif/box.cc @@ -716,6 +716,10 @@ Error Box::write(StreamWriter& writer) const { size_t box_start = reserve_box_header_space(writer); + if (get_short_type() == fourcc("uuid")) { + writer.write(m_uuid_data); + } + Error err = write_children(writer); prepend_header(writer, box_start); diff --git a/libheif/heif_properties.cc b/libheif/heif_properties.cc index 4a064b612f5..206ab879f1c 100644 --- a/libheif/heif_properties.cc +++ b/libheif/heif_properties.cc @@ -315,6 +315,7 @@ struct heif_error heif_item_add_property_uuid(const struct heif_context* context std::vector uuid_type_vector(uuid_type, uuid_type + 16); auto uuid_box = std::make_shared(); + uuid_box->set_short_type(fourcc("uuid")); uuid_box->set_uuid_type(uuid_type_vector); uuid_box->set_uuid_data(data_vector); diff --git a/libheif/heif_properties.h b/libheif/heif_properties.h index bd624516cb5..5fd3c5c5abe 100644 --- a/libheif/heif_properties.h +++ b/libheif/heif_properties.h @@ -37,7 +37,8 @@ enum heif_item_property_type heif_item_property_type_transform_mirror = heif_fourcc('i', 'm', 'i', 'r'), heif_item_property_type_transform_rotation = heif_fourcc('i', 'r', 'o', 't'), heif_item_property_type_transform_crop = heif_fourcc('c', 'l', 'a', 'p'), - heif_item_property_type_image_size = heif_fourcc('i', 's', 'p', 'e') + heif_item_property_type_image_size = heif_fourcc('i', 's', 'p', 'e'), + heif_item_property_type_uuid = heif_fourcc('u', 'u', 'i', 'd') }; // Get the heif_property_id for a heif_item_id.