@@ -268,13 +268,13 @@ img_camera = testimage("camera")
268268 img = similar (img_camera)
269269 v = view (img, 75 : 195 , 245 : 370 )
270270 v .= view (img_camera, v. indices... )
271-
271+
272272 wv = InvWarpedView (v, tfm)
273273 @test wv isa InvWarpedView
274274 @test parent (wv) == v
275275 @test axes (wv) == (- 78 : 82 , 72 : 234 )
276276 # boundaries are filled with 0 values
277- @test all (wv[first (axes (wv, 1 )), :] .== 0 )
277+ @test all (wv[first (axes (wv, 1 )), :] .== 0 )
278278 @test all (wv[last (axes (wv, 1 )), :] .== 0 )
279279 @test all (wv[:, first (axes (wv, 2 ))] .== 0 )
280280 @test all (wv[:, last (axes (wv, 2 ))] .== 0 )
@@ -453,5 +453,17 @@ NaN NaN NaN NaN NaN NaN NaN
453453 end
454454 end
455455 end
456+
457+ @testset " issue #147" begin
458+ img = Float64[1 2 3 4 ; 5 6 7 8 ; 9 10 11 12 ; 13 14 15 16 ]
459+ trfm = recenter (RotMatrix (pi / 2 ), center (img))
460+ @test imrotate (img, π/ 2 ) ≈ warp (img, trfm) ≈ rotr90 (img)
461+ @test any (isnan, imrotate (img, π/ 3 ))
462+ @test ! any (isnan, imrotate (img, π/ 3 ; fillvalue= 0.0 ))
463+ @test ! any (isnan, imrotate (img, π/ 3 , fillvalue= 0.0 ))
464+ @test any (isnan, imrotate (img, π/ 3 , axes (img)))
465+ @test ! any (isnan, imrotate (img, π/ 3 , axes (img); fillvalue= 0.0 ))
466+ @test ! any (isnan, imrotate (img, π/ 3 , axes (img), fillvalue= 0.0 ))
467+ end
456468 end
457469end
0 commit comments