Skip to content

Commit

Permalink
Add support for DICOM (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
amichal authored and sindresorhus committed Nov 1, 2018
1 parent 6140673 commit 0b50cfe
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
Binary file added fixture/fixture.dcm
Binary file not shown.
7 changes: 7 additions & 0 deletions index.js
Expand Up @@ -867,6 +867,13 @@ module.exports = input => {
};
}

if (check([0x44, 0x49, 0x43, 0x4D], {offset: 128})) {
return {
ext: 'dcm',
mime: 'application/dicom'
};
}

return null;
};

Expand Down
1 change: 1 addition & 0 deletions readme.md
Expand Up @@ -176,6 +176,7 @@ The minimum amount of bytes needed to detect a file type. Currently, it's 4100 b
- [`asf`](https://en.wikipedia.org/wiki/Advanced_Systems_Format) - Advanced Systems Format
- [`wma`](https://en.wikipedia.org/wiki/Windows_Media_Audio) - Windows Media Audio
- [`wmv`](https://en.wikipedia.org/wiki/Windows_Media_Video) - Windows Media Video
- [`dcm`](https://en.wikipedia.org/wiki/DICOM#Data_format) - DICOM Image File

*SVG isn't included as it requires the whole file to be read, but you can get it [here](https://github.com/sindresorhus/is-svg).*

Expand Down
3 changes: 2 additions & 1 deletion test.js
Expand Up @@ -97,7 +97,8 @@ const types = [
'ape',
'wv',
'wmv',
'wma'
'wma',
'dcm'
];

// Define an entry here only if the fixture has a different
Expand Down

0 comments on commit 0b50cfe

Please sign in to comment.