Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reading TIFF mono files fails #1300

Closed
bradh opened this issue Sep 7, 2024 · 1 comment
Closed

reading TIFF mono files fails #1300

bradh opened this issue Sep 7, 2024 · 1 comment

Comments

@bradh
Copy link
Contributor

bradh commented Sep 7, 2024

heif-enc with a single band file fails with an error like:

Could not encode HEIF/AVIF file: Encoder plugin generated an error: Unsupported bit depth: Bit depth not supported by x265

The error is misleading though. Its really an invalid pixel image being passed as input. That happens because of this logic:

struct heif_image* image = nullptr;
heif_colorspace colorspace = bpp == 1 ? heif_colorspace_monochrome : heif_colorspace_RGB;
heif_chroma chroma = bpp == 1 ? heif_chroma_monochrome : heif_chroma_interleaved_RGB;
if (bpp == 4) {
chroma = heif_chroma_interleaved_RGBA;
}
err = heif_image_create((int) width, (int) height, colorspace, chroma, &image);
(void) err;
// TODO: handle error
switch (config) {
case PLANARCONFIG_CONTIG:
{
heif_channel channel = heif_channel_interleaved;

(and equivalent call for the planar case).

Essentially we're creating a mono image, then adding an interleaved image plane, which doesn't make sense.

I'm currently working on a fix.

@bradh
Copy link
Contributor Author

bradh commented Sep 19, 2024

This is resolved via the way #1301 got pulled in.

@bradh bradh closed this as completed Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant