fix(capture): Ensure download filename has the correct extension. (#5691)

This commit is contained in:
Joe Boccanfuso 2026-01-06 15:27:44 -05:00 committed by GitHub
parent a51552a2e7
commit 38a8406a66
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -215,7 +215,7 @@ const CornerstoneViewportDownloadForm = ({
}
}, [viewportDimensions, showAnnotations]);
const handleDownload = async (filename: string, fileType: string) => {
const handleDownload = async (baseFilename: string, fileType: string) => {
const divForDownloadViewport = document.querySelector(
`div[data-viewport-uid="${VIEWPORT_ID}"]`
);
@ -225,8 +225,9 @@ const CornerstoneViewportDownloadForm = ({
return;
}
const filename = `${baseFilename}.${fileType}`;
const canvas = await html2canvas(divForDownloadViewport as HTMLElement);
downloadUrl(canvas.toDataURL(`image/${fileType}`, 1.0));
downloadUrl(canvas.toDataURL(`image/${fileType}`, 1.0), { filename });
};
const ViewportDownloadFormNew = customizationService.getCustomization(