summaryrefslogtreecommitdiff
path: root/src/photos/PhotoFileFormat.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2023-06-14 20:35:58 +0200
committerJörg Frings-Fürst <debian@jff.email>2023-06-14 20:35:58 +0200
commitd443a3c2509889533ca812c163056bace396b586 (patch)
treee94ffc0d9c054ca4efb8fb327e18dfac88e15dc7 /src/photos/PhotoFileFormat.vala
parentbb9797c14470641b082ebf635e2ae3cfd5f27a3b (diff)
New upstream version 0.32.1upstream/0.32.1
Diffstat (limited to 'src/photos/PhotoFileFormat.vala')
-rw-r--r--src/photos/PhotoFileFormat.vala72
1 files changed, 69 insertions, 3 deletions
diff --git a/src/photos/PhotoFileFormat.vala b/src/photos/PhotoFileFormat.vala
index e642008..4c69de3 100644
--- a/src/photos/PhotoFileFormat.vala
+++ b/src/photos/PhotoFileFormat.vala
@@ -58,12 +58,16 @@ public enum PhotoFileFormat {
TIFF,
BMP,
GIF,
+ WEBP,
+ AVIF,
+ HEIF,
+ JPEGXL,
UNKNOWN;
// This is currently listed in the order of detection, that is, the file is examined from
// left to right. (See PhotoFileInterrogator.)
public static PhotoFileFormat[] get_supported() {
- return { JFIF, RAW, PNG, TIFF, BMP, GIF };
+ return { JFIF, RAW, PNG, TIFF, BMP, GIF, WEBP, AVIF, HEIF, JPEGXL };
}
public static PhotoFileFormat[] get_writeable() {
@@ -141,7 +145,19 @@ public enum PhotoFileFormat {
case GIF:
return 5;
-
+
+ case WEBP:
+ return 6;
+
+ case AVIF:
+ return 7;
+
+ case HEIF:
+ return 8;
+
+ case JPEGXL:
+ return 9;
+
case UNKNOWN:
default:
return -1;
@@ -169,6 +185,18 @@ public enum PhotoFileFormat {
case 5:
return GIF;
+ case 6:
+ return WEBP;
+
+ case 7:
+ return AVIF;
+
+ case 8:
+ return HEIF;
+
+ case 9:
+ return JPEGXL;
+
default:
return UNKNOWN;
}
@@ -217,7 +245,17 @@ public enum PhotoFileFormat {
case "gif":
return PhotoFileFormat.GIF;
-
+
+ case "heif/avif":
+ case "avif":
+ return PhotoFileFormat.AVIF;
+
+ case "heif":
+ return PhotoFileFormat.HEIF;
+
+ case "jxl":
+ return PhotoFileFormat.JPEGXL;
+
default:
return PhotoFileFormat.UNKNOWN;
}
@@ -249,6 +287,22 @@ public enum PhotoFileFormat {
Photos.GifFileFormatDriver.init();
break;
+ case WEBP:
+ Photos.WebpFileFormatDriver.init();
+ break;
+
+ case AVIF:
+ AvifFileFormatDriver.init();
+ break;
+
+ case HEIF:
+ HeifFileFormatDriver.init();
+ break;
+
+ case JPEGXL:
+ JpegXLFileFormatDriver.init();
+ break;
+
default:
error("Unsupported file format %s", this.to_string());
}
@@ -274,6 +328,18 @@ public enum PhotoFileFormat {
case GIF:
return Photos.GifFileFormatDriver.get_instance();
+ case WEBP:
+ return Photos.WebpFileFormatDriver.get_instance();
+
+ case AVIF:
+ return AvifFileFormatDriver.get_instance();
+
+ case HEIF:
+ return HeifFileFormatDriver.get_instance();
+
+ case JPEGXL:
+ return JpegXLFileFormatDriver.get_instance();
+
default:
error("Unsupported file format %s", this.to_string());
}