From 7b497406136dabcce280bae3886a88ee77ebc1e7 Mon Sep 17 00:00:00 2001 From: Bert Date: Wed, 16 Feb 2011 16:47:12 +0100 Subject: First things for thumbnail mode --- image.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'image.c') diff --git a/image.c b/image.c index 64225b1..cc664b6 100644 --- a/image.c +++ b/image.c @@ -149,6 +149,27 @@ int img_fit(img_t *img, win_t *win) { return oz != img->zoom; } +int img_load_thumb(thumb_t *tn, const char *filename) { + int w; + int h; + + if (!tn) + return 0; + + if (!_imlib_load_image(filename)) + return 0; + + w = imlib_image_get_width(); + h = imlib_image_get_height(); + + imlib_context_set_drawable(tn->pm); + imlib_render_image_part_on_drawable_at_size(0, 0, w, h, + 0, 0, THUMB_SIZE, THUMB_SIZE); + imlib_free_image(); + + return 1; +} + void img_render(img_t *img, win_t *win) { int sx, sy, sw, sh; int dx, dy, dw, dh; -- cgit v1.2.3-54-g00ecf