diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2023-06-14 20:36:37 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2023-06-14 20:36:37 +0200 |
commit | bb80d3feebdc9acc52e3f4ad24084d8425f043a2 (patch) | |
tree | 2084a84c39f159c6aea254775dc0880d52579d45 /src/photos/PhotoFileFormat.vala | |
parent | b26ff0798252a1a8072dd2c7a67f6205de9fde11 (diff) | |
parent | 31804433d72460cbe0a39f9f8ea5e76058d84cda (diff) |
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'src/photos/PhotoFileFormat.vala')
-rw-r--r-- | src/photos/PhotoFileFormat.vala | 72 |
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()); } |