Skip to content

Commit d9466a5

Browse files
Added support for JXS file format (#319)
* Added support for JXS file formats * Revert formatting change made in #319 Co-authored-by: Gabriel Vasile <gabriel.vasile@email.com>
1 parent a86966a commit d9466a5

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

internal/magic/image.go

+2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ var (
4444
Hdr = prefix([]byte("#?RADIANCE\n"))
4545
// Xpm matches X PixMap image data.
4646
Xpm = prefix([]byte{0x2F, 0x2A, 0x20, 0x58, 0x50, 0x4D, 0x20, 0x2A, 0x2F})
47+
// Jxs matches a JPEG XS coded image file (ISO/IEC 21122-3).
48+
Jxs = prefix([]byte{0x00, 0x00, 0x00, 0x0C, 0x4A, 0x58, 0x53, 0x20, 0x0D, 0x0A, 0x87, 0x0A})
4749
// Jxr matches Microsoft HD JXR photo file.
4850
Jxr = prefix([]byte{0x49, 0x49, 0xBC, 0x01})
4951
)

supported_mimes.md

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Extension | MIME type | Aliases
4646
**.jp2** | image/jp2 | -
4747
**.jpf** | image/jpx | -
4848
**.jpm** | image/jpm | video/jpm
49+
**.jxs** | image/jxs | -
4950
**.gif** | image/gif | -
5051
**.webp** | image/webp | -
5152
**.exe** | application/vnd.microsoft.portable-executable | -

tree.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
var root = newMIME("application/octet-stream", "",
1919
func([]byte, uint32) bool { return true },
2020
xpm, sevenZ, zip, pdf, fdf, ole, ps, psd, p7s, ogg, png, jpg, jxl, jp2, jpx,
21-
jpm, gif, webp, exe, elf, ar, tar, xar, bz2, fits, tiff, bmp, ico, mp3, flac,
21+
jpm, jxs, gif, webp, exe, elf, ar, tar, xar, bz2, fits, tiff, bmp, ico, mp3, flac,
2222
midi, ape, musePack, amr, wav, aiff, au, mpeg, quickTime, mqv, mp4, webM,
2323
threeGP, threeG2, avi, flv, mkv, asf, aac, voc, aMp4, m4a, m3u, m4v, rmvb,
2424
gzip, class, swf, crx, ttf, woff, woff2, otf, ttc, eot, wasm, shx, dbf, dcm, rar,
@@ -122,6 +122,7 @@ var (
122122
jpx = newMIME("image/jpx", ".jpf", magic.Jpx)
123123
jpm = newMIME("image/jpm", ".jpm", magic.Jpm).
124124
alias("video/jpm")
125+
jxs = newMIME("image/jxs", ".jxs", magic.Jxs)
125126
xpm = newMIME("image/x-xpixmap", ".xpm", magic.Xpm)
126127
bpg = newMIME("image/bpg", ".bpg", magic.Bpg)
127128
gif = newMIME("image/gif", ".gif", magic.Gif)

0 commit comments

Comments
 (0)