Skip to content

Commit 77b3180

Browse files
CompatHelper: bump compat for "ImageShow" to "0.3" (#952)
* CompatHelper: bump compat for "ImageShow" to "0.3" * bind ImageShow gif/play/explore to Images * make function alias a const so as to avoid unexpected re-bind Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Johnny Chen <[email protected]>
1 parent 91a35ed commit 77b3180

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ ImageMagick = "0.7.5, 1"
4545
ImageMetadata = "0.6, 0.7, 0.8, 0.9"
4646
ImageMorphology = "0.2.7"
4747
ImageQualityIndexes = "0.1.3, 0.2"
48-
ImageShow = "0.1, 0.2"
48+
ImageShow = "0.1, 0.2, 0.3"
4949
ImageTransformations = "0.4, 0.5, 0.6, 0.7, 0.8"
5050
IndirectArrays = "0.5"
5151
OffsetArrays = "0.8, 0.9, 0.10, 0.11, 1.0.1"

src/Images.jl

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,32 @@ if !hasmethod(arraydata, (ImageMeta, ) )
7878
ImageAxes.arraydata(img::ImageMeta) = ImageMetadata.data(img)
7979
end
8080

81+
# Non-exported symbol bindings to ImageShow
82+
import ImageShow
83+
if isdefined(ImageShow, :play)
84+
@doc (@doc ImageShow.play)
85+
const play = ImageShow.play
86+
else
87+
play(args...; kwargs...) = error("The `Images.play` function requires ImageShow at least 0.3.0.")
88+
end
89+
if isdefined(ImageShow, :explore)
90+
@doc (@doc ImageShow.explore)
91+
const explore = ImageShow.explore
92+
else
93+
explore(args...; kwargs...) = error("The `Images.explore` function requires ImageShow at least 0.3.0.")
94+
end
95+
if isdefined(ImageShow, :gif)
96+
@doc (@doc ImageShow.gif)
97+
const gif = ImageShow.gif
98+
else
99+
gif(args...; kwargs...) = error("The `Images.gif` function requires ImageShow at least 0.3.0.")
100+
end
101+
81102
# While we are bridging the old API and the new API in ImageContrastAdjustment
82103
# we need to import these functions because we make new definitions for them
83104
# in deprecations.jl
84105
import ImageContrastAdjustment: build_histogram, adjust_histogram, adjust_histogram!
85106

86-
import ImageShow
87107
using ImageMetadata: ImageMetaAxis
88108
import ImageMorphology: dilate, erode
89109
import ImageTransformations: restrict

0 commit comments

Comments
 (0)