From b051cf466f7c9f008f2ab8c3f6ccac34882a1b9e Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sun, 4 Sep 2011 23:50:14 +0000 Subject: Add Image cache and inegrate png and jpeg content handlers Current periodic cache clean algorithm is poor and requires replacing with something suitable (probably a segregated LRU) The speculative load algorithm is likewise poor and only uses the image size to make a decision. svn path=/trunk/netsurf/; revision=12720 --- image/image.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'image/image.c') diff --git a/image/image.c b/image/image.c index 779826a17..fb8197b28 100644 --- a/image/image.c +++ b/image/image.c @@ -16,6 +16,7 @@ * along with this program. If not, see . */ +#include #include #include #include @@ -23,6 +24,7 @@ #include "utils/errors.h" #include "image/image.h" +#include "image/image_cache.h" #include "image/bmp.h" #include "image/gif.h" #include "image/ico.h" @@ -45,6 +47,10 @@ nserror image_init(void) { nserror error; + error = image_cache_init(); + if (error != NSERROR_OK) + return error; + #ifdef WITH_BMP error = nsbmp_init(); if (error != NSERROR_OK) @@ -158,5 +164,8 @@ void image_fini(void) #ifdef WITH_WEBP webp_fini(); #endif + + /* dump any remaining cache entries */ + image_cache_fini(); } -- cgit v1.2.3