From 85134478c765c1adaa3c0d49ea8159fe8587651d Mon Sep 17 00:00:00 2001 From: Jacob Boerema Date: Tue, 30 Aug 2022 15:33:04 -0400 Subject: [PATCH] plug-ins: fix #8553 GIMP 2.99.12 Cannot Open WebP Files GIMP tried to open webp files as ani (animated cursor) files. The reason for this is that for ani we had set the file magic as the first 4 bytes should be RIFF. However, RIFF is a container format, used by many different file formats, among which is also webp. This means that checking for RIFF is not specific enough. Based on the info on http://fileformats.archiveteam.org/wiki/ANI we will check the 4 bytes starting at offset 8 for ACON, which is apparently the identifying part for animated icons. --- plug-ins/file-ico/ico.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plug-ins/file-ico/ico.c b/plug-ins/file-ico/ico.c index 0b4efda25d..5693d619e6 100644 --- a/plug-ins/file-ico/ico.c +++ b/plug-ins/file-ico/ico.c @@ -242,7 +242,7 @@ ico_create_procedure (GimpPlugIn *plug_in, gimp_file_procedure_set_extensions (GIMP_FILE_PROCEDURE (procedure), "ani"); gimp_file_procedure_set_magics (GIMP_FILE_PROCEDURE (procedure), - "0,string,RIFF"); + "8,string,ACON"); gimp_load_procedure_set_thumbnail_loader (GIMP_LOAD_PROCEDURE (procedure), LOAD_ANI_THUMB_PROC);