summaryrefslogtreecommitdiff
path: root/demos/pixbuf-init.c
blob: 898de4558635cf9f56302763aa2191b5e6eff8f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "config.h"
#include <glib.h>

#include <sys/stat.h>
#include <stdlib.h>

static gboolean
file_exists (const char *filename)
{
  struct stat statbuf;

  return stat (filename, &statbuf) == 0;
}

void
pixbuf_init (void)
{
  if (file_exists ("../gdk-pixbuf/libpixbufloader-pnm.la"))
    g_setenv ("GDK_PIXBUF_MODULE_FILE", "../gdk-pixbuf/gdk-pixbuf.loaders", TRUE);
}