Welcome to TalkGraphics.com
Results 1 to 10 of 10
  1. #1
    Join Date
    Apr 2019
    Posts
    1

    Default Export SVG is corrupt?

    Hi,

    I just recently needed to create some SVG icons for an app project and I thought I'd use my nomal go-to solution for anything graphic: Xara (P&GD 10)

    The thing is the SVG files seems to always contain alot of stuff, not just the graphics I marked for export. An example: I created two concentric circles, marked all and exported it as SVG. There was nothing else on the page. Still, the resulting SVG is filled with all kinds of stuff:



    Code:
    <?xml version="1.0" standalone="no"?>
    <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
    <!--Generator: Xara Designer (www.xara.com), SVG filter version: 5.0.0.2-->
    <svg stroke-width="0.501" stroke-linejoin="bevel" fill-rule="evenodd" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" version="1.1" overflow="visible" width="22.5pt" height="22.5pt" viewBox="0 0 22.5 22.5">
     <defs>
      <marker id="DefaultArrow2" markerUnits="strokeWidth" viewBox="0 0 1 1" markerWidth="1" markerHeight="1" overflow="visible" orient="auto">
       <!-- REF_ARROW_STRAIGHT (-2) -->
       <g transform="scale(0.0092592592)">
        <!-- 1/108 -->
        <path d="M -9 54 L -9 -54 L 117 0 z"/>
       </g>
      </marker>
      <marker id="DefaultArrow3" markerUnits="strokeWidth" viewBox="0 0 1 1" markerWidth="1" markerHeight="1" overflow="visible" orient="auto">
       <!-- REF_ARROW_ANGLED -->
       <g transform="scale(0.0092592592)">
        <path d="M -27 54 L -9 0 L -27 -54 L 135 0 z"/>
       </g>
      </marker>
      <marker id="DefaultArrow4" markerUnits="strokeWidth" viewBox="0 0 1 1" markerWidth="1" markerHeight="1" overflow="visible" orient="auto">
       <!-- REF_ARROW_ROUNDED -->
       <g transform="scale(0.0092592592)">
        <path d="M -9,0 L -9,-45 C -9,-51.708 2.808,-56.580 9,-54 L 117,-9 C 120.916,-7.369 126.000,-4.242 126,0 C 126,4.242 120.916,7.369 117,9 L 9,54 C 2.808,56.580 -9,51.708 -9,45 z"/>
       </g>
      </marker>
      <marker id="DefaultArrow5" markerUnits="strokeWidth" viewBox="0 0 1 1" markerWidth="1" markerHeight="1" overflow="visible" orient="auto">
       <!-- REF_ARROW_SPOT -->
       <g transform="scale(0.0092592592)">
        <path d="M -54, 0 C -54,29.807 -29.807,54 0,54 C 29.807,54 54,29.807 54,0 C 54,-29.807 29.807,-54 0,-54 C -29.807,-54 -54,-29.807 -54,0 z"/>
       </g>
      </marker>
      <marker id="DefaultArrow6" markerUnits="strokeWidth" viewBox="0 0 1 1" markerWidth="1" markerHeight="1" overflow="visible" orient="auto">
       <!-- REF_ARROW_DIAMOND -->
       <g transform="scale(0.0092592592)">
        <path d="M -63,0 L 0,63 L 63,0 L 0,-63 z"/>
       </g>
      </marker>
      <marker id="DefaultArrow7" markerUnits="strokeWidth" viewBox="0 0 1 1" markerWidth="1" markerHeight="1" overflow="visible" orient="auto">
       <!-- REF_ARROW_FEATHER -->
       <g transform="scale(0.0092592592)">
        <path d="M 18,-54 L 108,-54 L 63,0 L 108,54 L 18, 54 L -36,0 z"/>
       </g>
      </marker>
      <marker id="DefaultArrow8" markerUnits="strokeWidth" viewBox="0 0 1 1" markerWidth="1" markerHeight="1" overflow="visible" orient="auto">
       <!-- REF_ARROW_FEATHER2 -->
       <g transform="scale(0.0092592592)">
        <path d="M -36,0 L 18,-54 L 54,-54 L 18,-18 L 27,-18 L 63,-54 L 99,-54 L 63,-18 L 72,-18 L 108,-54 L 144,-54 L 90,0 L 144,54 L 108,54 L 72,18 L 63,18 L 99,54 L 63,54 L 27,18 L 18,18 L 54,54 L 18,54 z"/>
       </g>
      </marker>
      <marker id="DefaultArrow9" markerUnits="strokeWidth" viewBox="0 0 1 1" markerWidth="1" markerHeight="1" overflow="visible" orient="auto">
       <!-- REF_ARROW_HOLLOWDIAMOND -->
       <g transform="scale(0.0092592592)">
        <path d="M 0,45 L -45,0 L 0, -45 L 45, 0 z M 0, 63 L-63, 0 L 0, -63 L 63, 0 z"/>
       </g>
      </marker>
      <filter id="StainedFilter">
       <feBlend mode="multiply" in2="BackgroundImage" in="SourceGraphic" result="blend"/>
       <feComposite in="blend" in2="SourceAlpha" operator="in" result="comp"/>
      </filter>
      <filter id="BleachFilter">
       <feBlend mode="screen" in2="BackgroundImage" in="SourceGraphic" result="blend"/>
       <feComposite in="blend" in2="SourceAlpha" operator="in" result="comp"/>
      </filter>
      <filter id="InvertTransparencyBitmapFilter">
       <feComponentTransfer>
        <feFuncR type="gamma" amplitude="1.055" exponent=".416666666" offset="-0.055"/>
        <feFuncG type="gamma" amplitude="1.055" exponent=".416666666" offset="-0.055"/>
        <feFuncB type="gamma" amplitude="1.055" exponent=".416666666" offset="-0.055"/>
       </feComponentTransfer>
       <feComponentTransfer>
        <feFuncR type="linear" slope="-1" intercept="1"/>
        <feFuncG type="linear" slope="-1" intercept="1"/>
        <feFuncB type="linear" slope="-1" intercept="1"/>
        <feFuncA type="linear" slope="1" intercept="0"/>
       </feComponentTransfer>
       <feComponentTransfer>
        <feFuncR type="gamma" amplitude="1" exponent="2.4" offset="0"/>
        <feFuncG type="gamma" amplitude="1" exponent="2.4" offset="0"/>
        <feFuncB type="gamma" amplitude="1" exponent="2.4" offset="0"/>
       </feComponentTransfer>
      </filter>
     </defs>
     <g id="Document" fill="none" stroke="black" font-family="Times New Roman" font-size="16" transform="scale(1 -1)">
      <g id="Spread" transform="translate(0 -22.5)">
       <g id="Layer 1">
        <path d="M 29.903,9.755 C 28.995,15.896 33.242,21.62 39.383,22.529 C 45.524,23.437 51.248,19.19 52.157,13.049 C 53.065,6.908 48.818,1.184 42.677,0.275 C 36.536,-0.633 30.812,3.614 29.903,9.755 Z M 42.503,1.451 C 47.995,2.265 51.794,7.384 50.981,12.875 C 50.167,18.367 45.048,22.166 39.557,21.353 C 34.065,20.539 30.266,15.42 31.079,9.929 C 31.893,4.437 37.012,0.638 42.503,1.451 Z" stroke-linejoin="miter" stroke="none" fill="#ffffff" stroke-width="1.318" marker-start="none" marker-end="none" stroke-miterlimit="79.8403193612775"/>
        <path d="M 38.646,20.406 C 43.616,21.722 48.719,18.756 50.034,13.786 C 51.35,8.816 48.384,3.713 43.414,2.398 C 38.444,1.082 33.341,4.048 32.026,9.018 C 30.71,13.988 33.676,19.091 38.646,20.406 Z" stroke-linejoin="miter" stroke="none" fill="#ffffff" stroke-width="1.468" marker-start="none" marker-end="none" stroke-miterlimit="79.8403193612775"/>
       </g>
      </g>
     </g>
    </svg>
    I have tried all three types of export options but the result seems to be the same.

    Is the SVG export feature flawed or what is going on?

    Cheers!

  2. #2
    Join Date
    Aug 2000
    Location
    Placitas, New Mexico, USA
    Posts
    41,487

    Default Re: Export SVG is corrupt?

    Welcome to TalkGraphics

    This first time post was moderated because of the script. I have approved it.

    Someone else will have to answer this.

    However, aside from the script, is the image OK?
    Last edited by gwpriester; 11 April 2019 at 02:08 AM.

  3. #3
    Join Date
    Aug 2000
    Location
    Harwich, Essex, England
    Posts
    21,895

    Default Re: Export SVG is corrupt?

    Hi Moggel and welcome to Talk graphics.

    svg files do contain a lot of code that means nothing to me or most users. However having said that copying your code above and trying to view it shows nothing but a white blank page. It contains one group and after several ungrouping I see two circles only in wireframe.

    Perhaps it would help if you posted your .xar or .web file?
    Egg

    Intel i7 - 4790K Quad Core + 16 GB Ram + NVIDIA Geforce GTX 1660 Graphics Card + MSI Optix Mag321 Curv monitor
    + Samsung 970 EVO Plus 500GB SSD + 232 GB SSD + 250 GB SSD portable drive + ISP = BT + Web Hosting = TSO Host

  4. #4
    Join Date
    May 2014
    Location
    Australia: GMT+10
    Posts
    265

    Default Re: Export SVG is corrupt?

    Try using Inkscape (it's free!). I'm no expert with it, but it seems quite capable and this file I just made opens in Xara Designer Pro 12.

    2circles.svg

  5. #5
    Join Date
    Feb 2007
    Location
    UK
    Posts
    21,283

    Default Re: Export SVG is corrupt?

    as i recall if you export svg from xara it will export everything on the layer to the svg, selected or not

    it looks to me like there is more in your file than just the concentric circles - worth checking to see if there are other things off the page, with or without transparency
    -------------------------------
    Nothing lasts forever...

  6. #6
    Join Date
    Feb 2007
    Location
    UK
    Posts
    21,283

    Default Re: Export SVG is corrupt?

    like egg I made an svg from your code: source code.svg

    different result to egg but still a group, but two concentric circle shapes so:

    Click image for larger version. 

Name:	2019-04-11 12_59_36-Xara Designer Pro X - [Untitled1 _].png 
Views:	104 
Size:	11.7 KB 
ID:	123869

    as in this xara designer pro 15.1 file: concentric circles.xar

    exporting from this xar file I get a file where the code is a lot 'cleaner' : export.svg

    The svg export filter you used in p&G10 10 is ver 5.0.0.2, whereas the svg export filter used by xara pro designer 15.1 is ver 6.2.0.0 - that may make a difference, I don't have your program to check

    but i didn't find anything wrong as such, nor were there any other objects as far as i could see
    -------------------------------
    Nothing lasts forever...

  7. #7
    Join Date
    Nov 2000
    Location
    Manchester, UK
    Posts
    172

    Default Re: Export SVG is corrupt?

    The only issue I have found with svg export, is that it will fail if the xara file includes a bitmap.
    I guess the clue is in the file extension name, Scalable VECTOR Graphic.

  8. #8
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,746

    Default Re: Export SVG is corrupt?

    For what it's worth, delete the <defs> tags and inner content and save as SVG.

    A subsequent Xara import produces a white circle and its larger ring but grouped needlessly twice over.

    Acorn
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  9. #9
    Join Date
    Feb 2007
    Location
    UK
    Posts
    21,283

    Default Re: Export SVG is corrupt?

    indeed as in image and xar file in post #6... without deleting any tags; I inclined to think it's not really an issue...
    -------------------------------
    Nothing lasts forever...

  10. #10
    Join Date
    Aug 2000
    Location
    Placitas, New Mexico, USA
    Posts
    41,487

    Default Re: Export SVG is corrupt?

    Still waiting to hear from Moggel. Are you there? Or was this a drive-by posting?

 

 

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •