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 vs AVIF detection #16

Open
novomesk opened this issue May 19, 2020 · 3 comments
Open

HEIF vs AVIF detection #16

novomesk opened this issue May 19, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@novomesk
Copy link

There is following code in qheifhandler.cpp

    if (w1 != "ftyp") {
        // not an ftyp box
        return Format::None;
    }

    // brand follows box name, determines format
    if (w2 == "mif1") {
        return Format::Heif;

Unfortunately ftyp+mif1 is used by AVIF too (examples here: http://download.opencontent.netflix.com/?prefix=AV1/Chimera/AVIF/ ) but qt-heif-image-plugin with older libheif are not able to load AVIF.

I saw situation when qt-heif-image-plugin is installed together with my qt-avif-image-plugin.
qt-heif-image-plugin indicated that it can read the AVIF file (and as consequence the file was not opened via qt-avif-image-plugin) but qt-heif-image-plugin did not open it so the AVIF image was not displayed at all.

I think both qt-heif-image-plugin and qt-avif-image-plugin should read more than 12 bytes from beginning to determine file format, so we properly detect whether we have HEIF with HEVC compression or AVIF with AV1 compression.

@jakar jakar added the bug Something isn't working label May 19, 2020
@jakar
Copy link
Owner

jakar commented May 19, 2020

Thanks for reporting this. This is clearly a bug.

It was commented here that maybe it would be better to use libheif to check this header info, but I haven't had a chance to look into that yet.

@novomesk
Copy link
Author

Just a note: Future versions of libheif will support AVIF, so you will be able to load AVIF files via qt-heif-image-plugin too.
But some distributions keep old versions of libraries. Letting libheif to auto-detect by itself what it is able to open is a good idea.

@salehqt
Copy link

salehqt commented Jun 18, 2021

Just added a pull request #22 to add complete support for AVIF to this plug-in. I hope this resolves this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants