diff options
-rw-r--r-- | gdk-pixbuf/io-gdip-jpeg.c | 10 | ||||
-rw-r--r-- | gdk-pixbuf/io-gdip-png.c | 11 | ||||
-rw-r--r-- | gdk-pixbuf/io-ico.c | 12 | ||||
-rw-r--r-- | gdk-pixbuf/io-jpeg.c | 11 | ||||
-rw-r--r-- | gdk-pixbuf/io-png.c | 14 | ||||
-rw-r--r-- | gdk-pixbuf/io-tiff.c | 14 |
6 files changed, 72 insertions, 0 deletions
diff --git a/gdk-pixbuf/io-gdip-jpeg.c b/gdk-pixbuf/io-gdip-jpeg.c index 0f2db1d87..73fa1f19d 100644 --- a/gdk-pixbuf/io-gdip-jpeg.c +++ b/gdk-pixbuf/io-gdip-jpeg.c @@ -99,6 +99,15 @@ gdk_pixbuf__gdip_image_save_JPEG (FILE *f, return gdk_pixbuf__gdip_image_save_JPEG_to_callback (gdip_save_to_file_callback, f, pixbuf, keys, values, error);
}
+static gboolean
+gdk_pixbuf__gdip_is_save_option_supported_JPEG (const gchar *option_key)
+{
+ if (g_strcmp0 (option_key, "quality") == 0)
+ return TRUE;
+
+ return FALSE;
+}
+
#ifndef INCLUDE_gdiplus
#define MODULE_ENTRY(function) G_MODULE_EXPORT void function
#else
@@ -111,6 +120,7 @@ MODULE_ENTRY (fill_vtable) (GdkPixbufModule *module) module->save_to_callback = gdk_pixbuf__gdip_image_save_JPEG_to_callback;
module->save = gdk_pixbuf__gdip_image_save_JPEG; /* for gtk < 2.14, you need to implement both. otherwise gdk-pixbuf-queryloaders fails */
+ module->is_save_option_supported = gdk_pixbuf__gdip_is_save_option_supported_JPEG;
}
MODULE_ENTRY (fill_info) (GdkPixbufFormat *info)
diff --git a/gdk-pixbuf/io-gdip-png.c b/gdk-pixbuf/io-gdip-png.c index a54eeb41a..f7e597af1 100644 --- a/gdk-pixbuf/io-gdip-png.c +++ b/gdk-pixbuf/io-gdip-png.c @@ -95,6 +95,16 @@ gdk_pixbuf__gdip_image_save_PNG (FILE *f, return gdk_pixbuf__gdip_image_save_PNG_to_callback (gdip_save_to_file_callback, f, pixbuf, keys, values, error);
}
+static gboolean
+gdk_pixbuf__gdip_is_save_option_supported_PNG (const gchar *option_key)
+{
+ if (g_strcmp0 (option_key, "compression") == 0 ||
+ strncmp (option_key, "tEXt::", 6) == 0)
+ return TRUE;
+
+ return FALSE;
+}
+
#ifndef INCLUDE_gdip_png
#define MODULE_ENTRY(function) G_MODULE_EXPORT void function
#else
@@ -107,6 +117,7 @@ MODULE_ENTRY (fill_vtable) (GdkPixbufModule *module) module->save_to_callback = gdk_pixbuf__gdip_image_save_PNG_to_callback;
module->save = gdk_pixbuf__gdip_image_save_PNG; /* for gtk < 2.14, you need to implement both. otherwise gdk-pixbuf-queryloaders fails */
+ module->is_save_option_supported = gdk_pixbuf__gdip_is_save_option_supported_PNG;
}
MODULE_ENTRY (fill_info) (GdkPixbufFormat *info)
diff --git a/gdk-pixbuf/io-ico.c b/gdk-pixbuf/io-ico.c index 82d3e4e7a..797f6d103 100644 --- a/gdk-pixbuf/io-ico.c +++ b/gdk-pixbuf/io-ico.c @@ -1242,6 +1242,17 @@ gdk_pixbuf__ico_image_save (FILE *f, return TRUE; } +static gboolean +gdk_pixbuf__ico_is_save_option_supported (const gchar *option_key) +{ + if (g_strcmp0 (option_key, "depth") == 0 || + g_strcmp0 (option_key, "x_hot") == 0 || + g_strcmp0 (option_key, "y_hot") == 0) + return TRUE; + + return FALSE; +} + #ifndef INCLUDE_ico #define MODULE_ENTRY(function) G_MODULE_EXPORT void function #else @@ -1254,6 +1265,7 @@ MODULE_ENTRY (fill_vtable) (GdkPixbufModule *module) module->stop_load = gdk_pixbuf__ico_image_stop_load; module->load_increment = gdk_pixbuf__ico_image_load_increment; module->save = gdk_pixbuf__ico_image_save; + module->is_save_option_supported = gdk_pixbuf__ico_is_save_option_supported; } MODULE_ENTRY (fill_info) (GdkPixbufFormat *info) diff --git a/gdk-pixbuf/io-jpeg.c b/gdk-pixbuf/io-jpeg.c index eb48aedde..a2adff15c 100644 --- a/gdk-pixbuf/io-jpeg.c +++ b/gdk-pixbuf/io-jpeg.c @@ -1537,6 +1537,16 @@ gdk_pixbuf__jpeg_image_save_to_callback (GdkPixbufSaveFunc save_func, TRUE, NULL, save_func, user_data); } +static gboolean +gdk_pixbuf__jpeg_is_save_option_supported (const gchar *option_key) +{ + if (g_strcmp0 (option_key, "quality") == 0 || + g_strcmp0 (option_key, "icc-profile") == 0) + return TRUE; + + return FALSE; +} + #ifndef INCLUDE_jpeg #define MODULE_ENTRY(function) G_MODULE_EXPORT void function #else @@ -1551,6 +1561,7 @@ MODULE_ENTRY (fill_vtable) (GdkPixbufModule *module) module->load_increment = gdk_pixbuf__jpeg_image_load_increment; module->save = gdk_pixbuf__jpeg_image_save; module->save_to_callback = gdk_pixbuf__jpeg_image_save_to_callback; + module->is_save_option_supported = gdk_pixbuf__jpeg_is_save_option_supported; } MODULE_ENTRY (fill_info) (GdkPixbufFormat *info) 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) diff --git a/gdk-pixbuf/io-tiff.c b/gdk-pixbuf/io-tiff.c index 78eb24306..9ca037852 100644 --- a/gdk-pixbuf/io-tiff.c +++ b/gdk-pixbuf/io-tiff.c @@ -979,6 +979,19 @@ gdk_pixbuf__tiff_image_save (FILE *f, values, error); } +static gboolean +gdk_pixbuf__tiff_is_save_option_supported (const gchar *option_key) +{ + if (g_strcmp0 (option_key, "bits-per-sample") == 0 || + 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) + return TRUE; + + return FALSE; +} + #ifndef INCLUDE_tiff #define MODULE_ENTRY(function) G_MODULE_EXPORT void function #else @@ -993,6 +1006,7 @@ MODULE_ENTRY (fill_vtable) (GdkPixbufModule *module) module->load_increment = gdk_pixbuf__tiff_image_load_increment; module->save = gdk_pixbuf__tiff_image_save; module->save_to_callback = gdk_pixbuf__tiff_image_save_to_callback; + module->is_save_option_supported = gdk_pixbuf__tiff_is_save_option_supported; } MODULE_ENTRY (fill_info) (GdkPixbufFormat *info) |