Skip to content

Commit

Permalink
J2K: fix decoding of greyscale images
Browse files Browse the repository at this point in the history
  • Loading branch information
farindk committed Jul 23, 2023
1 parent d36f063 commit ab8017d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libheif/plugins/decoder_openjpeg.cc
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,9 @@ struct heif_error openjpeg_decode_image(void* decoder_raw, struct heif_image** o
struct heif_error err = {heif_error_Decoder_plugin_error, heif_suberror_Unspecified, "opj_read_header()"};
return err;
}
else if (image->numcomps != 3) {
else if (image->numcomps != 3 && image->numcomps != 1) {
//TODO - Handle other numbers of components
struct heif_error err = {heif_error_Unsupported_feature, heif_suberror_Unsupported_data_version, "Number of components must be 3"};
struct heif_error err = {heif_error_Unsupported_feature, heif_suberror_Unsupported_data_version, "Number of components must be 3 or 1"};
return err;
}
else if ((image->color_space != OPJ_CLRSPC_UNSPECIFIED) && (image->color_space != OPJ_CLRSPC_SRGB)) {
Expand Down

0 comments on commit ab8017d

Please sign in to comment.