Skip to content

Commit 093dba0

Browse files
Add support for JMP (#784)
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
1 parent 8501558 commit 093dba0

5 files changed

Lines changed: 15 additions & 0 deletions

File tree

core.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1673,6 +1673,17 @@ export class FileTypeParser {
16731673
};
16741674
}
16751675

1676+
// -- 16-byte signatures --
1677+
1678+
// JMP files - check for both Little Endian and Big Endian signatures
1679+
if (this.check([0xFF, 0xFF, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00])
1680+
|| this.check([0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x01, 0x00, 0x01])) {
1681+
return {
1682+
ext: 'jmp',
1683+
mime: 'application/x-jmp-data',
1684+
};
1685+
}
1686+
16761687
// Increase sample size from 256 to 512
16771688
await tokenizer.peekBuffer(this.buffer, {length: Math.min(512, tokenizer.fileInfo.size), mayBeLess: true});
16781689

fixture/fixture.jmp

745 Bytes
Binary file not shown.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@
241241
"potm",
242242
"pptm",
243243
"jar",
244+
"jmp",
244245
"rm",
245246
"ppsm",
246247
"ppsx",

readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,7 @@ abortController.abort(); // Abort file-type reading from the Blob stream.
533533
- [`j2c`](https://en.wikipedia.org/wiki/JPEG_2000) - JPEG 2000
534534
- [`jar`](https://en.wikipedia.org/wiki/JAR_(file_format)) - Java archive
535535
- [`jls`](https://en.wikipedia.org/wiki/Lossless_JPEG#JPEG-LS) - Lossless/near-lossless compression standard for continuous-tone images
536+
- [`jmp`](https://en.wikipedia.org/wiki/JMP_(statistical_software)) - JMP data file format by SAS Institute
536537
- [`jp2`](https://en.wikipedia.org/wiki/JPEG_2000) - JPEG 2000
537538
- [`jpg`](https://en.wikipedia.org/wiki/JPEG) - Joint Photographic Experts Group image
538539
- [`jpm`](https://en.wikipedia.org/wiki/JPEG_2000) - JPEG 2000

supported.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ export const extensions = [
171171
'potm',
172172
'pptm',
173173
'jar',
174+
'jmp',
174175
'rm',
175176
'ppsm',
176177
'ppsx',
@@ -353,4 +354,5 @@ export const mimeTypes = [
353354
'application/vnd.rn-realmedia',
354355
'application/x-ms-regedit',
355356
'application/x-ft-windows-registry-hive',
357+
'application/x-jmp-data',
356358
];

0 commit comments

Comments
 (0)