aboutsummaryrefslogtreecommitdiff
path: root/fiv.c
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2023-06-04 15:20:03 +0200
committerPřemysl Eric Janouch <p@janouch.name>2023-06-04 16:16:52 +0200
commit338ae69121424368fbbe7dcff9a990aeb8e6fc52 (patch)
tree5b9ef520e016a2a17981c0bccabfdc58abe05f30 /fiv.c
parent1c61fcc5bc656d5c5ded34905213752ce0c4d6be (diff)
downloadfiv-338ae69121424368fbbe7dcff9a990aeb8e6fc52.tar.gz
fiv-338ae69121424368fbbe7dcff9a990aeb8e6fc52.tar.xz
fiv-338ae69121424368fbbe7dcff9a990aeb8e6fc52.zip
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.
Diffstat (limited to 'fiv.c')
-rw-r--r--fiv.c10
1 files changed, 10 insertions, 0 deletions
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 <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]);