+ } while( (link = g_slist_next(link)) );
+
+ return NULL; /* No match found */
+}
+
+glui32
+glk_image_get_info(glui32 image, glui32 *width, glui32 *height)
+{
+ printf("get_info(%d)\n", image);
+ struct image_info *to_find = g_new0(struct image_info, 1);
+ struct image_info *found;
+ to_find->resource_number = image;
+ to_find->scaled = FALSE; /* we want the original image size */
+
+ if( !(found = image_cache_find(to_find)) ) {
+ printf("Cache miss for %d\n", image);
+ found = load_image_in_cache(image, 0, 0);
+ if(found == NULL)
+ return FALSE;
+ } else {
+ printf("Cache hit for %d\n", image);
+ }
+
+ if(width != NULL)
+ *width = found->width;
+ if(width != NULL)
+ *height = found->height;
+ return TRUE;
+}
+
+glui32
+glk_image_draw(winid_t win, glui32 image, glsi32 val1, glsi32 val2)
+{
+ printf("image_draw(%d)\n", image);
+ VALID_WINDOW(win, return FALSE);
+ g_return_val_if_fail(win->type == wintype_Graphics, FALSE);
+
+ struct image_info *to_find = g_new0(struct image_info, 1);
+ struct image_info *info;
+ GdkPixmap *canvas;
+
+ /* Lookup the proper resource */
+ to_find->resource_number = image;
+ to_find->scaled = FALSE; /* we want the original image size */
+
+ if( !(info = image_cache_find(to_find)) ) {
+ info = load_image_in_cache(image, 0, 0);
+ if(info == NULL)
+ return FALSE;