[frameworks/kimageformats] src/imageformats: heif: declare read support for HIF

Daniel Novomeský <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 7ec1170c86dc96323bef26c17cad13fa1a60dafd by Daniel Novomeský.
Committed on 20/07/2026 at 16:23.
Pushed by novomeskyd into branch 'master'.

heif: declare read support for HIF

image/heif MIME type uses following three file extensions:
heif, heic, hif.

Adding HIF into plugin's list.

M  +8    -0    src/imageformats/heif.cpp
M  +14   -2    src/imageformats/heif.json

https://invent.kde.org/frameworks/kimageformats/-/commit/7ec1170c86dc96323bef26c17cad13fa1a60dafd

diff --git a/src/imageformats/heif.cpp b/src/imageformats/heif.cpp
index ea81dec4..96ebeb48 100644
--- a/src/imageformats/heif.cpp
+++ b/src/imageformats/heif.cpp
@@ -1465,6 +1465,14 @@ QImageIOPlugin::Capabilities HEIFPlugin::capabilities(QIODevice *device, const Q
         return format_cap;
     }
 
+    if (format == "hif") {
+        Capabilities format_cap;
+        if (HEIFHandler::isHeifDecoderAvailable()) {
+            format_cap |= CanRead;
+        }
+        return format_cap;
+    }
+
     if (format == "hej2") {
         Capabilities format_cap;
         if (HEIFHandler::isHej2DecoderAvailable()) {
diff --git a/src/imageformats/heif.json b/src/imageformats/heif.json
index e68b46fb..5a6713ec 100644
--- a/src/imageformats/heif.json
+++ b/src/imageformats/heif.json
@@ -1,4 +1,16 @@
 {
-    "Keys": [ "heif", "heic", "hej2", "avci" ],
-    "MimeTypes": [ "image/heif", "image/heif", "image/hej2k", "image/avci" ]
+    "Keys": [
+        "heif",
+        "heic",
+        "hif",
+        "hej2",
+        "avci"
+    ],
+    "MimeTypes": [
+        "image/heif",
+        "image/heif",
+        "image/heif",
+        "image/hej2k",
+        "image/avci"
+    ]
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.