File: t_jpeg.c

package info (click to toggle)
webp-pixbuf-loader 0.2.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,144 kB
  • sloc: ansic: 1,194; sh: 17; makefile: 7
file content (23 lines) | stat: -rw-r--r-- 616 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <gdk-pixbuf/gdk-pixbuf.h>

gint
main (gint argc, gchar **argv)
{
  GError *error = NULL;
  gchar **env   = g_get_environ ();

  gchar *contents = NULL;
  gsize  len      = 0;
  g_assert (g_file_get_contents (g_environ_getenv (env, "TEST_FILE"), &contents, &len, NULL));

  GdkPixbufLoader *loader = gdk_pixbuf_loader_new_with_type ("webp", NULL);
  g_assert (loader != NULL);
  gdk_pixbuf_loader_write (loader, (const guchar *) contents, len, &error);
  g_assert (error != NULL);

  g_clear_pointer (&contents, g_free);
  g_clear_object (&loader);
  g_clear_error (&error);
  g_strfreev (env);
  return 0;
}