decoder: Use glycin for image loading expect SVG

This gives us sandboxed image decoding and others the
option to extend Loupe with other image formats.
This commit is contained in:
Sophie Herold 2023-05-23 01:49:40 +02:00
parent d690c0e2d8
commit 1b2dde79b6
18 changed files with 536 additions and 1416 deletions

View file

@ -418,7 +418,7 @@ impl LpPrint {
let texture_scale = self.user_width() / orig_width as f64;
let cairo_scale = cairo_dpi / self.dpi();
let cairo_surface = if let Some(decoder::ImageFormat::Svg) = image.format() {
let cairo_surface = if image.format().map_or(false, |x| x.is_svg()) {
// Render SVG to exact needed sizes
// TODO: This should be async
decoder::formats::Svg::render_print(