From ff4dd1811f816eada1e58b8febf4894bc4f94afa Mon Sep 17 00:00:00 2001 From: Nicholas-Westby Date: Fri, 5 Apr 2024 16:29:38 -0700 Subject: [PATCH] feat (File Picker) add WebP to FilePickerFileTypes (#15242) WebP is a common image format these days, so I added it to the list of "All Images" as well as its own file picker file type. Metadata derived from: https://developers.google.com/speed/webp/docs/riff_container --- .../Platform/Storage/FilePickerFileTypes.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Avalonia.Base/Platform/Storage/FilePickerFileTypes.cs b/src/Avalonia.Base/Platform/Storage/FilePickerFileTypes.cs index 9c712a648b..d735d1dae2 100644 --- a/src/Avalonia.Base/Platform/Storage/FilePickerFileTypes.cs +++ b/src/Avalonia.Base/Platform/Storage/FilePickerFileTypes.cs @@ -21,7 +21,7 @@ public static class FilePickerFileTypes public static FilePickerFileType ImageAll { get; } = new("All Images") { - Patterns = new[] { "*.png", "*.jpg", "*.jpeg", "*.gif", "*.bmp" }, + Patterns = new[] { "*.png", "*.jpg", "*.jpeg", "*.gif", "*.bmp", "*.webp" }, AppleUniformTypeIdentifiers = new[] { "public.image" }, MimeTypes = new[] { "image/*" } }; @@ -40,6 +40,13 @@ public static class FilePickerFileTypes MimeTypes = new[] { "image/png" } }; + public static FilePickerFileType ImageWebp { get; } = new("WebP image") + { + Patterns = new[] { "*.webp" }, + AppleUniformTypeIdentifiers = new[] { "org.webmproject.webp" }, + MimeTypes = new[] { "image/webp" } + }; + public static FilePickerFileType Pdf { get; } = new("PDF document") { Patterns = new[] { "*.pdf" },