Exemplo n.º 1
0
static gint thumb_loader_std_setup(ThumbLoaderStd *tl, const gchar *path)
{
	tl->il = image_loader_new(path);

#if 0
	/* this will speed up jpegs by up to 3x in some cases */
	if (tl->requested_width <= THUMB_SIZE_NORMAL &&
	    tl->requested_height <= THUMB_SIZE_NORMAL)
		{
		image_loader_set_requested_size(tl->il, THUMB_SIZE_NORMAL, THUMB_SIZE_NORMAL);
		}
	else
		{
		image_loader_set_requested_size(tl->il, THUMB_SIZE_LARGE, THUMB_SIZE_LARGE);
		}
#endif

	image_loader_set_error_func(tl->il, thumb_loader_std_error_cb, tl);
	if (tl->func_progress)
		{
		image_loader_set_percent_func(tl->il, thumb_loader_std_progress_cb, tl);
		}

	if (image_loader_start(tl->il, thumb_loader_std_done_cb, tl))
		{
		return TRUE;
		}

	image_loader_free(tl->il);
	tl->il = NULL;
	return FALSE;
}
Exemplo n.º 2
0
static void
thumb_loader_setup (ThumbLoader * tl, gchar * path)
{
    tl->il = image_loader_new (path);

    image_loader_set_error_func (tl->il, cb_thumb_loader_error, tl);

    if (tl->func_percent)
	image_loader_set_percent_func (tl->il, cb_thumb_loader_percent, tl);
}