Skip to content

Commit 68e46bc

Browse files
committed
compat fix for Julia < v1.6
1 parent 08f3aed commit 68e46bc

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/matlab.jl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,11 @@ im_to_matlab(::Type{T}, img::AbstractMatrix{<:RGB}) where T =
159159
im_to_matlab(::Type{T}, img::AbstractArray{<:RGB}) where T =
160160
throw(ArgumentError("For $(ndims(img)) dimensional color image, manual conversion to MATLAB layout is required."))
161161

162-
# this method allows `data === im_to_matlab(im_from_matlab(data))` for gray image
163-
im_to_matlab(::Type{T}, img::Base.ReinterpretArray{CT,N,T,<:AbstractArray{T,N}, true}) where {CT,N,T} =
164-
img.parent
162+
if VERSION >= v"1.6.0-DEV.1083"
163+
# this method allows `data === im_to_matlab(im_from_matlab(data))` for gray image
164+
im_to_matlab(::Type{T}, img::Base.ReinterpretArray{CT,N,T,<:AbstractArray{T,N}, true}) where {CT,N,T} =
165+
img.parent
166+
else
167+
im_to_matlab(::Type{T}, img::Base.ReinterpretArray{CT,N,T,<:AbstractArray{T,N}}) where {CT,N,T} =
168+
img.parent
169+
end

0 commit comments

Comments
 (0)