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
|
// avoid regenerating
|
||||||
if (stackThumbnails[stackIdx]) {
|
if (stackThumbnails[stackIdx]) {
|
||||||
|
console.debug('generateThumbnail: thumbnail already exists for', stackIdx);
|
||||||
// already have it
|
// already have it
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -551,7 +552,9 @@ function App({ container_id, imageStacks, autoCacheStack, annotationJson, viewer
|
|||||||
console.warn('Thumbnail generation failed for', chosenImageId, err);
|
console.warn('Thumbnail generation failed for', chosenImageId, err);
|
||||||
try { setStackThumbnails(prev => ({ ...prev, [stackIdx]: 'BROKEN' })); } catch (e) { /* ignore */ }
|
try { setStackThumbnails(prev => ({ ...prev, [stackIdx]: 'BROKEN' })); } catch (e) { /* ignore */ }
|
||||||
} finally {
|
} 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);
|
if (el && el.parentNode) el.parentNode.removeChild(el);
|
||||||
}
|
}
|
||||||
}, [container_id, stackThumbnails]);
|
}, [container_id, stackThumbnails]);
|
||||||
|
|||||||
Reference in New Issue
Block a user