Should use the GInputStream APIs in librsvg, not rsvg_handle_write()
As of librsvg 2.45.1, rsvg_handle_write()
and rsvg_handle_close()
are deprecated. They are still present in the API, just deprecated. The recommendation is to use any of librsvg's APIs that take a GInputStream
.
The reason for the deprecation is that the write/close
API needs to buffer the entire SVG data first, and then it feeds it to the streaming API internally. So, there is an extra copy going on.
I'm looking at eog-image.c
to see how it uses librsvg, and eog_image_real_load()
already has a GFileInputStream
. It could simply feed that stream to librsvg. Some questions:
- With streaming, librsvg has no progress indicator API; EOG goes to great lengths to present progress. However...
- Progress indication in EOG seems to work only if I launch EOG first, and then open the image. If I run "
eog big-file.svg
", nothing seems to happen for a little while, and finally the window opens with the image loaded (e.g. it's not opening the window and showing a progress indicator first). - I think progress indicators for images are a hold-over from the past, when everything was slow, but...
- If EOG really wants to preserve progress indication, it would certainly be possible to wrap an existing stream with a
ProgressInputStream
, that emits a signal or whatever when the cursor advances.
This bug is basically to get your thoughts on all of this; I can then submit a MR depending on what you prefer to do