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 theSvg
element. - Update the driver in
src/driver.rs
to render these elements. This might require adding more Cairo bindings. - Update the
image
builtin insrc/builtins.rs
to detect the image type from the extension, and to produce a correctElement
for the returned frame.
This was implemented in f93864a...c04cba4.