Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

fix: Fx svg upload (#5544)

Oleg Isonencf1f929c4837
diff --git a/packages/asset-uploader/src/utils/get-asset-data.ts b/packages/asset-uploader/src/utils/get-asset-data.ts
index 77d0ec5ca5..3ac52d657d 100644
--- a/packages/asset-uploader/src/utils/get-asset-data.ts
+++ b/packages/asset-uploader/src/utils/get-asset-data.ts
@@ -36,11 +36,13 @@ export const getAssetData = async (
let image: undefined | { format: string; width: number; height: number };
try {
const parsed = imageMeta(Buffer.from(options.data));
- if (parsed.type && parsed.width && parsed.height) {
+ if (parsed.type) {
image = {
format: parsed.type,
- width: parsed.width,
- height: parsed.height,
+ // SVG images may not have explicit width/height dimensions
+ // (they use viewBox instead), so we default to 0 if missing
+ width: parsed.width ?? 0,
+ height: parsed.height ?? 0,
};
}
} catch {