Skip to content

Commit

Permalink
Check whether ColorView is defined (#67)
Browse files Browse the repository at this point in the history
ColorView has been deprecated since Nov 2017, but only as a constructor.
Hence direct uses of the type did not get noticed. I may "resurrect"
`ColorView` in new form, and if so the existing definition here should still
work, but in case we go through a period where there is no `ColorView`
we should check for its existence.
  • Loading branch information
timholy authored Sep 1, 2020
1 parent 333d56e commit 42e9aa8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "QuartzImageIO"
uuid = "dca85d43-d64c-5e67-8c65-017450d5d020"
version = "0.7.2"
version = "0.7.3"

[deps]
ColorVectorSpace = "c3611d14-8923-5661-9e6a-0046d554d3a4"
Expand Down
5 changes: 3 additions & 2 deletions src/QuartzImageIO.jl
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,9 @@ mapCG(x::Normed) = x
to_contiguous(A::Array) = A
to_contiguous(A::AbstractArray) = collect(A)
to_contiguous(A::BitArray) = convert(Array{N0f8}, A)
to_contiguous(A::ColorView) = to_contiguous(channelview(A))

if isdefined(ImageCore, :ColorView)
to_contiguous(A::ColorView) = to_contiguous(channelview(A))
end
to_explicit(A::Array{C}) where C <: Colorant = to_explicit(channelview(A))
to_explicit(A::Base.ReinterpretArray{T}) where T = to_explicit(copyto!(Array{T}(undef, size(A)), A))
to_explicit(A::Array{T}) where T <: Normed = rawview(A)
Expand Down

2 comments on commit 42e9aa8

@timholy
Copy link
Member Author

@timholy timholy commented on 42e9aa8 Sep 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/20644

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.7.3 -m "<description of version>" 42e9aa809d5c9502633bf76ed919ada4f77d8fa7
git push origin v0.7.3

Please sign in to comment.