Fix #1076: webp images show up as black
[geeqie.git] / src / image-load.cc
index 3e763b6..6901d54 100644 (file)
@@ -32,6 +32,7 @@
 #include "image-load-libraw.h"
 #include "image-load-psd.h"
 #include "image-load-svgz.h"
+#include "image-load-webp.h"
 #include "image-load-zxscr.h"
 #include "misc.h"
 #include "ui-fileops.h"
@@ -686,6 +687,16 @@ static void image_loader_setup_loader(ImageLoader *il)
                }
        else
 #endif
+#ifdef HAVE_WEBP
+       if (il->bytes_total >= 12 &&
+               (memcmp(il->mapped_file, "RIFF", 4) == 0) &&
+               (memcmp(il->mapped_file + 8, "WEBP", 4) == 0))
+               {
+               DEBUG_1("Using custom webp loader");
+               image_loader_backend_set_webp(&il->backend);
+               }
+       else
+#endif
 #ifdef HAVE_DJVU
        if (il->bytes_total >= 16 &&
                (memcmp(il->mapped_file, "AT&TFORM", 8) == 0) &&