Skip to content

Commit

Permalink
Add OpenEXR via ImageIO (#328)
Browse files Browse the repository at this point in the history
  • Loading branch information
twadleigh committed Aug 19, 2021
1 parent 9b94990 commit 2db9d89
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/registry.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
Binary file added test/files/rand.exr
Binary file not shown.
10 changes: 10 additions & 0 deletions test/query.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down

0 comments on commit 2db9d89

Please sign in to comment.