SharePoint / sp-dev-docs

SharePoint & Viva Connections Developer Documentation
https://docs.microsoft.com/en-us/sharepoint/dev/
Creative Commons Attribution 4.0 International
1.25k stars 1.01k forks source link

SVG base64-encoded image does not work #2169

Closed vincepunkrock closed 5 years ago

vincepunkrock commented 6 years ago

When I use a base64-encoded image, a url is somehow always added before the base64 string. For example "https://publiccdn.sharepointonline.com/XXXXXX/sites/app/ClientSideAssets/10171f51-d1aa-4860-a59c-6f47b47d14f1/data:image/svg+xml;base64,..." I put the base64 string in "iconImageUrl" just as explained above. Why does it add the url in front of it? When I go in the browser and remove the added url, it shows correctly. Is there something I still do wrong? Any help would be appreciated!


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Zhephyr54 commented 6 years ago

You're doing nothing wrong. This is a bug currently reported : #1909 and #1834.

harshdamaniahd commented 6 years ago

@vincepunkrock Pls use png image , it works for me.

vincepunkrock commented 6 years ago

@harshdamaniahd You are right it works with a png. However, it would be nice if it would also work with an svg, as stated here: https://docs.microsoft.com/en-us/sharepoint/dev/spfx/extensions/basics/configure-extension-icon

Either add the support for svg or correct the documentation. This is currently misleading.

PooLP commented 6 years ago

Same issue with svg ... and please vote for UI Fabric icon support for commandSet button on User Voice : https://sharepoint.uservoice.com/forums/329220-sharepoint-dev-platform/suggestions/31781332-allow-to-use-office-ui-fabric-icons-and-other-font

harshdamaniahd commented 6 years ago

Done ..voted from my end. This will help in maintaining consistency across site.

PooLP commented 6 years ago

Yes and we will finally have icons compatible with the color themes but as it is on users voice, it will not be before ~3 years :smiling_imp:

GrahamMcMynn commented 5 years ago

@vincepunkrock - I tested an icon as a base 64 encoded image and it works without a prepended internal base url. Please let me know if you are still experiencing this issue, and if so can you send me your solution (grahamc at my microsoft.com account). Thanks!

msft-github-bot commented 5 years ago

This issue has been automatically marked as stale because it has marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within next 7 days of this comment. Thank you for your contributions to SharePoint Developer activities.

vincepunkrock commented 5 years ago

@mcmynn83 I ended up using a png instead of an svg. But others are still having problems with svg as I can read up here. Last time I checked, this worked: "iconImageUrl": "data:image/png;base64,iVBORw0KGgoAAAANSUhEU... and this didn't: "iconImageUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj... A clear answer and or solution would be appreciated :)

harshdamaniahd commented 5 years ago

I can confirm that png works, i have no idea about svg.

GrahamMcMynn commented 5 years ago

Sorry, not sure how I missed that. I just validated a icon that happened to be a png. You are correct, SVG does not work. I will look into a fix. Thanks for your patience.

GrahamMcMynn commented 5 years ago

A fix will rollout near the start of June for this (we don't roll updates during SharePoint conference). Thanks!

GrahamMcMynn commented 5 years ago

Closing this as it is tracked by #1834.

msft-github-bot commented 4 years ago

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues