Include jpeg2000 loader
[geeqie.git] / src / image-load.c
index 16c40da..2504ff8 100644 (file)
@@ -32,6 +32,7 @@
 #include "image_load_ffmpegthumbnailer.h"
 #include "image_load_collection.h"
 #include "image_load_webp.h"
+#include "image_load_j2k.h"
 
 #include "exif.h"
 #include "filedata.h"
@@ -696,6 +697,15 @@ static void image_loader_setup_loader(ImageLoader *il)
                image_loader_backend_set_psd(&il->backend);
                }
        else
+#ifdef HAVE_J2K
+       if (il->bytes_total >= 12 &&
+               (memcmp(il->mapped_file, "\0\0\0\x0CjP\x20\x20\x0D\x0A\x87\x0A", 12) == 0))
+               {
+               DEBUG_1("Using custom j2k loader");
+               image_loader_backend_set_j2k(&il->backend);
+               }
+       else
+#endif
        if (il->fd->format_class == FORMAT_CLASS_COLLECTION)
                {
                DEBUG_1("Using custom collection loader");