I have the following code in an IJulia notebook(). The image is saved 
correctly to the disk file but I cannot show it in the notebook. Is this a 
bug or am I doing something wrong?

using Images
imgdata = Array{UInt8}(640, 480, 3);
for i in 1:480
    for j in 1:640
        imgdata[j,i,1] = round(UInt8, abs(250*sin(i/16)))
        imgdata[j,i,2] = round(UInt8, abs(cos(pi*j/320)))
        imgdata[j,i,3] = imgdata[2]
    end
end;
img = colorim(imgdata);
save("testimg.png", img)
view(img)

LoadError: BoundsError: attempt to access ()
  at index [0]
while loading In[7], in expression starting on line 1

 in rdims(::Tuple{}, 
::Tuple{Base.OneTo{Int64},Base.OneTo{Int64},Base.OneTo{Int64}}, ::Type{Val{0}}) 
at ./reshapedarray.jl:52
 in reshape(::Array{FixedPointNumbers.UFixed{UInt8,8},3}, ::Type{Val{0}}) at 
./reshapedarray.jl:45
 in 
view(::Images.Image{FixedPointNumbers.UFixed{UInt8,8},3,Array{FixedPointNumbers.UFixed{UInt8,8},3}})
 at /home/bmaier/.julia/v0.6/Images/src/core.jl:513


Reply via email to