summaryrefslogtreecommitdiff
path: root/content/handlers/image/image.c
diff options
context:
space:
mode:
Diffstat (limited to 'content/handlers/image/image.c')
-rw-r--r--content/handlers/image/image.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/content/handlers/image/image.c b/content/handlers/image/image.c
index 675fdd691..2bd5f5f8d 100644
--- a/content/handlers/image/image.c
+++ b/content/handlers/image/image.c
@@ -26,15 +26,18 @@
#include "netsurf/bitmap.h"
#include "netsurf/content.h"
#include "desktop/gui_internal.h"
+#include "desktop/bitmap.h"
#include "image/bmp.h"
#include "image/gif.h"
#include "image/ico.h"
#include "image/jpeg.h"
+#include "image/jpegxl.h"
#include "image/nssprite.h"
#include "image/png.h"
#include "image/rsvg.h"
#include "image/svg.h"
+#include "image/webp.h"
#include "image/image.h"
/**
@@ -70,6 +73,12 @@ nserror image_init(void)
return error;
#endif
+#ifdef WITH_JPEGXL
+ error = nsjpegxl_init();
+ if (error != NSERROR_OK)
+ return error;
+#endif
+
#ifdef WITH_PNG
error = nspng_init();
if (error != NSERROR_OK)
@@ -94,6 +103,12 @@ nserror image_init(void)
return error;
#endif
+#ifdef WITH_WEBP
+ error = nswebp_init();
+ if (error != NSERROR_OK)
+ return error;
+#endif
+
return error;
}
@@ -117,7 +132,7 @@ bool image_bitmap_plot(struct bitmap *bitmap,
if (height == 1) {
/* optimise 1x1 bitmap plot */
pixel = guit->bitmap->get_buffer(bitmap);
- fill_style.fill_colour = pixel_to_colour(pixel);
+ fill_style.fill_colour = bitmap_pixel_to_colour(pixel);
if (guit->bitmap->get_opaque(bitmap) ||
((fill_style.fill_colour & 0xff000000) == 0xff000000)) {