aboutsummaryrefslogtreecommitdiff
path: root/fastiv-io.c
diff options
context:
space:
mode:
Diffstat (limited to 'fastiv-io.c')
-rw-r--r--fastiv-io.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/fastiv-io.c b/fastiv-io.c
index 82c3229..e1bb60a 100644
--- a/fastiv-io.c
+++ b/fastiv-io.c
@@ -78,6 +78,28 @@ const char *fastiv_io_supported_media_types[] = {
NULL
};
+char **
+fastiv_io_all_supported_media_types(void)
+{
+ GPtrArray *types = g_ptr_array_new();
+ for (const char **p = fastiv_io_supported_media_types; *p; p++)
+ g_ptr_array_add(types, g_strdup(*p));
+
+#ifdef HAVE_GDKPIXBUF
+ GSList *formats = gdk_pixbuf_get_formats();
+ for (GSList *iter = formats; iter; iter = iter->next) {
+ gchar **subtypes = gdk_pixbuf_format_get_mime_types(iter->data);
+ for (gchar **p = subtypes; *p; p++)
+ g_ptr_array_add(types, *p);
+ g_free(subtypes);
+ }
+ g_slist_free(formats);
+#endif // HAVE_GDKPIXBUF
+
+ g_ptr_array_add(types, NULL);
+ return (char **) g_ptr_array_free(types, FALSE);
+}
+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#define FASTIV_IO_ERROR fastiv_io_error_quark()