image import and export problem

fbeleznay shared this question 3 years ago
Answered

I ran into some problems when I was trying to export the graphics view and importing images. Here are some details:

  • When I export as PDF, a white border is added around the actual graphics view (I attach a PDF export and the export of the same graphics view as PNG). I personally could use a PDF better (when embedding in documents) without this extra border.
  • When I export as SVG, the result look different depending on what software I use to open the SVG file with. In the SVG file, the correct dimensions are saved, but for some reason an other rectangle is also saved as background fill. It would be easier for me if I did not have to edit the output SVG file not to include this extra background. (I attach the exported SVG in a reply to this message, since I can only attach two files to a post).
  • When I import the saved SVG, the uploaded geogebra file works fine, but my (latest) version of Geogebra 5 (64 bit Linux) adds the extra background to it (see the attachments in a reply). Apparently, defferent versions of geogebra read the svg files differently.

Comments (11)

photo
1

Apparently the problem was not the number of files, rather I could not attach an SVG. Is there a way to get around this? I attach here the geogebra file where I try to import the exported svg and a screenshot (linux mint, geogebra 5).

photo
1

For me in Win10


  • import svg works in GGB 6.0.535 (Classic Desktop)
  • import svg works not in GGB 5.0.539

I confirm the difference between GGB 5 and 6 as an possible error/bug in GGB5.0

Please post your export truck.svg , your import truck.svg file, the original construction as ggb-file , the used GGB release-number and the used svg programm/editor.

photo
1

The system information is:

GeoGebra Classic 5.0.539.0-d (22 May 2019)

Java: 1.8.0_121

OS: Linux Mint 18.3 Mate 1.18.0

-------------------------------------------

I tried to attach the SVG file with no success, so here is the content. It is saved from a geogebra applet using geogebra 5. I attach the applet here, but it will be different on your system, because the unicode character image is system dependent.

--------------------------------------------------------------------------


<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>


<svg

version="1.1"

baseProfile="full"

xmlns="http://www.w3.org/2000/svg";

xmlns:xlink="http://www.w3.org/1999/xlink";

xmlns:ev="http://www.w3.org/2001/xml-...;

width="14.640277777777776cm"

height="7.337777777777778cm"

viewBox="0 0 415 208"

>

<title>


</title>

<g stroke-linejoin="miter" stroke-dashoffset="0.0000" stroke-dasharray="none" stroke-width="1.0000" stroke-miterlimit="10.000" stroke-linecap="square">

<g id="misc">

</g><!-- misc -->

<g id="layer0">

<clipPath id="clipe85f855a-852c-4243-a685-58484fce36bd">

<path d="M 0.0000 0.0000 L 0.0000 208.00 L 415.00 208.00 L 415.00 0.0000 z"/>

</clipPath>

<g clip-path="url(#clip1)">

<g fill-opacity="1.0000" fill-rule="nonzero" stroke="none" fill="#ffff00">

<path d="M -16.000 -119.00 L 432.00 -119.00 L 432.00 367.00 L -16.000 367.00 L -16.000 -119.00 z"/>

<title>⛟</title>

<desc>Text text1: UnicodeToLetter(9951)</desc>


</g> <!-- drawing style -->

</g> <!-- clip1 -->

<clipPath id="clipc2c97332-182d-4dcd-a6e3-87d71b3d366a">

<path d="M 0.0000 0.0000 L 0.0000 208.00 L 415.00 208.00 L 415.00 0.0000 z"/>

</clipPath>

<g clip-path="url(#clip2)">

<g fill-opacity="1.0000" fill-rule="nonzero" stroke="none" fill="#660099">

<path d="M 319.19 172.28 L 143.88 172.28 L 144.19 174.16 L 144.19 175.88 Q 144.19 187.44 135.83 195.88 Q 127.47 204.31 115.59 204.31 Q 103.88 204.31 95.516 195.95 Q 87.156 187.59 87.156 175.88 L 87.156 172.28 L 37.938 172.28 L 37.938 149.00 L 3.2500 149.00 L 3.2500 39.781 Q 3.2500 21.344 10.828 12.047 Q 18.406 2.7500 35.594 2.7500 L 275.28 2.7500 Q 291.38 2.7500 297.23 9.4688 Q 303.09 16.188 303.09 36.344 L 303.09 48.531 L 337.47 48.531 Q 354.34 48.531 365.83 62.828 Q 377.31 77.125 381.84 106.34 Q 395.91 107.12 404.27 116.03 Q 412.62 124.94 412.62 138.38 L 412.62 172.28 L 375.75 172.28 L 376.06 174.16 L 376.06 175.88 Q 376.06 187.44 367.70 195.88 Q 359.34 204.31 347.62 204.31 Q 335.91 204.31 327.55 195.95 Q 319.19 187.59 319.19 175.88 L 319.19 172.28 z M 315.59 64.156 L 315.59 105.41 L 360.12 105.41 Q 358.88 87.281 351.53 75.719 Q 344.19 64.156 333.25 64.156 L 315.59 64.156 z"/>

<title>⛟</title>

<desc>Text text1: UnicodeToLetter(9951)</desc>


</g> <!-- drawing style -->

</g> <!-- clip2 -->

</g><!-- layer0 -->

</g> <!-- default stroke -->

</svg> <!-- bounding box -->

photo
1

oh! the "picture" is a letter in a text !

I think this is the problem.

---------------------------------


a possible solution:


a) export svg from GGB.

b) open with inkscape

c) delete all objects except the truck

d) save c) as truck2.svg

e) import truck2.svg in ggb 5.0.539 --> works!

The point B is correct in GGB 6.0 but not really correct in GGB 5.0.

I don't know: maybe a (small ?) bug in inkscape and/or in ggb 5.0 or rest information from the letter is not deleted in ikscape.

---------------------------------------------------

attached

truck2.svg embeded in a zip-file (so I can create an attach-file)

truck2.ggb with the imported file above

(If you want make the yellow background you can do this in inkscape.)

photo
1

I opened your ggb file and it did not work for me. I attach a screenshot. Notice, that the "corner" points of the image are not at the corner.

photo
1

I confirm the wrong corner (A, B). (In my environment there are (more or less) correct)

What you mean with: "not works for me"? (The corners and/od something else)

Screenshot: Corner A, B in Win10, GGB 5.0.536

56a3b82332bab5b3e9d01da7f265f6a9

photo
1

I simply mean the corners (I attached a screenshot to my previous message). Clearly, the corner points are not at the corner of the image and they are also system dependent. This makes it impossible to create a GGB file that uses SVG and where I can be sure to work the same way on all platforms.

photo
photo
1

This not only a problem with interpreting the unusual character.

I attach here a ggb file with a purple circle with the outside filled with yellow.

The exported SVG file has information saved outside the visible graphics view, and this extra information is taken into account when the file is imported back. Notice, that the corners of the imported image are not at the corners of the copy of the actual graphics view.

I also tried the online Geogebra classic, the exported SVG had extra bits there, too.

photo
1

Try changing

width="16.854954009774094cm"
height="16.854954009774094cm"
viewBox="0 0 382 382"
to

width="382"
height="382"
viewBox="0 0 382 382"

Also please use GeoGebra Classic 6 for PDF / SVG export as it's much improved over Classic 5

photo
1

Yes, I can of course edit the SVG file or move to Geogebra 6, but it does not solve the problem that Geogebra 5 has with SVG and PDF export/import.

The reason I prefer Geogebra 5 is the look. Probably it is me not being aware of some possibilities in Geogebra 6, but there are several things I could not figure out how to do.

I prefer the algebra view the way it looks in GGB5 and I especially like that it can be moved to a separate window. This I could not do in GGB6. I also prefer to modify properties in a separate window. I prefer this, because I like to see what is changing when I do the modification.

When I upload a file to be shared, I need it to be of a specific size. Since I could not find any parameter where I can set the graphics window to a specific fixed size, the only way I can achieve this is to manually fiddle with the window size. This is much easier for me in GGB5, where I can keep the graphics view in a separate window not to change its size when additional views are opened.

All in all, would it be a problem changing the SVG and PDF export algorithm in GGB5 to the same as in GGB6? Is there a particular reason why these are not the same?

photo
1

All in all, would it be a problem changing the SVG and PDF export algorithm in GGB5 to the same as in GGB6?

Sorry, that's not possible

© 2022 International GeoGebra Institute