Page MenuHomePhabricator

Several thumbnail sizes of SVG with large gradientTransform fail
Open, Stalled, LowPublic

Description

I was pointed out to the following broken thumbnail: https://upload.wikimedia.org/wikipedia/commons/thumb/1/1e/Zevenhuizen_Moerkapelle_wapen.svg/375px-Zevenhuizen_Moerkapelle_wapen.svg.png

The commons image page is: https://commons.wikimedia.org/wiki/File:Zevenhuizen_Moerkapelle_wapen.svg

As you can see (hopefully) is that the thumbnail is not completely generated, only the bottom part. Not sure if this is a one off, or a more general problem.

Upstream issue: https://gitlab.gnome.org/GNOME/librsvg/-/issues/683 https://gitlab.gnome.org/GNOME/librsvg/-/issues/720


filelibrsvg2.44 (no rendering)firefox rendering
https://commons.wikimedia.org/wiki/File:T214738.svg
Screenshot 2023-05-17 at 23-01-33 File T214738.svg – Wikimedia Commons.png (947×1 px, 108 KB)
Screenshot 2023-05-17 at 23-02-11 Cairo error out of memory with linearGradient gradientTransform ... gradientUnits userSpaceOnUse (#720) · Issues · GNOME _ librsvg · GitLab.png (252×375 px, 2 KB)

Event Timeline

Aklapper renamed this task from image corruption to Several PNG thumbnail sizes of a specific SVG image do not display correctly.Jan 26 2019, 1:36 PM
Aklapper added a project: Thumbor.

Seems like this happens only for some sizes. Probably a librsvg bug.

Cannot reproduce locally with rsvg-convert -h 375 -f png -o Zevenhuizen_Moerkapelle_wapen.png Zevenhuizen_Moerkapelle_wapen.svg but I'm already on librsvg2-2.44.13-1.fc29.x86_64 (plus I guess we don't use rsvg-convert for this job).

We do use rsvg-convert, Stretch is on libsrvg 2.40.16-1. This is very likely to be something that would be fixed by a librsvg upgrade.

Looks like librsvg may have regressed on this issue since 2.44.13, as conversion fails for all thumbnails where the width is between 310 and 395 inclusive using 2.48.4.

$ RUST_BACKTRACE=full rsvg-convert -w 395 -f png -u -o Zevenhuizen_Moerkapelle_wapen.svg.png Zevenhuizen_Moerkapelle_wapen.svg
thread '<unnamed>' panicked at 'Cairo error "out of memory"', /build/.cargo/registry/src/github.com-1ecc6299db9ec823/cairo-rs-0.8.1/src/enums.rs:274:13
stack backtrace:
   0:     0x7ff4c0d104df - <unknown>
   1:     0x7ff4c0b74eec - <unknown>
   2:     0x7ff4c0d0f9c6 - <unknown>
   3:     0x7ff4c0d0f610 - <unknown>
   4:     0x7ff4c0d0edd6 - <unknown>
   5:     0x7ff4c0d0e978 - <unknown>
   6:     0x7ff4c0d0e920 - <unknown>
   7:     0x7ff4c0ca53ce - <unknown>
   8:     0x7ff4c0ca4758 - <unknown>
   9:     0x7ff4c0c84895 - <unknown>
  10:     0x7ff4c0c84653 - <unknown>
  11:     0x7ff4c0c82e79 - <unknown>
  12:     0x7ff4c0c83d66 - <unknown>
  13:     0x7ff4c0cbcdd4 - <unknown>
  14:     0x7ff4c0c7f629 - <unknown>
  15:     0x7ff4c0cbcc3d - <unknown>
  16:     0x7ff4c0c84895 - <unknown>
  17:     0x7ff4c0c84653 - <unknown>
  18:     0x7ff4c0c82e79 - <unknown>
  19:     0x7ff4c0c83d66 - <unknown>
  20:     0x7ff4c0ca1f6b - <unknown>
  21:     0x7ff4c0c7f629 - <unknown>
  22:     0x7ff4c0ca15cf - <unknown>
  23:     0x7ff4c0c84895 - <unknown>
  24:     0x7ff4c0c84653 - <unknown>
  25:     0x7ff4c0c82e79 - <unknown>
  26:     0x7ff4c0d081cf - <unknown>
  27:     0x7ff4c0d07e8c - <unknown>
  28:     0x7ff4c0b58209 - rsvg_rust_handle_render_cairo_sub
  29:     0x55eaf1b7c9af - <unknown>
  30:     0x7ff4c0349002 - __libc_start_main
  31:     0x55eaf1b7d7de - <unknown>
  32:                0x0 - <unknown>
fatal runtime error: failed to initiate panic, error 5
fish: “RUST_BACKTRACE=full rsvg-conver…” terminated by signal SIGABRT (Abort)

If it works on 2.44.10-2.1 (the current Debian buster version) we should be fine for a while though.

JoKalliauer changed the task status from Open to Stalled.Apr 30 2021, 7:04 PM
JoKalliauer triaged this task as Low priority.
JoKalliauer subscribed.

I reported it upstream: https://gitlab.gnome.org/GNOME/librsvg/-/issues/720 (with rsvg-convert version 2.48.9)

JoKalliauer renamed this task from Several PNG thumbnail sizes of a specific SVG image do not display correctly to Several thumbnail sizes of SVG with large gradientTransform fail.May 9 2021, 4:25 PM