Kitware / VolView

Kitware VolView: an all-in-one radiological viewer!
https://volview.kitware.com
Apache License 2.0
184 stars 60 forks source link

*.gz file extension failed to resolve to correct mime type #663

Open 1isten opened 5 days ago

1isten commented 5 days ago

For example, when drag'n'drop a file.nii.gz compressed nifti file into the volview website, it cannot be opened. image

I added some debug console log and see the fileType is being resolved to application/gzip, which is incorrect. image By looking up the mimeTypes.ts file I think it should be application/vnd.unknown.nifti-1.

I think the *.gz file names should be handled specifically in the updateFileMimeType.ts to correctly resolve the mime type.

Below is my quick fix for the nii.gz file: image

My implementation is not very comprehensive. Hope this can be fixed by volview offical team, thanks!

floryst commented 4 days ago

Thanks! You do have the right idea here. I've linked a PR to fix this issue.