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

heif_image_add_channel(): Possible bug? #1426

Open
jerstlouis opened this issue Dec 16, 2024 · 2 comments
Open

heif_image_add_channel(): Possible bug? #1426

jerstlouis opened this issue Dec 16, 2024 · 2 comments

Comments

@jerstlouis
Copy link
Contributor

jerstlouis commented Dec 16, 2024

https://github.com/strukturag/libheif/blob/master/libheif/api/libheif/heif.cc#L1824

The ! check does not seem to be equivalent to:

if (image->image->add_channel(channel, width, height, datatype, bit_depth, nullptr) != Error::Ok) {

Changing it to the latter seemed to avoid the Cannot allocate memory for image plane message.

cc. @farindk

@farindk
Copy link
Contributor

farindk commented Dec 16, 2024

Right, thanks. That line was overlooked when I changed the return type from bool to Error.
I have corrected it in the patch above.

Note that there is currently not much use for heif_image_add_channel() because the other data-types can only be saved by the 'uncompressed' codec and that part is not implemented yet. Everybody currently uses heif_image_add_plane() instead.

@jerstlouis
Copy link
Contributor Author

@farindk @pcdion is filing a separate issue about this because we are trying to output non-visual gridded coverage of real values in uncompressed HEIF from our OGC API - Coverages / Tiles API (e.g. elevation model, but could be multiple fields like relative humidity, temperature...).

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

No branches or pull requests

2 participants