diff --git a/src/registry.jl b/src/registry.jl index cf89a428..0c95d5a0 100644 --- a/src/registry.jl +++ b/src/registry.jl @@ -138,6 +138,7 @@ add_format(format"CUR", UInt8[0x00,0x00,0x02,0x00], ".cur", add_format(format"DCX", UInt8[0xb1,0x68,0xde,0x3a], ".dcx", [idImageMagick]) add_format(format"DOT", UInt8[0xd0,0xcf,0x11,0xe0,0xa1,0xb1,0x1a,0xe1], ".dot", [idImageMagick]) add_format(format"EPS", UInt8[0x25,0x21,0x50,0x53,0x2d,0x41,0x64,0x6f], ".eps", [idImageMagick], [MimeWriter, SAVE]) +add_format(format"EXR", UInt8[0x76,0x2f,0x31,0x01], ".exr", [idImageIO]) add_format(format"HDR", UInt8[0x23,0x3f,0x52,0x41,0x44,0x49,0x41,0x4e], ".hdr", [idImageMagick]) add_format(format"ICO", UInt8[0x00,0x00,0x01,0x00], ".ico", [idImageMagick]) add_format(format"INFO", UInt8[0x7a,0x62,0x65,0x78], ".info",[idImageMagick]) diff --git a/test/files/rand.exr b/test/files/rand.exr new file mode 100644 index 00000000..93c4976e Binary files /dev/null and b/test/files/rand.exr differ diff --git a/test/query.jl b/test/query.jl index b7cc8278..904283a0 100644 --- a/test/query.jl +++ b/test/query.jl @@ -457,6 +457,16 @@ let file_dir = joinpath(@__DIR__, "files"), file_path = Path(file_dir) @test position(io) == 4 end end + @testset "OpenEXR detection" begin + q = query(joinpath(file_dir, "rand.exr")) + @test typeof(q) <: File{format"EXR"} + @test magic(format"EXR") == UInt8[0x76, 0x2F, 0x31, 0x01] + open(q) do io + @test position(io) == 0 + skipmagic(io) + @test position(io) == 4 + end + end @testset "Sixel detection" begin q = query(joinpath(file_dir, "rand.six")) @test typeof(q) <: File{format"SIXEL"}