summaryrefslogtreecommitdiff
path: root/src/photos/PhotoFileFormat.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2023-06-28 21:35:52 +0200
committerJörg Frings-Fürst <debian@jff.email>2023-06-28 21:35:52 +0200
commitb86540b743f1a87a163ffb811c8fe22a01fefa38 (patch)
treeb47cb3bb83c2377234226fb3987ab3320a987dd9 /src/photos/PhotoFileFormat.vala
parentac6e0b731b9f0b2efd392e3309a5c07e2a66adad (diff)
parente905d8e16eec152d19797937f13ba3cf4b8f8aca (diff)
Merge branch 'release/debian/0.32.1-1'debian/0.32.1-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());
}