From: Uwe Ohse  <> Date: Fri, 4 Jun 2021 13:29:57 +0000 (+0100) Subject: Fix #901: add ftypavif magic for AVIF files X-Git-Tag: v1.7~99 X-Git-Url: http://geeqie.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d53e60b5471081f1d071083b71afa73cfd36adf0;p=geeqie.git Fix #901: add ftypavif magic for AVIF files https://github.com/BestImageViewer/geeqie/issues/901 AVIF loading depends on the magic numbers, and the current list of known magics in src/image-load.c is: ftypheic, ftypmsf1, ftypmif1. This is okay for HEIF, but AVIF is a different beast with a different codec and a different magic ftypavif (which is generated by gimp and darktable), and a different file extension (.avif) --- diff --git a/src/image-load.c b/src/image-load.c index e6913ff55..125031873 100644 --- a/src/image-load.c +++ b/src/image-load.c @@ -712,7 +712,8 @@ static void image_loader_setup_loader(ImageLoader *il) if (il->bytes_total >= 12 && ((memcmp(il->mapped_file + 4, "ftypheic", 8) == 0) || (memcmp(il->mapped_file + 4, "ftypmsf1", 8) == 0) || - (memcmp(il->mapped_file + 4, "ftypmif1", 8) == 0))) + (memcmp(il->mapped_file + 4, "ftypmif1", 8) == 0) || + (memcmp(il->mapped_file + 4, "ftypavif", 8) == 0))) { DEBUG_1("Using custom heif loader"); image_loader_backend_set_heif(&il->backend);