From 338ae69121424368fbbe7dcff9a990aeb8e6fc52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Eric=20Janouch?= Date: Sun, 4 Jun 2023 15:20:03 +0200 Subject: Add support for the Little CMS fast float plugin On a sample of JPEGs, it improved loading speed from ~0.26s to ~0.15s. Unfortunately, it isn't normally installed. --- fiv.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'fiv.c') diff --git a/fiv.c b/fiv.c index ab64bb0..66a8d36 100644 --- a/fiv.c +++ b/fiv.c @@ -43,6 +43,11 @@ #include "fiv-thumbnail.h" #include "fiv-view.h" +#ifdef HAVE_LCMS2_FAST_FLOAT +#include +#include +#endif // HAVE_LCMS2_FAST_FLOAT + // --- Utilities --------------------------------------------------------------- static void exit_fatal(const char *format, ...) G_GNUC_PRINTF(1, 2); @@ -2382,6 +2387,11 @@ on_app_handle_local_options(G_GNUC_UNUSED GApplication *app, return 0; } + // TODO(p): Use Little CMS with contexts instead. +#ifdef HAVE_LCMS2_FAST_FLOAT + cmsPlugin(cmsFastFloatExtensions()); +#endif // HAVE_LCMS2_FAST_FLOAT + // Normalize all arguments to URIs, and run thumbnailing modes first. for (gsize i = 0; o.args && o.args[i]; i++) { GFile *resolved = g_file_new_for_commandline_arg(o.args[i]); -- cgit v1.2.3