Skip to content

Commit f1c3611

Browse files
committed
Add clause for svg's and clarifying comment
1 parent 0a86dc5 commit f1c3611

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Umbraco.Cms.Api.Management/Factories/ReziseImageUrlFactory.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ private IEnumerable<MediaUrlInfo> CreateThumbnailUrls(IEnumerable<string> urls,
4646
var extension = Path.GetExtension(url).Remove(0, 1);
4747
if (_imageUrlGenerator.SupportedImageFileTypes.InvariantContains(extension) is false)
4848
{
49+
// It's okay to return just the image URL for SVGs, as they are always scalable.
50+
if (extension == "svg")
51+
{
52+
yield return new MediaUrlInfo
53+
{
54+
Culture = null,
55+
Url = url,
56+
};
57+
}
58+
4959
continue;
5060
}
5161

0 commit comments

Comments
 (0)