diff --git a/src/ImageMagick.jl b/src/ImageMagick.jl index e65b70e..3a4b934 100755 --- a/src/ImageMagick.jl +++ b/src/ImageMagick.jl @@ -152,8 +152,8 @@ end # This differs from `save_` for files because this is primarily used # by IJulia, and we want to restrict large images to make display faster. -function save_(s::Stream, img, permute_horizontal=true; mapi = clamp01nan, quality = nothing) - wand = image2wand(img, mapi, quality, permute_horizontal) +function save_(s::Stream, img, permute_horizontal=true; mapi = clamp01nan, quality = nothing, kwargs...) + wand = image2wand(img, mapi, quality, permute_horizontal; kwargs...) blob = getblob(wand, formatstring(s)) write(stream(s), blob) end diff --git a/test/constructed_images.jl b/test/constructed_images.jl index 22da7e4..082488a 100755 --- a/test/constructed_images.jl +++ b/test/constructed_images.jl @@ -211,7 +211,7 @@ mutable struct TestType end orig_img = ImageMagick.load(joinpath(workdir, "2by2.png")) fn = joinpath(workdir, "2by2_fromstream.png") open(fn, "w") do f - ImageMagick.save(Stream(format"PNG", f), orig_img) + ImageMagick.save(Stream{format"PNG"}(f), orig_img) end img = ImageMagick.load(fn) @test img == orig_img @@ -266,6 +266,15 @@ mutable struct TestType end readimage(wand, fn) resetiterator(wand) @test ImageMagick.getimagedelay(wand) == 50 + + fn = joinpath(workdir, "animated.gif") + open(fn, "w") do io + ImageMagick.save(FileIO.Stream{format"GIF"}(io), A, fps=2) + end + wand = MagickWand() + readimage(wand, fn) + resetiterator(wand) + @test ImageMagick.getimagedelay(wand) == 50 end @testset "ImageMeta" begin diff --git a/test/images/test-exiforientation.zip b/test/images/test-exiforientation.zip new file mode 100644 index 0000000..b4fe46e Binary files /dev/null and b/test/images/test-exiforientation.zip differ diff --git a/test/readremote.jl b/test/readremote.jl index 2105882..35512bf 100755 --- a/test/readremote.jl +++ b/test/readremote.jl @@ -164,9 +164,8 @@ end end @testset "EXIF orientation" begin - url = "http://magnushoff.com/assets/test-exiforientation.zip" - fn = joinpath(workdir, "test-exiforientation.zip") - download(url, fn) + # downloaded from http://magnushoff.com/assets/test-exiforientation.zip + fn = joinpath(@__DIR__, "images", "test-exiforientation.zip") first_img = true r = ZipFile.Reader(fn) local img0