Inkscape.org
Beyond the Basics Strange crashing when trying to view a hidden layer
  1. #1
    lobaluna lobaluna @lobaluna

    Hello, everybody

    I received a SVG that I paid which is made entirely in Inkscape. The designer decided to pack 83 different vector images in one file, one image per layer. Not a bad idea as she planned to use same palette, typography, etc. for all layers.

    My problem is that I cannot export each layer because the files crahses continuosly.

    Firstly I have tried to use the command-line, but i doesn't like to work:

    $ inkscape --batch-process --actions="export-id-only; export-id:layer83; export-filename:glosario_layer83.png; export-do; export-id:layer82; export-filename:glosario_layer82.png;" glosario-genetico.svg
    

    I am using this line in Lubuntu 20.10 with distro-repos Inkscape (Inkscape 1.0.1 (3bc2e813f5, 2020-09-07). Pango version: 1.46.2), no snap, no flatpak.

    Secondly, it crashes whenever I try to Show a layer in GUI. It crashes after two seconds after I clic on the icon. Here is the output:
     

    ** (org.inkscape.Inkscape:7138): CRITICAL **: 22:47:27.788: Glib::ustring sp_attribute_clean_style(Inkscape::XML::Node*, const gchar*, unsigned int): assertion 'repr->type() == Inkscape::XML::ELEMENT_NODE' failed
    
    (org.inkscape.Inkscape:7138): glibmm-ERROR **: 22:47:27.794: 
    unhandled exception (type std::exception) in signal handler:
    what: basic_string::_M_construct null not valid
    
    Trace/breakpoint trap (core dumped)

    I mean, I can open the file and see the Fonts substitution dialog, but later, when trying to work on the file, it crashes.

     

    I really need to export the images, and be able to see each layer alone.

     

    How can I repair the XML file so I can work on it?

    How can I batch export all layers, each layer on one image?

    Glosario Genetico
  2. #2
    Tyler Durden Tyler Durden @TylerDurden

    I used an extension "Export layers to SVG" (Inkscape v.92.2) . It worked ok after removing the slashes (/) from the layer labels. 

    Because of the large number of filters used in the images, I suggest keeping the Inkscape window as small as possible.

    Exportedlayers
  3. #3
    lobaluna lobaluna @lobaluna

    Hi, @TylerDurden !

    Thanks for your quick response. The extension worked well. I did as you suggested (removing the slashes from the names in some layers).

    However, the text objects in most layers were exported with the minimal size. I suppose the designer did not standarize the style for all of them.

    I also found another extension, which can accomplish the same job (except for exporting to PNGor JPEG). It didn't worked in my case (I believe because I use python3; maybe I will tinker it so it can work on my system): https://github.com/jespino/inkscape-export-layers

     

    Thank you very much. I can say that my problem is solved!

Inkscape Inkscape.org Inkscape Forum Beyond the Basics Strange crashing when trying to view a hidden layer