Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
simeonschaub committed Feb 4, 2023
1 parent 9cc3e3f commit eb291b7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/constructed_images.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ using ImageShow # for show(io, ::MIME, img) & ImageMeta
using Test
using ImageCore
using Random, Base.CoreLogging
import Pkg

mutable struct TestType end

Expand Down Expand Up @@ -359,4 +360,20 @@ mutable struct TestType end
img = ImageMagick.load("images/cameraman.tif")
@test size(img) == (512, 512)
end

if VERSION >= v"1.6" || Sys.which("gs") !== nothing
@testset "PDF" begin
pdf = ImageMagick.load("images/FLAT_-_What_is_Creative_Commons.pdf")
@test size(pdf) == (405, 720, 10)

fn = joinpath(workdir, "cc.pdf")
ImageMagick.save(fn, pdf)
@test ImageMagick.load(fn) == pdf

pdf_100dpi = ImageMagick.load("images/FLAT_-_What_is_Creative_Commons.pdf"; dpi=100)
@test size(pdf_100dpi) == (563, 1000, 10)
end
else
@warn "skipping PDF tests"
end
end
Binary file added test/images/FLAT_-_What_is_Creative_Commons.pdf
Binary file not shown.

0 comments on commit eb291b7

Please sign in to comment.