You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**PLEASE NOTE: We are trying to make this project live again. While you can file an issue, we will do our best but you should not expect any action, even if we label the issue. However, we are welcoming new contributors **
Describe the bug
I have a simple svg that I am editing. It is basically a image and on top of that the user draws a bunch of lines. The SVG that I open the SVG-Edit with is like: <svg width="840" height="1269" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg"> <g class="layer"> <title>Layer 1</title> <image height="1269" href="/cc/pics/a5f/a5f5f32bc17ea3d7ce42bd80015f2f49-840-1269.jpg" id="svg_1" width="840"/> </g></svg>
The user then draws on the image resulting in an exported SVG like: <svg width="840" height="1269" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg"> <g class="layer"> <title>Layer 1</title> <image height="1269" href="/cc/pics/a5f/a5f5f32bc17ea3d7ce42bd80015f2f49-840-1269.jpg" id="svg_1" width="840"/> <path d="m635,692c-14,-7.83 -17.45,-9.51 -21.39,-11.33c-4.33,-2 -9,-4.09 -13.96,-6.17c-5.14,-2.15 -10.41,-4.29 -15.81,-6.17c-10.6,-3.69 -15.84,-5.02 -20.93,-6.16c-4.95,-1.11 ............." fill="none" id="svg_2" stroke="#000000" stroke-width="5"/> </g></svg>
I have added a javascript onclick() method that creates a raster export to a PNG of the SVG-Edit canvas. This is done with code like:
function onClick() {
svgEditor.svgCanvas.bind('exported', function (win, data) { saveData(svgEditor.svgCanvas.getSvgString(), data); });
pngImage = svgEditor.svgCanvas.rasterExport("PNG", 100);
}
The created PNG file contains only the <path ...> elements. It does not rasterize the <image> element. I would like to correct this so that the rasterExport contains everything.
To Reproduce
See description above.
Expected behavior
I believe rasterExport("PNG", 100) should generate a raster of the entire svgcanvas which includes both the <image> and other tags.
SVG-Edit environment (IMPORTANT)
File for SVG-Edit: ???
Version: current "master" from github as of 2024/10/23
Protocol: http
Desktop (please complete the following information):
OS: Linux
Browser Firefox
Version 131.0.1
Smartphone (please complete the following information):
NA
Screenshots
Log
Additional context
The text was updated successfully, but these errors were encountered:
You are right. This bug is linked to the fact that URL are restricted by CORS restriction of browsers.
I will make a change to transform the imbedded file as base64 just before export.
This should fix your issue without collateral issues.
**PLEASE NOTE: We are trying to make this project live again. While you can file an issue, we will do our best but you should not expect any action, even if we label the issue. However, we are welcoming new contributors **
Describe the bug
I have a simple svg that I am editing. It is basically a image and on top of that the user draws a bunch of lines. The SVG that I open the SVG-Edit with is like:
<svg width="840" height="1269" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg"> <g class="layer"> <title>Layer 1</title> <image height="1269" href="/cc/pics/a5f/a5f5f32bc17ea3d7ce42bd80015f2f49-840-1269.jpg" id="svg_1" width="840"/> </g></svg>
The user then draws on the image resulting in an exported SVG like:
<svg width="840" height="1269" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg"> <g class="layer"> <title>Layer 1</title> <image height="1269" href="/cc/pics/a5f/a5f5f32bc17ea3d7ce42bd80015f2f49-840-1269.jpg" id="svg_1" width="840"/> <path d="m635,692c-14,-7.83 -17.45,-9.51 -21.39,-11.33c-4.33,-2 -9,-4.09 -13.96,-6.17c-5.14,-2.15 -10.41,-4.29 -15.81,-6.17c-10.6,-3.69 -15.84,-5.02 -20.93,-6.16c-4.95,-1.11 ............." fill="none" id="svg_2" stroke="#000000" stroke-width="5"/> </g></svg>
I have added a javascript onclick() method that creates a raster export to a PNG of the SVG-Edit canvas. This is done with code like:
The created PNG file contains only the <path ...> elements. It does not rasterize the
<image>
element. I would like to correct this so that the rasterExport contains everything.To Reproduce
See description above.
Expected behavior
I believe
rasterExport("PNG", 100)
should generate a raster of the entire svgcanvas which includes both the<image>
and other tags.SVG-Edit environment (IMPORTANT)
Desktop (please complete the following information):
Smartphone (please complete the following information):
NA
Screenshots
Log
Additional context
The text was updated successfully, but these errors were encountered: