Skip to content

Commit

Permalink
fix getting colorspace for overlay images (#1373)
Browse files Browse the repository at this point in the history
  • Loading branch information
farindk committed Nov 7, 2024
1 parent a86f00e commit 95e9495
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions libheif/image-items/overlay.cc
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,15 @@ int ImageItem_Overlay::get_chroma_bits_per_pixel() const
}


Error ImageItem_Overlay::get_coded_image_colorspace(heif_colorspace* out_colorspace, heif_chroma* out_chroma) const
{
*out_colorspace = heif_colorspace_RGB;
*out_chroma = heif_chroma_444;

return Error::Ok;
}


Result<std::shared_ptr<ImageItem_Overlay>> ImageItem_Overlay::add_new_overlay_item(HeifContext* ctx, const ImageOverlay& overlayspec)
{
if (overlayspec.get_num_offsets() > 0xFFFF) {
Expand Down
2 changes: 2 additions & 0 deletions libheif/image-items/overlay.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ class ImageItem_Overlay : public ImageItem

int get_chroma_bits_per_pixel() const override;

Error get_coded_image_colorspace(heif_colorspace* out_colorspace, heif_chroma* out_chroma) const override;

Result<CodedImageData> encode(const std::shared_ptr<HeifPixelImage>& image,
struct heif_encoder* encoder,
const struct heif_encoding_options& options,
Expand Down

0 comments on commit 95e9495

Please sign in to comment.