Skip to content
This repository has been archived by the owner on Nov 24, 2020. It is now read-only.

Images? #50

Closed
timholy opened this issue Mar 27, 2014 · 12 comments
Closed

Images? #50

timholy opened this issue Mar 27, 2014 · 12 comments

Comments

@timholy
Copy link
Member

timholy commented Mar 27, 2014

Hate to do this to you, but is there any way I can get you to try running the tests for Images on 0.3? On my machine they pass, but here they fail with a Zlib error (CC @dcjones):

 in Reader at /home/idunning/pkgtest/.julia/v0.3/Zlib/src/Zlib.jl:256
 in Reader at /home/idunning/pkgtest/.julia/v0.3/Zlib/src/Zlib.jl:248
 in imread at /home/idunning/pkgtest/.julia/v0.3/Images/src/ioformats/nrrd.jl:84
 in tryread at /home/idunning/pkgtest/.julia/v0.3/Images/src/io.jl:83
 in anonymous at /home/idunning/pkgtest/.julia/v0.3/Images/src/io.jl:88
 in open at io.jl:368
 in imread at /home/idunning/pkgtest/.julia/v0.3/Images/src/io.jl:73
 in include_from_node1 at loading.jl:120
while loading /home/idunning/pkgtest/.julia/v0.3/Images/test/readnrrd.jl, in expression starting on line 33
while loading /home/idunning/pkgtest/.julia/v0.3/Images/test/runtests.jl, in expression starting on line 4

(I love being able to see the reason for the failure!)

I believe I've seen that error once on my machine, out of thousands of runs, but I have the impression that Images repeatedly fails on yours.

@IainNZ
Copy link
Contributor

IainNZ commented Mar 27, 2014

Looks like I'm truncating too much of the error message, let me pull the full one

@IainNZ
Copy link
Contributor

IainNZ commented Mar 27, 2014

ERROR: new not defined
 in Reader at /home/idunning/pkgtest/.julia/v0.3/Zlib/src/Zlib.jl:243
 in Reader at /home/idunning/pkgtest/.julia/v0.3/Zlib/src/Zlib.jl:256
 in Reader at /home/idunning/pkgtest/.julia/v0.3/Zlib/src/Zlib.jl:248
 in imread at /home/idunning/pkgtest/.julia/v0.3/Images/src/ioformats/nrrd.jl:84
 in tryread at /home/idunning/pkgtest/.julia/v0.3/Images/src/io.jl:83
 in anonymous at /home/idunning/pkgtest/.julia/v0.3/Images/src/io.jl:88
 in open at io.jl:368
 in imread at /home/idunning/pkgtest/.julia/v0.3/Images/src/io.jl:73
 in include_from_node1 at loading.jl:120
while loading /home/idunning/pkgtest/.julia/v0.3/Images/test/readnrrd.jl, in expression starting on line 33
while loading /home/idunning/pkgtest/.julia/v0.3/Images/test/runtests.jl, in expression starting on line 4

@IainNZ
Copy link
Contributor

IainNZ commented Mar 27, 2014

Why does it work on 0.2 but not 0.3??

@timholy
Copy link
Member Author

timholy commented Mar 27, 2014

Ah, that error message makes much more sense. The error itself is still weird. I'm going to run this through valgrind.

@timholy
Copy link
Member Author

timholy commented Mar 27, 2014

On my machine, nothing really came up with valgrind. But then again, the code almost always works on mine machine.

Does that test fail reliably on your machine? This looks like JuliaLang/julia#5153.

@timholy
Copy link
Member Author

timholy commented Mar 27, 2014

(If it is a reliable failure, it would be worth trying git bisect to see if one can isolate the commit.)

@IainNZ
Copy link
Contributor

IainNZ commented Mar 27, 2014

I'm trying on my own machine (5 day old master), I get

idunning@IAIN-DESKTOP:~/.../Images/test$ julia runtests.jl 
ERROR: assertion failed: convert(Array,b) == scale(Images.scaleinfo(a),a)
 in error at error.jl:21
 in include_from_node1 at loading.jl:120
while loading /home/idunning/.julia/v0.3/Images/test/io.jl, in expression starting on line 13
while loading /home/idunning/.julia/v0.3/Images/test/runtests.jl, in expression starting on line 3

with Images v0.2.34

but here is the strangest thing - apparently PkgEvaluator tested 0.2.32...?!

@timholy
Copy link
Member Author

timholy commented Mar 27, 2014

I tagged new versions today, so if PkgEvaluator ran last night it was surely the older version.

That error is weird; I doubt there is anything that should have changed in the last 24 hours to make that fail. Is this error reliable? (The test does depend on random numbers.) If so, what are the values of convert(Array, b) and scale(Images.scaleinfo(a), a)?

@IainNZ
Copy link
Contributor

IainNZ commented Mar 27, 2014

Ah ok, that explains that.

It happens consistently, I added some printlns

println(convert(Array, b))
println(scale(Images.scaleinfo(a), a))
111 146
250 5

176 199
253 38

@timholy
Copy link
Member Author

timholy commented Mar 28, 2014

I've tested this on two machines (one Kubuntu 12.04 and one CentOS 6.4) and I can't reproduce this. What platform are you on? What version of ImageMagic is installed? What happens if you do this at the REPL?

julia> using Images

julia> a = rand(2,2)
2x2 Array{Float64,2}:
 0.857786  0.513943 
 0.191519  0.0527182

julia> imwrite(a, "test.png")

julia> scale(scaleinfo(a), a)
2x2 Array{Uint8,2}:
 0xdb  0x83
 0x31  0x0d

julia> b = imread("test.png")
Gray Image with:
  data: 2x2 Array{Uint8,2}
  properties:
    colorspace: Gray
    spatialorder:  x y
    limits: (0x00,0xff)

julia> convert(Array, b)
2x2 Array{Uint8,2}:
 0xdb  0x83
 0x31  0x0d

@timholy
Copy link
Member Author

timholy commented Apr 2, 2014

Now it's mysteriously passing, every day, on 0.3.

@timholy timholy closed this as completed Apr 2, 2014
@IainNZ
Copy link
Contributor

IainNZ commented Apr 2, 2014

At least now we can look back over time and see when things break a bit easier!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants