Skip to content

Commit

Permalink
Fixed (TIFF) tests on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
stemann committed Apr 21, 2024
1 parent be33478 commit 9cadc4c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -123,16 +123,16 @@ Threads.nthreads() <= 1 && @info "Threads.nthreads() = $(Threads.nthreads()), mu
for typ in [Gray{N0f8}, Gray{Float64}, RGB{N0f8}, RGB{Float64}] # TODO: Add UInt8, N0f8 support in TiffImages
@testset "$typ TIFF" begin
img = rand(typ, 10, 10)
f = File{format"TIFF"}(joinpath(tmpdir, "test_fpath.tiff"))
f = File{format"TIFF"}(joinpath(tmpdir, "test_fpath_$(typ).tiff"))
ImageIO.save(f, img)
img_saveload = ImageIO.load(f)
@test img == img_saveload
@test typeof(img_saveload) == ImageIO.canonical_type(f, img_saveload)
img_saveload = ImageIO.load(f; mmap=true)
@test img == reshape(img_saveload, size(img))

open(io->ImageIO.save(Stream{format"TIFF"}(io), img), joinpath(tmpdir, "test_io.tiff"), "w")
img_saveload = open(io->ImageIO.load(Stream{format"TIFF"}(io)), joinpath(tmpdir, "test_io.tiff"))
open(io->ImageIO.save(Stream{format"TIFF"}(io), img), joinpath(tmpdir, "test_io_$(typ).tiff"), "w")
img_saveload = open(io->ImageIO.load(Stream{format"TIFF"}(io)), joinpath(tmpdir, "test_io_$(typ).tiff"))
@test img == img_saveload
@test typeof(img_saveload) == ImageIO.canonical_type(f, img_saveload)

Expand All @@ -141,9 +141,9 @@ Threads.nthreads() <= 1 && @info "Threads.nthreads() = $(Threads.nthreads()), mu
@test typeof(img_saveload) != ImageIO.canonical_type(f, img_saveload)
img_saveload = ImageIO.load(f; canonicalize=false)
@test typeof(img_saveload) != ImageIO.canonical_type(f, img_saveload)
img_saveload = open(io->ImageIO.load(Stream{format"TIFF"}(io); mmap=true), joinpath(tmpdir, "test_io.tiff"))
img_saveload = open(io->ImageIO.load(Stream{format"TIFF"}(io); mmap=true), joinpath(tmpdir, "test_io_$(typ).tiff"))
@test typeof(img_saveload) != ImageIO.canonical_type(f, img_saveload)
img_saveload = open(io->ImageIO.load(Stream{format"TIFF"}(io); canonicalize=false), joinpath(tmpdir, "test_io.tiff"))
img_saveload = open(io->ImageIO.load(Stream{format"TIFF"}(io); canonicalize=false), joinpath(tmpdir, "test_io_$(typ).tiff"))
@test typeof(img_saveload) != ImageIO.canonical_type(f, img_saveload)
end
end
Expand Down

0 comments on commit 9cadc4c

Please sign in to comment.