Skip to content

Commit

Permalink
Merge pull request #39 from JuliaIO/teh/nodups
Browse files Browse the repository at this point in the history
Prevent redefinition warnings on julia-0.5
  • Loading branch information
timholy committed Apr 23, 2016
2 parents 2f29361 + 7c8584a commit 9707706
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/ImageMagick.jl
Expand Up @@ -207,6 +207,7 @@ formatstring{S}(s::Stream{DataFormat{S}}) = string(S)
mapinfo(img::AbstractArray{Bool}) = MapNone{UFixed8}()
mapinfo{T<:UFixed}(img::AbstractArray{T}) = MapNone{T}()
mapinfo{T<:AbstractFloat}(img::AbstractArray{T}) = MapNone{UFixed8}()
let handled = Set()
for ACV in (Color, AbstractRGB)
for CV in subtypes(ACV)
(length(CV.parameters) == 1 && !(CV.abstract)) || continue
Expand All @@ -215,6 +216,10 @@ for ACV in (Color, AbstractRGB)
@eval mapinfo{CV<:$CV}(img::AbstractArray{CV}) = MapNone{$CVnew{UFixed8}}()
CVnew = CV<:AbstractGray ? Gray : BGR
AC, CA = alphacolor(CV), coloralpha(CV)
if AC in handled
continue
end
push!(handled, AC)
ACnew, CAnew = alphacolor(CVnew), coloralpha(CVnew)
@eval begin
mapinfo{T<:UFixed}(img::AbstractArray{$AC{T}}) = MapNone{$ACnew{T}}()
Expand All @@ -224,6 +229,7 @@ for ACV in (Color, AbstractRGB)
end
end
end
end
mapinfo(img::AbstractArray{RGB24}) = MapNone{RGB{UFixed8}}()
mapinfo(img::AbstractArray{ARGB32}) = MapNone{BGRA{UFixed8}}()

Expand Down

0 comments on commit 9707706

Please sign in to comment.