qt-heif-image-plugin
qt-heif-image-plugin copied to clipboard
Plugin being built against libheif-1.5.1 doesn't open heic-file in nomacs-3.1x
The qt-heif-image-plugin-0.3.3
successfully built against libheif-1.5.1
in Gentoo Linux.
But in nomacs-3.12 or 3.14 the tested .heic
file wasn't opened with message Sorry, I couldn't load: sample.heic
. While README.md
file states that >=libheif-1.2
is required for 0.3.3 version.
After rebuild qt-heif-image-plugin0.3.3
against libheif-1.6.1
the sample-file successfully opened in both nomacs versions.
Interesting. I also had trouble with libheif 1.5.x on Ubuntu, but everything was magically fixed when the libheif PPA updated to 1.6, so I completely forgot about it. Prior to 1.5, there were no issues either. Throughout all of this though, the plugin was actually built against libheif 1.1 (which is all that should be required for version 0.3.3 of the plugin).
Could you also try to build against libheif <= 1.4, just to see if libheif 1.5 specifically is the issue? I'll fiddle with some different configurations when I get a chance, but it will probably be a week or so from now (at best).
Well. I investigated the problem and check several versions. I tested as for issue report this sample file while opening in nomacs.
The nomacs with plugin installed could open this sample at least for libheif versions 1.3.2, 1.4.0, 1.4.1, 1.6.0, 1.6.1, 1.6.2 and failed to open for 1.5.0, 1.5.1. I didn't test before 1.3.2 version.
I found that the changes that broke opening sample image was added in replace old color-conversion code with the new conversion pipeline (while development of 1.5.0 version) and finally repaired in fix color conversion to interleaved formats without alpha (just 1 day before 1.6.0 release). So as seems it's completely libheif issue and there are were 4 commits before 1.6.0 release then the easiest way to fix it - update libheif to any of 1.6.x or downgrade to 1.4.x.
On the other hand with libheif-1.5.1 the gimp opens the same sample file successfully. Maybe because it "add" alpha channel while conversion itself.
Thanks for the thorough investigation!
As a quick workaround, what do you think about using 24-bit heif_chroma_interleaved_RGB
and QImage::Format_RGB888
based on what heif_get_version_number()
returns? Or is that not worth the hassle? Or would that not work at all?
A comment was made here about color profiles. Do you think that's related?
Sorry, I have no idea about if it's possible to workaround this situation and about relative realisation within plugin.
That's fine. Thanks anyhow.
I'll keep this open for now, in case there's interest in getting libheif 1.5.x to work.
It seems that plugins doesn't work again with libheif 1.7.0 and 1.8.0.
☹️
Are you able to build from master and test that? None of the releases have #18 merged in.
Thank you for notice about patch.
I can't reproduce it again for libheif-1.8.0 from gentoo portage tree (initially tested for own build script) but the patch from #18 fix issue for libheif-1.7.0 and work for 1.8.0 too.