13 Dec
2004
13 Dec
'04
5:51 p.m.
The following patch to sp-image.cpp allows Inkscape to read Adobe Illustrator files that have the "data:;base64" syntax for embedded images. The embedded images are displayed correctly on the screen. However, if you save the file, the resulting svg output still has "data:;base64", which is obviously a Bad Thing. I started looking around in the code for where the output happens, but C++ isn't a language I'm very comfortable with, and I rapidly got lost. I'd be grateful for any insight from anyone who understands the code and the language better. I'd prefer not to commit the patch for the input without making the output standards-compliant.
===================== patch to sp-image.cpp =======================
902a903,913
// bcrowell, 2004 dec 13: // Adobe Illustrator writes output like this: // data:;base64, // This is illegal according to the SVG standard, but there seems to be a consensus // on inkscape-devel that Inkscape should allow input like this anyway. It would // be nice to do a better syntax check here, but Lauris Kaplinski's old-school C parser // is already pretty complicated; probably we should be using a C++ regular expression // library instead. The following line allows input of lame Illustrator SVG: data_is_image = 1; // However, the output isn't any more correct than the input.