Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVG Icon Upload Produces Base64 Encoding Instead of URL #43

Closed
mrsaiz opened this issue Oct 16, 2023 · 1 comment
Closed

SVG Icon Upload Produces Base64 Encoding Instead of URL #43

mrsaiz opened this issue Oct 16, 2023 · 1 comment
Assignees

Comments

@mrsaiz
Copy link

mrsaiz commented Oct 16, 2023

When I upload an icon in SVG format through the interface, and attempt to copy the URL generated for use in my code, I'm encountering an issue where the SVG icon is not being uploaded to the S3 bucket as expected. Instead, I'm provided with a lengthy base64-encoded data URI for the image, resulting in extremely long lines of code. This presents a challenge in maintaining clean and readable code.

image

Code Example (SVG Upload)

ImageSVG: "" {
  icon: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+SWNvbi1BcmNoaXRlY3R1cmUvMTYvQXJjaF9BbWF6b24tRUMyXzE2PC90aXRsZT4KICAgIDxnIGlkPSJJY29uLUFyY2hpdGVjdHVyZS8xNi9BcmNoX0FtYXpvbi1FQzJfMTYiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSJJY29uLUFyY2hpdGVjdHVyZS1CRy8xNi9Db21wdXRlIiBmaWxsPSIjRUQ3MTAwIj4KICAgICAgICAgICAgPHJlY3QgaWQ9IlJlY3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DQuMzUxLDIwIDQuNzgxLDIwIEwxMi4yLDIwIEMxMi42NDIsMjAgMTMsMTkuNjU4IDEzLDE5LjIzOCBMMTMsMTcgTDEyLDE3IEwxMiwxOSBaIE0yMCw0Ljc4MSBMMjAsMTIuMjE5IEMyMCwxMi42NSAxOS42NDksMTMgMTkuMjE5LDEzIEwxOCwxMyBMMTgsMTIgTDE5LDEyIEwxOSw1IEwxMiw1IEwxMiw2IEwxMSw2IEwxMSw0Ljc4MSBDMTEsNC4zNSAxMS4zNTEsNCAxMS43ODEsNCBMMTkuMjE5LDQgQzE5LjY0OSw0IDIwLDQuMzUgMjAsNC43ODEgTDIwLDQuNzgxIFoiIGlkPSJBbWF6b24tRUMyX0ljb25fMTZfU3F1aWQiIGZpbGw9IiNGRkZGRkYiPjwvcGF0aD4KICAgIDwvZz4KPC9zdmc+"
  shape: image
}

Ideally, I would like SVG icons to be treated similarly to PNG icons, resulting in a direct URL to the image stored on the S3 server, like this:

ImagePNG: "" {
  icon: https://s3-us-west-1.amazonaws.com/terrastruct.uploaded-images/1**********4/laolsguksuweshwkgjpxcewvsjiasd.png
  shape: image
}

This not only enhances code clarity but also allows for more efficient management and updating of icons.

@alixander
Copy link
Contributor

True. Will do.

Also related: #44

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants