Skip to content

Commit

Permalink
plug-ins: fix #8553 GIMP 2.99.12 Cannot Open WebP Files
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Wormnest committed Aug 30, 2022
1 parent 6324f3f commit 8513447
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plug-ins/file-ico/ico.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8513447

Please sign in to comment.