From Gnash Project Wiki

Jump to: navigation, search

Dynamically-loaded bitmap movies use the ImageInput base class. The format is detected from the initial bytes of the file to be loaded, and Gnash selects the correct derived class based on this.

To implement loading a new format:

  • Derive your class from ImageInput.
  • Enumerate the new filetype in libcore/gnash.h (enum FileType).
  • Add the byte magic signature to getFileType() (libcore/impl.cpp)
  • Modify image::readImageData() to use the new derived class for the filetype.
  • No other changes should be necessary.

JPEG, PNG and GIF images are supported now: this fulfils SWF8 requirements.

The same applies to writing bitmaps, with obvious modifications.