Skip to content

Commit

Permalink
Bug Fixes: set type as uuid. Write uuid data. define uuid enum
Browse files Browse the repository at this point in the history
  • Loading branch information
dukesook committed Mar 26, 2024
1 parent 659c8e3 commit 9287c11
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions libheif/box.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions libheif/heif_properties.cc
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ struct heif_error heif_item_add_property_uuid(const struct heif_context* context
std::vector<uint8_t> uuid_type_vector(uuid_type, uuid_type + 16);

auto uuid_box = std::make_shared<Box>();
uuid_box->set_short_type(fourcc("uuid"));
uuid_box->set_uuid_type(uuid_type_vector);
uuid_box->set_uuid_data(data_vector);

Expand Down
3 changes: 2 additions & 1 deletion libheif/heif_properties.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 9287c11

Please sign in to comment.