Forum Bugs

Prince 14.3: still issues with huge data:URLs

Johann
In our documents we embed all images with data: URLs, but always had problems with huge (several MB) PNG images.

The release notes for Prince 14.3 announced improvements in decoding data: URLs, but the conversion of some our documents still fails!

For example: we have an image tag with a data: URL attribute that starts at column 13725 and ends at column 20479816 of the same line.

The conversion fails with errors:

prince: test.xhtml:1011: error: internal error: Huge input lookup
prince: test.xhtml:1011: error: attributes construct error
prince: test.xhtml:1011: error: Couldn't find end of Start Tag img line 1011
prince: test.xhtml:1011: error: Premature end of data in tag div line 1011
prince: test.xhtml: error: could not load input file
prince: error: failed to load all input documents

- - -
Johann

mikeday
It appears to be a limit of the XML parser, we should be able to fix this, in the meantime perhaps you could use HTML instead with "-i html"?
Johann
Thanks - that parses the big images!

But it does not immediately resolve the issue for our documents, because we also have the CSS styles inline.That leads to other error messages like:

prince: test.xhtml:style:786: warning: parse error in selector at '&'


As a workaround I currently urge every team member to import reasonably sized images.

- - -
Johann

mikeday
I'm curious where that error is coming from, are you using XML entities in the style element?
Johann
It's simple the line:

h2+div.figure>img, h3+div.figure>img, h4+div.figure>img { max-height: 210mm; }


In this case the > selector.

- - -
Johann

mikeday
Oh right, in HTML these characters do not need to be escaped inside the <style> element while in XML they do.