ruuda / pris

A language for designing slides

Home Page:https://docs.ruuda.nl/pris/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support for raster images

ruuda opened this issue · comments

Pris currently supports svg images through Rsvg. It should also support loading raster images. For now png-only (likely through libpng, because Pris depends on it already through Cairo anyway) is fine. Jpeg support would be a nice to have. Supporting other image types is a non-goal; it adds extra complexity but brings little value, as it is easy to convert to a supported format via an external program.

The approach would be something like this:

  • Add an element in src/element.rs, analogous to the Svg element.
  • Update the driver in src/driver.rs to render these elements. This might require adding more Cairo bindings.
  • Update the image builtin in src/builtins.rs to detect the image type from the extension, and to produce a correct Element for the returned frame.

This was implemented in f93864a...c04cba4.