mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-19 22:09:37 +00:00
[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:
@@ -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)(
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user