Cykooz / libheif-rs

Safe wrapper to libheif-sys for parsing heif/heic files
MIT License
34 stars 11 forks source link

Add support for color profiles #8

Closed sophie-h closed 1 year ago

sophie-h commented 1 year ago

Hey,

we are planning to use libheif-rs for GNOME's new image view Loupe. However, we need access to the color profiles. That would, especially the get_color_profile_type, color_profile_nclx, raw_color_profile functions. Can you make them available in the bindings or accept PRs?

Cykooz commented 1 year ago

Yes, I will make these functions.

Cykooz commented 1 year ago

@sophie-h Could you get me example of heic/heif image file with NCLX color profile for testing?

sophie-h commented 1 year ago

Yes, here is a .avif and .heif exported HDR (nCLX) image I have created with Krita for my testing.

https://gitlab.gnome.org/Incubator/loupe/uploads/322f81512346f3fd69b0acc502c04201/test.zip

Cykooz commented 1 year ago

I have released libheif-rs 0.16.0

Example of receiving color profile: https://github.com/Cykooz/libheif-rs/blob/bb90749a90424c42991e3289ced03ca04ec92940/tests/read_test.rs#L255-L286

sophie-h commented 1 year ago

Hey! This is working great!

I have found some minor problems during implementation:

Cykooz commented 1 year ago

Thank you. Look at the new release libheif-rs 0.17.0

sophie-h commented 1 year ago

Very cool. I think I got everything working now :)