Skip to content

Commit

Permalink
fix returning 'monochrome' as preferred colorspace for AVIF images (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
farindk committed Nov 18, 2024
1 parent 8363b2c commit 487224b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions libheif/codecs/avif_boxes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ std::string Box_av1C::dump(Indent& indent) const
<< indent << "seq_level_idx_0: " << ((int) c.seq_level_idx_0) << "\n"
<< indent << "high_bitdepth: " << ((int) c.high_bitdepth) << "\n"
<< indent << "twelve_bit: " << ((int) c.twelve_bit) << "\n"
<< indent << "monochrome: " << ((int) c.monochrome) << "\n"
<< indent << "chroma_subsampling_x: " << ((int) c.chroma_subsampling_x) << "\n"
<< indent << "chroma_subsampling_y: " << ((int) c.chroma_subsampling_y) << "\n"
<< indent << "chroma_sample_position: " << ((int) c.chroma_sample_position) << "\n"
Expand Down
5 changes: 4 additions & 1 deletion libheif/codecs/avif_boxes.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ friend class Box_mini;
//unsigned int (8)[] configOBUs;

heif_chroma get_heif_chroma() const {
if (chroma_subsampling_x==1 && chroma_subsampling_y==1) {
if (monochrome) {
return heif_chroma_monochrome;
}
else if (chroma_subsampling_x==1 && chroma_subsampling_y==1) {
return heif_chroma_420;
}
else if (chroma_subsampling_x==1 && chroma_subsampling_y==0) {
Expand Down

0 comments on commit 487224b

Please sign in to comment.