Skip to content

Commit

Permalink
io-webp.c: add function to check supported format options
Browse files Browse the repository at this point in the history
  • Loading branch information
Alberto Ruiz committed Feb 23, 2023
1 parent 48d9524 commit eaa4ea0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions io-webp.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,18 @@ write_array (const uint8_t *data, size_t data_size, const WebPPicture *const pic
return TRUE;
}

static gboolean
is_save_option_supported (const gchar *option_key)
{
char *options[3] = { "quality", "preset", NULL };
for (char **o = options; *o; o++)
{
if (g_strcmp0 (*o, option_key) == 0)
return TRUE;
}
return FALSE;
}

static gboolean
save_webp (GdkPixbuf *pixbuf,
gchar **keys,
Expand Down Expand Up @@ -375,6 +387,8 @@ fill_vtable (GdkPixbufModule *module)

module->save = save;
module->save_to_callback = save_to_callback;

module->is_save_option_supported = is_save_option_supported;
}

G_MODULE_EXPORT void
Expand Down

0 comments on commit eaa4ea0

Please sign in to comment.