Do not load images with gdk-pixbuf; use Rust loaders instead
This removes the internal use of gdk-pixbuf for decoding images (e.g. when embedded with an element), and uses the image-rs crate instead, which uses Rust-based loaders.
What I hope won't be a breaking change, is that this commit also restricts librsvg to being able to decode only images in these formats:
- JPEG (required by the SVG spec)
- PNG (required by the SVG spec)
- GIF (not required by the spec)
- WebP (not required by the spec)
This is per the SVG spec's minimum requirements - https://www.w3.org/TR/SVG2/conform.html#ConformingSVGViewers
I don't know if anyone is embedding e.g. TIFFs or BMPs in SVGs rendered with librsvg. We'll find out if people complain!
JPEG decoding is not bit-identical to libjpeg-turbo. In the test suite, these three reference images needed updating, since they use JPEGs:
filters-composite-04-f-ref.png filters-conv-02-f-ref.png filters-conv-04-f-ref.png
This is based on a patch by Emile Snyder.
The purpose of decoding raster images in Rust, rather than with the traditional C libraries, is this:
- Reduce the amount of memory unsafe code from codecs.
- Make it easier to use librsvg on Windows and MacOS, where setting up gdk-pixbuf is tricky.
- Encourage the Rust-based codecs to improve, given more users. There's plenty of interesting work to be done here.
- Remove one more place where gdk-pixbuf is used in the GNOME platform, with the idea of phasing it outg.