Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eliminate OffsetArrays dependency #17

Merged
merged 1 commit into from
Jan 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
name = "ImageShow"
uuid = "4e3cecfd-b093-5904-9786-8bbb286a6a31"
version = "0.2.2"
version = "0.2.3"

[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
ImageCore = "a09fc81d-aa75-5fe9-8630-4744c3626534"
OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"

[compat]
FileIO = "1"
ImageCore = "0.8.1"
OffsetArrays = "0.8, 0.9, 0.10, 0.11"
Requires = "0.5.2, 1"
julia = "1"

[extras]
ImageMagick = "6218d12a-5da1-5696-b52f-db25d2ecc6d1"
OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"
PaddedViews = "5432bcbf-9aad-5242-b902-cca2824c8663"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["ImageMagick", "PaddedViews", "Test"]
test = ["ImageMagick", "OffsetArrays", "PaddedViews", "Test"]
6 changes: 5 additions & 1 deletion src/ImageShow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@ module ImageShow

using Requires
using FileIO
using ImageCore, OffsetArrays
using ImageCore

const _have_restrict=Ref(false)
function _use_restrict(val::Bool)
_have_restrict[] = val
end
function __init__()
@require OffsetArrays="6fe1bfb0-de20-5000-8ca7-80f57d26f881" begin
Base.show(io::IO, mime::MIME"image/png", img::OffsetArrays.OffsetArray{C}; kwargs...) where C<:Colorant =
show(io, mime, parent(img); kwargs...)
end
@require ImageTransformations="02fcd773-0e25-5acc-982a-7f6622650795" _use_restrict(true)
end
include("showmime.jl")
Expand Down
3 changes: 0 additions & 3 deletions src/showmime.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ function Base.show(io::IO, mime::MIME"image/png", img::AbstractMatrix{C};
end
end

Base.show(io::IO, mime::MIME"image/png", img::OffsetArray{C}; kwargs...) where C<:Colorant =
show(io, mime, parent(img); kwargs...)

# Not all colorspaces are supported by all backends, so reduce types to a minimum
csnormalize(c::AbstractGray) = Gray(c)
csnormalize(c::Color) = RGB(c)
Expand Down