Add debug logging for thumbnail generation and improve error handling
This commit is contained in:
@@ -437,6 +437,7 @@ function App({ container_id, imageStacks, autoCacheStack, annotationJson, viewer
|
||||
}
|
||||
// avoid regenerating
|
||||
if (stackThumbnails[stackIdx]) {
|
||||
console.debug('generateThumbnail: thumbnail already exists for', stackIdx);
|
||||
// already have it
|
||||
return;
|
||||
}
|
||||
@@ -551,7 +552,9 @@ function App({ container_id, imageStacks, autoCacheStack, annotationJson, viewer
|
||||
console.warn('Thumbnail generation failed for', chosenImageId, err);
|
||||
try { setStackThumbnails(prev => ({ ...prev, [stackIdx]: 'BROKEN' })); } catch (e) { /* ignore */ }
|
||||
} finally {
|
||||
try { renderingEngine.disableElement(viewportId); } catch (e) { /* ignore */ }
|
||||
try { renderingEngine.disableElement(viewportId); } catch (e) {
|
||||
console.warn('Failed to disable thumbnail element:', e);
|
||||
}
|
||||
if (el && el.parentNode) el.parentNode.removeChild(el);
|
||||
}
|
||||
}, [container_id, stackThumbnails]);
|
||||
|
||||
Reference in New Issue
Block a user