Inkscape SVG imports turn black

Bug #1700120 reported by Tom A
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
New
Undecided
Unassigned

Bug Description

I have attached an SVG file which opens properly in Inkscape 0.92.1 r15371. However, trying to import the same file into a blank or existing Inkscape file turns all objects within the SVG image black. I have searched documentation and cannot find any reason this would be the case. If it opens properly, it should import properly.

Thanks,
Tom

Tags: importing
Revision history for this message
Tom A (tomagnew) wrote :
Revision history for this message
Mc (mc...) wrote :

What was the tool used to create this image ?

The lineargradient elements are direct children of the root svg element and out of the defs, so the import routine (which supposes gradients are in defs) ignores them.

Revision history for this message
Tom A (tomagnew) wrote :

[What was the tool used to create this image ?] I'm not sure, it is a free CC0 license image downloaded from Pixabay.com.

If the image opens fine in Inkscape, is there a straightforward way to know it won't import correctly?

Is there a way to convert the file so it will import correctly?

Thanks,
Tom

Revision history for this message
Alvin Penner (apenner) wrote :

>> If it opens properly, it should import properly.

the "Open" command and the "Import" command are fundamentally different, by design. The Open command will create a complete new document, including the svg root element as well, and will copy and overwrite the existing layer, replacing it with the layer that was defined in your document. The "Import" command, on the other hand, will not change your existing layer that already exists in your open document, but will just paste your new image into the existing layer. It is comparable to a copy and paste operation. Given that these two operations were designed to operate quite differently, I doubt if it will be possible to fix this particular issue.

Revision history for this message
Alvin Penner (apenner) wrote :

>> Is there a way to convert the file so it will import correctly?

is there a specific reason why you are trying to import it, rather than opening it?

Revision history for this message
Alvin Penner (apenner) wrote :

alternatively, have you tried to copy and paste the entire image from one instance of Inkscape into another blank instance of Inkscape? I tried that and it appeared to work okay, apart from possible scaling changes.

Revision history for this message
Mc (mc...) wrote :

> Given that these two operations were designed to operate quite differently, I doubt if it will be possible to fix this particular issue.

I think it's possible, but it would mean replacing the "take the defs of imported doc, put them in the defs [and make any needed arrangements to avoid id conflicts]" by a "scan the importing document for anything that should really be in the defs"

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.