Skip to content

garlic-hub doesn't support svg with embedded png #63

Description

@TimoteusRuotsalainen

If you create a svg in inkscape and import a png into it with "File -> Import... -> .png file" the png is embedded in the svg file

Inside the svg it looks like this
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKcAAAA7CAYAAAAesprUAAAAAXN........

Attached is the svg file.

Image

If you try to upload this to garlic-hub there is an error

Error for file: bug-embeddedimage.svg unable to open image 'image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKcAAAA7CAYAAAAesprUAAAAAXNSR0IArs4c6Q.....' localFilesUploader.js 89:15

					const results = await this.fetchClient.uploadWithProgress(UploadApiConfig.UPLOAD_LOCAL_FILE, options, (progress) => {
						progressBar.style.display = "block";
						progressBar.style.width = progress + "%";
						progressBar.textContent = Math.round(progress) + "%";
					});

					if (!results.success)
						console.error('Error for file:', file.name, results.error_message || 'Unknown error');
					else
						this.#filePreviews.removeFromPreview(id);

				}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions