Skip to content

Commit

Permalink
Revert "add heif_context_add_generic_uri_metadata()"
Browse files Browse the repository at this point in the history
This reverts commit 06f13d1.
New API will be developed in branch develop-v1.18.0.
  • Loading branch information
farindk committed Nov 1, 2023
1 parent 06f13d1 commit 2289041
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 34 deletions.
2 changes: 0 additions & 2 deletions libheif/box.h
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,6 @@ class Box_infe : public FullBox

Error write(StreamWriter& writer) const override;

void set_item_uri_type(const std::string& type) { m_item_uri_type = type; }

const std::string& get_item_uri_type() const { return m_item_uri_type; }

protected:
Expand Down
9 changes: 3 additions & 6 deletions libheif/context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3324,19 +3324,19 @@ Error HeifContext::add_exif_metadata(const std::shared_ptr<Image>& master_image,

return add_generic_metadata(master_image,
data_array.data(), (int) data_array.size(),
"Exif", nullptr, nullptr, heif_metadata_compression_off);
"Exif", nullptr, heif_metadata_compression_off);
}


Error HeifContext::add_XMP_metadata(const std::shared_ptr<Image>& master_image, const void* data, int size,
heif_metadata_compression compression)
{
return add_generic_metadata(master_image, data, size, "mime", "application/rdf+xml", nullptr, compression);
return add_generic_metadata(master_image, data, size, "mime", "application/rdf+xml", compression);
}


Error HeifContext::add_generic_metadata(const std::shared_ptr<Image>& master_image, const void* data, int size,
const char* item_type, const char* content_type, const char* item_uri_type, heif_metadata_compression compression)
const char* item_type, const char* content_type, heif_metadata_compression compression)
{
// create an infe box describing what kind of data we are storing (this also creates a new ID)

Expand All @@ -3345,9 +3345,6 @@ Error HeifContext::add_generic_metadata(const std::shared_ptr<Image>& master_ima
if (content_type != nullptr) {
metadata_infe_box->set_content_type(content_type);
}
if (item_uri_type != nullptr) {
metadata_infe_box->set_item_uri_type(item_uri_type);
}

heif_item_id metadata_id = metadata_infe_box->get_item_ID();

Expand Down
2 changes: 1 addition & 1 deletion libheif/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ class HeifContext : public ErrorBuffer
Error add_XMP_metadata(const std::shared_ptr<Image>& master_image, const void* data, int size, heif_metadata_compression compression);

Error add_generic_metadata(const std::shared_ptr<Image>& master_image, const void* data, int size,
const char* item_type, const char* content_type, const char* item_uri_type,
const char* item_type, const char* content_type,
heif_metadata_compression compression);

heif_property_id add_property(heif_item_id targetItem, std::shared_ptr<Box> property, bool essential);
Expand Down
18 changes: 1 addition & 17 deletions libheif/heif.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2829,23 +2829,7 @@ struct heif_error heif_context_add_generic_metadata(struct heif_context* ctx,
const char* item_type, const char* content_type)
{
Error error = ctx->context->add_generic_metadata(image_handle->image, data, size,
item_type, content_type, nullptr, heif_metadata_compression_off);
if (error != Error::Ok) {
return error.error_struct(ctx->context.get());
}
else {
return heif_error_success;
}
}


struct heif_error heif_context_add_generic_uri_metadata(struct heif_context* ctx,
const struct heif_image_handle* image_handle,
const void* data, int size,
const char* item_uri_type)
{
Error error = ctx->context->add_generic_metadata(image_handle->image, data, size,
"uri ", nullptr, item_uri_type, heif_metadata_compression_off);
item_type, content_type, heif_metadata_compression_off);
if (error != Error::Ok) {
return error.error_struct(ctx->context.get());
}
Expand Down
8 changes: 0 additions & 8 deletions libheif/heif.h
Original file line number Diff line number Diff line change
Expand Up @@ -2088,14 +2088,6 @@ struct heif_error heif_context_add_generic_metadata(struct heif_context* ctx,
const void* data, int size,
const char* item_type, const char* content_type);

// Add generic metadata with item_type "uri ". Items with this type do not have a content_type, but
// an item_uri_type and they have no content_encoding (they are always stored uncompressed).
LIBHEIF_API
struct heif_error heif_context_add_generic_uri_metadata(struct heif_context* ctx,
const struct heif_image_handle* image_handle,
const void* data, int size,
const char* item_uri_type);

// --- heif_image allocation

// Create a new image of the specified resolution and colorspace.
Expand Down

0 comments on commit 2289041

Please sign in to comment.