GNOME Bugzilla – Bug 710310
librsvg can't handle big files anymore
Last modified: 2014-06-18 18:10:49 UTC
libxml2 now requires the XML_PARSE_HUGE option to handle big files. There is currently no way in librsvg to pass this option down, with the result that large files can't be handled. With a gross hack to pass the option everything works perfectly well, there is no underlying library limitation. OG. PS: example of large svg file: http://dspnet.fr/~galibert/m68k/layers.7z
Which limit does it hit, the dict size limit of 10000000 ? I don't think just adding XML_PARSE_HUGE is right, since that'll open up librsvg to the problem that made libxml introduce these limits in the first place…
rvsg parsing failure Error domain 1 code 1 on line 866723 column 1 of data: internal error: Huge input lookup It probably is the 10e6 dict size limit. OG.
*** Bug 719895 has been marked as a duplicate of this bug. ***
(In reply to comment #1) > Which limit does it hit, the dict size limit of 10000000 ? > > I don't think just adding XML_PARSE_HUGE is right, since that'll open up > librsvg to the problem that made libxml introduce these limits in the first > place… What about adding a flag to RsvgHandleFlags. Then programs can opt-in when it's safe. RSVG_HANDLE_FLAGS_HUGE = 1
Yes, I'd accept a patch that adds the flag and corresponding cmdline options for rsvg-convert and rsvg-view.
Created attachment 263898 [details] [review] Added huge flag for large svg processing patch suggested by a.nienhuis
Comment on attachment 263898 [details] [review] Added huge flag for large svg processing Need to add gtk-doc comment to document the RsvgHandleFlags enum, now that it has non-0 flags.
Created attachment 263909 [details] [review] Same as last patch suggestion but with comment for documentation Same as last patch suggestion but with comment for documentation generation as described by gtk-doc
Can someone take a look at this patch? Is there anything else we can do?
patch looks good to me, fwiw
Comment on attachment 263909 [details] [review] Same as last patch suggestion but with comment for documentation +* @RSVG_HANDLE_FLAGS_HUGE: Allows for xml_data over 10 MB to be read I don't like the name of the flag, and the docs isn't quite correct, and also not verbose enough. And the docs should also mention the security implications for using this flag.
The HUGE naming is based upon the underlying flag that is invoked using this one (RSVG_HANDLE_FLAGS_HUGE invokes XML_PARSE_HUGE from libxml2). Thus the name is as logical as it can get I think. As for the changes in documentation I'll see what I can do.