gotcha

Author Topic: Inkscape error when referencing an external svg inside an svg  (Read 5980 times)

June 06, 2017, 08:37:17 AM
Read 5980 times

billctrcain

  • Jr. Member

  • Offline
  • ***

  • 16
I am using and image tag to reference an external svg.  The external svg is displayed by firefox, chrome, and IE but when I try to open the svg in Inkscape it gives the error "Linked image no found".  What is the problem?  The two svg files are attached.

June 06, 2017, 12:15:13 PM
Reply #1

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
If I tell you that when I open test1.svg, I see "Linked Image Not Found", does that start to give you a clue about the problem?

It means that my version of Inkscape can't find it.  It's not where it was when you first imported it.  When you first import it, Inkscape makes a note where it is, so it can find it whenever you open the file.  But if you moved it, even if it's on the same computer, Inkscape can't find it.

Hhm....but you're not talking about an imported raster image.  You're talking about another SVG file.  I'm not familiar with how that's supposed to be done.

I would say, try putting in the path to the SVG file (instead of just the file name).  But I can't be sure whether the image tag is right or not.

Hopefully someone else will have an idea, if using the path instead of the file name doesn't fix it.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

June 06, 2017, 01:41:10 PM
Reply #2

billctrcain

  • Jr. Member

  • Offline
  • ***

  • 16
Here is the second svg.

June 06, 2017, 03:06:35 PM
Reply #3

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Yes, I saw the 2nd one before.  What is it that you want us to see?

Did you not understand my answer?  If you want the SVG linked, I think you'll need to add the whole path to it, instead of just the file name.  (Inkscape has no search facility, to search your computer for a file name.  It needs a path to follow.)

If you want the other SVG embedded, so that you can take the file from one computer to another, and still have the other SVG visible, I think you need to put the entire SVG (XML) code from the other SVG file, somehow, inside the code for the parent file.  Image tag seems as good as any, but I'm certainly no expert on XML/SVG code.

If these things don't help, I'm sure someone else will be along shortly, who has a better answer.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

June 07, 2017, 04:42:39 AM
Reply #4

billctrcain

  • Jr. Member

  • Offline
  • ***

  • 16
I sent the svg the second time because it first appeared to me that I had sent the first file twice.  Anyway, I have some large svg files that I want to use as background and I don't want huge svg files.  That is why I want to reference the second svg.  I have tried using an absolute path for the second svg but that did not work.  Based on my research, using an image to reference an external svg is the preferred method.  Thanks for your suggestions.  It doesn't make sense why Inkscape can't find the external file.

June 07, 2017, 07:17:35 AM
Reply #5

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
I'll do some more research on SVG/XML, and try to find the answer.  I'll post back what I find.

I suppose using a PNG for the background would be unacceptable?
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

June 07, 2017, 07:34:42 AM
Reply #6

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Could possibly be embed tag?  http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Web-Use.html#Web-Use-Embed  I know that embedding a raster image does make the file much larger.  But not sure about SVG image?

I found this.  It sounds like what you want to do is explained in there, but I'm not 100% positive.  https://www.w3.org/wiki/SVG_Links.

I think in here, it also seems to explain what you're asking, although it uses CSS:  https://css-tricks.com/using-svg/

Or what about this?  https://stackoverflow.com/questions/5451135/embed-svg-in-svg
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

June 07, 2017, 09:36:53 AM
Reply #7

billctrcain

  • Jr. Member

  • Offline
  • ***

  • 16
Using PNG is not viable.  The second link (W3C) describes exactly what I am doing in the parent svg.  I don't think the method is the issue since all three browsers that I have tried, render the image and the method that I am using is described by W3C.  Why is Inkscape having a problem with it?

June 08, 2017, 05:05:20 PM
Reply #8

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Ok, let's go for the big guns! 

David Dailey is an SVG guru.  Even though his website looks sparse (and not so polished) if you follow the links, you realize there is tons of high level info there (in between a lot of info on animaion).  http://srufaculty.sru.edu/david.dailey/  Specifically his book is a little like the SVG "bible".  Although I'm not sure if there's a free online version or not.  Plus, the browser info is outdated anyway.

!!However, I do hear that you think it's an Inkscape problem. 

So let's go where developers and advanced Inkscape users can help.  That would be the User Community mailing list https://inkscape.org/en/community/mailing-lists/.  If you don't want to subscribe to the list (which is required to post a message) I'd be glad to make the post for you.  And you can follow the thread in the archives:  https://sourceforge.net/p/inkscape/mailman/inkscape-user/

Or you could try either development or user IRC:  https://inkscape.org/en/community/discussion/  IRC is a little hit and miss, since the particular person who has your answer, may or may not be available, at the time you post.  I've heard advice such as waiting 45 miin to an hour, before you give up.  Still no response, try some hours later, or day later.

Just let me know if you want me to post to the mailing list  :-)
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

June 09, 2017, 02:06:03 PM
Reply #9

Moini

  • IC Mentor

  • Offline
  • ******

  • 1,568
    • VektorRascheln
Works for me (after adding a file named test2.svg into the same directory) - Inkscape opens and tells me 'broken links have been changed to existing files', and displays the picture. This is with Inkscape 0.92.1 .

However, there is this little issue for export: https://bugs.launchpad.net/inkscape/+bug/171795

June 09, 2017, 05:00:16 PM
Reply #10

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Maybe that's the problem, that he didn't have the 2 files in the same directory?
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

June 12, 2017, 05:28:23 AM
Reply #11

billctrcain

  • Jr. Member

  • Offline
  • ***

  • 16
Thanks for the info and suggestions Bryan.  I appreciate your help.  Unfortunately for me, I do have the files in the same directory or the browsers wouldn't find the linked file either.  I tried to open with Inkscape again and still get the same error.  Moini, you said you tried opening with Inkscape and got the message 'broken links have been changed to existing files' but the file was displayed.  It does appear that Inkscape did find something it didn't like about the link.  You do have a slightly newer version than I.  I think that I will try the newer version.  If that doesn't work, I guess I'll post with the community email and see what they have to say.

June 12, 2017, 06:16:36 AM
Reply #12

billctrcain

  • Jr. Member

  • Offline
  • ***

  • 16
Installing the latest version of Inkscape didn't solve the issue.  I browsed the bug chain listed in the previous post and found the this is a bug that hasn't yet been fixed in the windows version of Inkscape. Follow the chain to https://bugs.launchpad.net/inkscape/+bug/1271938.

June 12, 2017, 07:22:11 AM
Reply #13

Moini

  • IC Mentor

  • Offline
  • ******

  • 1,568
    • VektorRascheln
Yes, I'm on Linux - seems there could be a difference...

June 12, 2017, 11:08:27 PM
Reply #14

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Well I don't quite make the connection between your problem and the bug you referenced (missing template preview).  But the report does mention some missing lib or libs.

I use Windows, and I'd be glad to test for you.  But I don't completely understand how you placed the 2nd SVG file inside the first.  If you can give me steps, I'll be glad to make a test.

Maybe a more specific bug report would be needed for this?  I don't know if the missing libs in the report you referenced are the same ones missing for you.  And if they aren't, a bug report for  your specific issue and specific libs might not exist.  If I can reproduce the problem, you and/or I could make a new specific report, and have a better chance of getting it fixed.

Although by the report which Moini referenced, it sounds like even if this were fixed, and the linked SVG file could be seen, it would be rasterized.

But anyway, if you can give me specific steps, I'll be glad to try and reproduce the problem.  (As I'm beginning to understand it more clearly, it seems surprising that it hasn't been reported before.  Maybe I'll try searching the bug reports too.)
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

June 12, 2017, 11:12:09 PM
Reply #15

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Hey, I found this:  https://bugs.launchpad.net/inkscape/+bug/1659347  Could the wrong slash (after saving) cause this?  If so, since the report indicates "fix commited" there's a good chance using the development version of Inkscape might solve your problem.

Edit
But if not, I'm still glad to try and reproduce, if you like.

Edit #2 - decided to move this thread to a different board
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

June 13, 2017, 10:40:48 AM
Reply #16

billctrcain

  • Jr. Member

  • Offline
  • ***

  • 16
Hey Bryan.  You're right about the bug link.  I think the correct link is https://bugs.launchpad.net/inkscape/+bug/168244.  The other bug that you mentioned on the last post doesn't apply since I am not using a '/' in my reference.  Also I tested the issue after copying in the two other dlls.  Didn't solve the problem.  To answer your question about how to link in the second svg, see the following example:

  <image
     xlink:href="test2.svg"
     width="300"
     height="300"
     x="30"
     y="30" />

The  xlink:href="test2.svg" says link in the file "test2.svg" located in the working directory (the same directory as "test1.svg").  You could use a relative path from the working directory like "image/test2.svg" or an absolute path like "C:/working_directory/image/test2.svg".  As long as the file is located where you say it is, it should find the file.

June 13, 2017, 01:46:23 PM
Reply #17

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Ok, so the last report you mentioned #168244 is marked as a duplicate of #171795 which is the one Moini found.  I can't make much sense of the detailed discussions, because it's over my head.  Since the problem reported in #168244 is "Linked Image not Found" and the problem in #171795 is that the image appears but it's rasterized, it's hard for me to see them as even similar.  But of course I have to trust the developers, since I don't understand.

If you're saying that #168244 seems to explain the results you're getting, then there isn't any need for me to try and reproduce it.  But if you're still not sure, or you're seeing things not mentioned in the report, which perhaps should be mentioned, I think I understand what to do, to try and reproduce it.  There hasn't been any new comment to #168244 in over 2 years, and just under 2 years for the other report.  So if there is any new info that might be helpful, it would be good to post it there.

Do you still want me to try and reproduce, or are you satisfied that #168244 is the same problem you're seeing?

(It would also be reasonable the post a new comment saying something like 'this problem is still happening, and is a big problem for me - is there any new info I could provide to get work started to fix this'.  Or something like that.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

June 15, 2017, 05:56:06 AM
Reply #18

billctrcain

  • Jr. Member

  • Offline
  • ***

  • 16
Thanks Brynn.  I do think my issue is the same one described in the bug.  There appears to me to be some debate among the developers whether the track the two issues together or separately.  Anyway, I think I will make a new post in the bug.  I would like to see this fixed.

March 21, 2018, 09:09:54 AM
Reply #19

tommynoshitsky

  • Newbie

  • Offline
  • *

  • 1
  • Personal Text
    http://tommyrgb.com/
I usually create with photoshop my designs, although it has never been an issue in the past, I can export the SVG if I open it with inkscape afterwards.
Most of my designs are including render images, I use tracing to convert them as vectors for the one I need to be cut by my laser cuter...
That way I can have it ready for printing using my Glowforge laser.
I use inkscape on a late 27 inch imac, I7 3.5ghz, 32gb of ram and it seems to be working so far.
My problem is happening on my latest purchase, macbook pro 2016 500gb, 8gb 0f ram. I CANT export anymore the svg files through inkscape when they are imported from photoshop.
It seems like the render images are "href"rather than embedded in and don't show in the file, plus the preview through finder shows a error message with bad code at a certain line which is most often the render image in the  file...
I really need this to be fixed in order to use my laser cutter for multiple projects, hoping you guys can find out what's going on...
  • 0.92.2
  • mac os 10.13.3

March 21, 2018, 12:24:09 PM
Reply #20

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Welcome to the forum!

Is your problem exactly the same as whoever started this topic?  If so, have you tried the solutions which were suggested for that person?

It sounds to me like your problem is a little different, so I want to move your message into a topic by itself.  Is that ok with you?

While I understand your question in general, it a little bit outside my experience.  So I won't try to answer right away, because others will be able to help you better.  But, I can make your message separate, so they aren't confused.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann