Skip to content

plug-ins: Add .ani file import/export

Alx Sa requested to merge alxsa-import-export-ani-files into master

This patch attempts to add support for reading/writing Window's .ani animated cursors files. The code is a port of James Huang's work from a Gimp 2.4 plug-in (archived here).

The .ani file format is largely a RIFF-style header followed by blocks of either .ico or .cur files. The patch reads and writes this header file, then uses the existing .ico and .cur functions to write the image data. Variables to remember the current file offset are added to the existing .ico/.cur code for this purpose. When exporting, .cur format is used so the individual frames might have their own hotspots if desired by the user.

In addition to porting the existing code this patch adds the ability to save and edit the IART and INAM metadata, as well as change the rate of animation (measured in "jiffies" per the specifications, which is 1/60 of a second).

ani-dialog

Sample Files:

darth_vader.ani

dm2bnd2a.ani

Sonic_Link.ani

globe4.ani

Information on the .ani file format:

Summary: https://www.gdgsoft.com/anituner/help/aniformat.htm

Detailed: https://web.archive.org/web/20130530192915/http://oreilly.com/www/centers/gff/formats/micriff

Edited by Alx Sa

Merge request reports