Preset Bundle
A preset as one .rotopreset file: a ZIP of exactly three entries, preset.json, palette.hex and ramps.json.
Properties
Functions
Reads a bundle from path. A bundle comes from someone else, so: a file over 1 MB is refused before it is opened; only the three fixed entry names are accepted (any other entry, separator or .. is refused, and no entry name is ever used as a path); at most three entries are read, each at most 256 KB uncompressed, counted while streaming rather than taken from the headers; and every model is validated by its own codec. Nothing is written anywhere. Every failure is a PresetException naming the entry.
Writes preset to path through AtomicFile. Entries come in a fixed order with a fixed timestamp and compression level, and no extra field or comment, so the same preset always gives the same bytes.