[backport cloud/1.42] Support svg outputs in assets panel (#11150)

Manual backport of #10470 to `cloud/1.42`

PR added a test to a file which did not exist. That test has been
removed from this backport PR.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-11150-backport-cloud-1-42-Support-svg-outputs-in-assets-panel-33f6d73d365081be960fd138c9f45169)
by [Unito](https://www.unito.io)
This commit is contained in:
AustinMroz
2026-04-10 17:42:22 -07:00
committed by GitHub
parent 5fc32c3006
commit ea06d8fd6f
3 changed files with 10 additions and 3 deletions

View File

@@ -62,7 +62,8 @@ describe('formatUtil', () => {
{ filename: 'animation.gif', expected: 'image' },
{ filename: 'web.webp', expected: 'image' },
{ filename: 'bitmap.bmp', expected: 'image' },
{ filename: 'modern.avif', expected: 'image' }
{ filename: 'modern.avif', expected: 'image' },
{ filename: 'logo.svg', expected: 'image' }
]
it.for(imageTestCases)(

View File

@@ -542,7 +542,8 @@ const IMAGE_EXTENSIONS = [
'bmp',
'avif',
'tif',
'tiff'
'tiff',
'svg'
] as const
const VIDEO_EXTENSIONS = ['mp4', 'webm', 'mov', 'avi'] as const
const AUDIO_EXTENSIONS = ['mp3', 'wav', 'ogg', 'flac'] as const

View File

@@ -14,6 +14,11 @@ export function appendCloudResParam(
filename?: string
): void {
if (!isCloud) return
if (filename && getMediaTypeFromFilename(filename) !== 'image') return
if (
filename &&
(getMediaTypeFromFilename(filename) !== 'image' ||
filename.toLowerCase().endsWith('.svg'))
)
return
params.set('res', '512')
}