Skip to main content

Module preview

Module preview 

Source
Expand description

Mod preview images from the mod sites: PNG, JPEG or WebP (by their first bytes, since sites name files with the wrong extension: banishedinfo.com’s .png are often JPEG, and Nexus Mods’ CDN sends WebP for .jpg addresses), decoded to RGBA for the game’s and the mod manager’s lists.

Structs§

Image
A decoded image: width, height and RGBA pixels, row by row.

Constants§

MAX_SIDE
The largest preview decoded, in pixels on each side; larger images are refused.

Functions§

decode
Decode a PNG, JPEG or WebP image, or None for anything else or a damaged file.