Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Importing SVG
#1
Question 
Hello guys,

This is the situation:

I downloaded a .SVG, specifically this one: https://en.wikipedia.org/wiki/Protractor...ersion.svg

However, after opening it with Gimp, either via File - Open... or via the paths window with Import path, only part of the paths are present in the Paths dialog.

The image below illustrates the situation. In red the existing paths, in black the image correctly created, the white background is just for better visualization.

   

Why is this kind of problem happening?

Can anyone download this SVG and have all the paths displayed in the paths dialog?

Any way around this problem?

Thx!
                               .....
Samj PortableGimp 2.10.28 - Win-10 /64.
Reply
#2
The problem comes from the very basic support of SVG import : only "path" elements and basic shapes (like "rect" or "line") are recognized and added as gimp vectors.
This file https://en.wikipedia.org/wiki/Protractor...ersion.svg has several "text" elements and "use" elements (to make copy of other existing elements) which are simply ignored.

The -hard- way to fix this is to edit the svg file before importing into Gimp.
Quickly tested with Inkscape, you can
  • select all "use" elements and do Edit > Clone > Unlink Clone
  • select all "text" elements and do Path > Object to Path
Reply
#3
Largely as tmanni 

You can get most of the way there from Inkscape & I am using a version 1.2 
Some converted paths, including text from Inkscape, do not always import correctly in Gimp although the bitmap appears correct.

In Inkscape. 
Open the file, and here I get a warning message which I have never seen before, about dpi Wink
Edit -> Select All
Path -> Object to Path
Save as a Plain SVG

Mostly correct although there will be some elements to fix. A long list of paths, use the path tool to click-and-find.

   

In case you do not have Inkscape, attached that adjusted image as a svgz


Attached Files
.svgz   Degree-Radian_Conversion.svgz (Size: 58.65 KB / Downloads: 74)
Reply
#4
An alternative to Inkscape - well known in linux - sk1 - I had to check that it works in Windows

sk1 https://sk1project.net/sk1/download/

Using the portable Windows version: https://i.imgur.com/r26mdYv.jpg

Nothing to do other than open the original svg image and immediately export as another svg file: https://i.imgur.com/5lczam5.jpg

That opens in Gimp (with transparency) and without the path errors: https://i.imgur.com/m7Y1Hpl.jpg
Reply
#5
I was a little disappointed with Gimp's lack of autonomy in dealing with this situation in relation to a .svg

I tried to follow your suggestions regarding editing with Inkscape, but I didn't quite understand what "use" is.

I ended up doing it this way:
Edit > Select All;
Edit > Clone > Unlink Clone (I don't know why this is, but I did it as suggested);
Edit > Select All;
Path > Object to Path.

So I saved it as Plain SVG (I also have no idea the difference between svg and plain svg, but that doesn't matter at the moment).

I thought it worked, but when I opened the file in Gimp I found that there were (as said by rich2005) corrections needed.

I preferred to use the version provided by rich2005 for editing.

A simple task, there are only 1951 paths in the paths dialog.
   
I think I got something satisfying, although I didn't know what to do with that "lost" ellipse between degrees 90 and 110, so I just deleted it.

I was completely unaware of the existence of this SK1, I was interested, and it can save me in case of other future complications like this.
I downloaded the portable win64 version, and I intend to unzip it and test it later this afternoon.

tmanni and rich2005, thanks a lot for your help!
                               .....
Samj PortableGimp 2.10.28 - Win-10 /64.
Reply


Forum Jump: