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.
This commit is contained in:
2023-06-04 15:20:03 +02:00
parent 1c61fcc5bc
commit 338ae69121
4 changed files with 36 additions and 3 deletions

10
fiv.c
View File

@@ -43,6 +43,11 @@
#include "fiv-thumbnail.h"
#include "fiv-view.h"
#ifdef HAVE_LCMS2_FAST_FLOAT
#include <lcms2.h>
#include <lcms2_fast_float.h>
#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]);