Skip to content

Commit

Permalink
fix setting premultiplied alpha flag (#1394)
Browse files Browse the repository at this point in the history
  • Loading branch information
farindk committed Nov 19, 2024
1 parent a873ef6 commit 7a7bdd1
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions libheif/context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,17 @@ Error HeifContext::interpret_heif_file()
img_iter->second->add_metadata(metadata);
}
}
else if (ref.header.get_short_type() == fourcc("prem")) {
}
}
}

// --- set premultiplied alpha flag

for (heif_item_id id : image_IDs) {
if (iref_box) {
std::vector<Box_iref::Reference> references = iref_box->get_references_from(id);
for (const auto& ref : references) {
if (ref.header.get_short_type() == fourcc("prem")) {
uint32_t color_image_id = ref.from_item_ID;
auto img_iter = m_all_images.find(color_image_id);
if (img_iter == m_all_images.end()) {
Expand All @@ -832,7 +842,7 @@ Error HeifContext::interpret_heif_file()
"`prem` link assigned to non-existing image");
}

img_iter->second->set_is_premultiplied_alpha(true);;
img_iter->second->set_is_premultiplied_alpha(true);
}
}
}
Expand Down

0 comments on commit 7a7bdd1

Please sign in to comment.