diff options
| author | fiaxh <git@lightrise.org> | 2025-04-07 18:08:14 +0200 |
|---|---|---|
| committer | fiaxh <git@lightrise.org> | 2025-04-07 18:12:33 +0200 |
| commit | ea54d659e5729ec9d2493ad1e4a268425b180891 (patch) | |
| tree | 2383f7b5a75e7af80167294932db576d3972a512 /libdino/src/service/util.vala | |
| parent | d621c9653934b4d16bcb257ca4aff584c6ebc20e (diff) | |
Fix sending images with unknown formats
Diffstat (limited to 'libdino/src/service/util.vala')
| -rw-r--r-- | libdino/src/service/util.vala | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libdino/src/service/util.vala b/libdino/src/service/util.vala index 1d04ffcf..6eacdd33 100644 --- a/libdino/src/service/util.vala +++ b/libdino/src/service/util.vala @@ -29,6 +29,17 @@ public class Util { assert_not_reached(); } } + + public static bool is_pixbuf_supported_mime_type(string mime_type) { + if (mime_type == null) return false; + + foreach (Gdk.PixbufFormat pixbuf_format in Gdk.Pixbuf.get_formats()) { + foreach (string pixbuf_mime in pixbuf_format.get_mime_types()) { + if (pixbuf_mime == mime_type) return true; + } + } + return false; + } } } |
