fix(Editor): Force canvas extraction for blob URLs to avoid revoked blob errors
Build and Deploy / build-and-push (push) Successful in 47s

This commit is contained in:
AI Bot
2026-09-03 13:19:10 +05:30
parent 1c268c6222
commit 2c319ecb24
+5 -2
View File
@@ -268,10 +268,13 @@ export const extractTextureUrl = (texture: any) => {
if (!texture) return undefined; if (!texture) return undefined;
const img = texture.image || (texture.source && texture.source.data); const img = texture.image || (texture.source && texture.source.data);
if (!img) return undefined; if (!img) return undefined;
if (typeof img.src === 'string' && img.src.length > 0) return img.src;
if (typeof img.currentSrc === 'string' && img.currentSrc.length > 0) return img.currentSrc; // If we have a stable URL that isn't a blob, return it directly
if (typeof img.src === 'string' && img.src.length > 0 && !img.src.startsWith('blob:')) return img.src;
if (typeof img.currentSrc === 'string' && img.currentSrc.length > 0 && !img.currentSrc.startsWith('blob:')) return img.currentSrc;
// Fallback: draw ImageBitmap or HTMLImageElement to canvas to extract data URL // Fallback: draw ImageBitmap or HTMLImageElement to canvas to extract data URL
// We MUST do this for blob: URLs because GLTFLoader revokes blob URLs after loading!
try { try {
const MAX = 1024; const MAX = 1024;
let scale = 1; let scale = 1;