Skip to content

Commit

Permalink
Eliminate unnecessary OffsetArrays dependency (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy authored Jan 20, 2020
1 parent f32179f commit d24cbfb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
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

2 comments on commit d24cbfb

@timholy
Copy link
Member Author

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/8188

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 Julia TagBot is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.3 -m "<description of version>" d24cbfbcfeb75595c743ad1bd5387887e66cd730
git push origin v0.2.3

Please sign in to comment.