diff options
author | Matthias Clasen <mclasen@redhat.com> | 2016-08-02 15:17:14 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2016-08-02 15:19:21 -0400 |
commit | 1883b720cf6cb59eacd85781422b2f092974a753 (patch) | |
tree | 06092ee6dfac45660e507f652dbce10e970524f9 /gdk-pixbuf/io-png.c | |
parent | 6385d35df0475d357cf4433afa05600ddeb08a7a (diff) | |
download | gdk-pixbuf-1883b720cf6cb59eacd85781422b2f092974a753.tar.gz |
modules: implement is_option_supported() for builtin modules
Follow-up to previous commit; implement the new API in the modules we
ship that can save pixbufs.
https://bugzilla.gnome.org/show_bug.cgi?id=683371
Diffstat (limited to 'gdk-pixbuf/io-png.c')
-rw-r--r-- | gdk-pixbuf/io-png.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gdk-pixbuf/io-png.c b/gdk-pixbuf/io-png.c index e5ab22bcb..bb198c976 100644 --- a/gdk-pixbuf/io-png.c +++ b/gdk-pixbuf/io-png.c @@ -1171,6 +1171,19 @@ gdk_pixbuf__png_image_save_to_callback (GdkPixbufSaveFunc save_func, TRUE, NULL, save_func, user_data); } +static gboolean +gdk_pixbuf__png_is_save_option_supported (const gchar *option_key) +{ + if (g_strcmp0 (option_key, "compression") == 0 || + g_strcmp0 (option_key, "icc-profile") == 0 || + g_strcmp0 (option_key, "x-dpi") == 0 || + g_strcmp0 (option_key, "y-dpi") == 0 || + strncmp (option_key, "tEXt::", 6) == 0) + return TRUE; + + return FALSE; +} + #ifndef INCLUDE_png #define MODULE_ENTRY(function) G_MODULE_EXPORT void function #else @@ -1185,6 +1198,7 @@ MODULE_ENTRY (fill_vtable) (GdkPixbufModule *module) module->load_increment = gdk_pixbuf__png_image_load_increment; module->save = gdk_pixbuf__png_image_save; module->save_to_callback = gdk_pixbuf__png_image_save_to_callback; + module->is_save_option_supported = gdk_pixbuf__png_is_save_option_supported; } MODULE_ENTRY (fill_info) (GdkPixbufFormat *info) |