Skip to content

Commit

Permalink
fix for recent CVS
Browse files Browse the repository at this point in the history
  • Loading branch information
t-bltg committed Sep 8, 2021
1 parent d473f87 commit 29d377a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 30 deletions.
14 changes: 3 additions & 11 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,15 @@ author = "Thomas Breloff"
version = "1.1.0"

[deps]
ColorTypes = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
ColorVectorSpace = "c3611d14-8923-5661-9e6a-0046d554d3a4"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
ImageFiltering = "6a3955dd-da59-5b1f-98d4-e7296123deb5"
ImageMagick = "6218d12a-5da1-5696-b52f-db25d2ecc6d1"
Images = "916415d5-f1e6-5110-898d-aaa5f9f070e0"
QuartzImageIO = "dca85d43-d64c-5e67-8c65-017450d5d020"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"

[compat]
ColorTypes = "0.7, 0.8, 0.9, 0.10, 0.11"
ColorVectorSpace = "0.6, 0.7, 0.8, 0.9"
FileIO = "1"
ImageFiltering = "0.4, 0.5, 0.6, 0.7"
ImageMagick = "0.7, 1"
Images = "0"
QuartzImageIO = "0.7"
Requires = "1"
julia = "1.3"
julia = "1.5"

[extras]
Gtk = "4c0ca9eb-093a-5379-98c5-f87ac0bbbf44"
Expand Down
5 changes: 1 addition & 4 deletions src/VisualRegressionTests.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
module VisualRegressionTests

using Requires
using FileIO
using ColorTypes
using ColorVectorSpace
using ImageFiltering
using Images

# ---------------------------------------------

Expand Down
4 changes: 2 additions & 2 deletions src/imgcomp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ function compare_images(testfn::AbstractString, reffn::AbstractString; sigma = (

# load test and ref images... if error, return immediately
try
result.testImage = load(testfn)
result.refImage = load(reffn)
result.testImage = Images.FileIO.load(testfn)
result.refImage = Images.FileIO.load(reffn)
catch err
result.err = err
return result
Expand Down
17 changes: 4 additions & 13 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ function blurdiff(A::AbstractArray, B::AbstractArray, sigma)
diffpct
end

sad(A::AbstractArray, B::AbstractArray) = sumdiff(abs, A, B)
# github.com/JuliaGraphics/ColorVectorSpace.jl#abs-and-abs2
_abs(c) = mapreducec(v->abs(float(v)), +, 0, c)

sad(A::AbstractArray, B::AbstractArray) = sumdiff(_abs, A, B)

function sumdiff(f, A::AbstractArray, B::AbstractArray)
axes(A) == axes(B) || throw(DimensionMismatch("A and B must have the same indices"))
Expand Down Expand Up @@ -53,15 +56,3 @@ accum(::Type{T}) where {T<:Integer} = Int
accum(::Type{Float32}) = Float32
accum(::Type{T}) where {T<:Real} = Float64
accum(::Type{C}) where {C<:Colorant} = base_colorant_type(C){accum(eltype(C))}

"maximum absolute value in `A` ignoring `Inf` or `NaN`"
function maxabsfinite(A)
m = -Inf
for a in A
v = abs(a)
if isfinite(v) && v > m
m = v
end
end
m
end

0 comments on commit 29d377a

Please sign in to comment.