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

Show SVG preview on upload #8387

Merged

Conversation

bjarnef
Copy link
Contributor

@bjarnef bjarnef commented Jul 6, 2020

Prerequisites

  • I have added steps to test this contribution in the description below

Description

When uploading creating a new media e.g. "File" or "Image" and selecting or dragging a SVG file to the file upload a preview is not shown, because the fileSrc property only is set for images https://github.com/umbraco/Umbraco-CMS/blob/v8/contrib/src/Umbraco.Web.UI.Client/src/common/directives/components/upload/umbpropertyfileupload.directive.js#L248, where SVG at the moment by default not is considered as image and for example is creating as "File" media type under a folder, when uploading SVG files to a folder.

The fileSrc is however set for existing uploaded SVG files on init:
https://github.com/umbraco/Umbraco-CMS/blob/v8/contrib/src/Umbraco.Web.UI.Client/src/common/directives/components/upload/umbpropertyfileupload.directive.js#L121

Before

2020-07-06_14-35-25

After

2020-07-06_14-28-11

@bjarnef bjarnef changed the title Show upload svg preview Show SVG preview on upload Jul 6, 2020
@bjarnef
Copy link
Contributor Author

bjarnef commented Jul 7, 2020

@nielslyngsoe it would be awesome to show a preview for SVG files here like for images.

@nul800sebastiaan nul800sebastiaan merged commit 68ed7c9 into umbraco:v8/contrib Jul 14, 2020
@nul800sebastiaan
Copy link
Member

Wonderful @bjarnef - so much better! 👍

@bjarnef bjarnef deleted the v8/feature/upload-svg-preview branch August 2, 2020 09:57
@bjarnef bjarnef mentioned this pull request Jan 20, 2022
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants