diff --git a/src/autorange.jl b/src/autorange.jl index ad4de2e..b21ee7e 100644 --- a/src/autorange.jl +++ b/src/autorange.jl @@ -12,7 +12,7 @@ function autorange(R::CartesianRange, tform) mn = map(min, x, mn) mx = map(max, x, mx) end - _autorange(convert(Tuple, mn), convert(Tuple, mx)) + _autorange(Tuple(mn), Tuple(mx)) end @noinline _autorange(mn,mx) = map((a,b)->floor(Int,a):ceil(Int,b), mn, mx) diff --git a/test/autorange.jl b/test/autorange.jl index e4dbe4f..2258671 100644 --- a/test/autorange.jl +++ b/test/autorange.jl @@ -126,4 +126,10 @@ end @test rnge[2].stop == ceil(sin(ϕ)*last(indh) + cos(ϕ)*last(indw)) end end + #should also work with non-static transforms (Github #48) + tfm = LinearMap(eye(2)) + tfm_s = LinearMap(SMatrix{2,2}(eye(2))) + tst_img = zeros(5,5) + rnge = ImageTransformations.autorange(tst_img, tfm_s) + @test rnge == ImageTransformations.autorange(tst_img, tfm) end