Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imread bug while loading BMP file on Mac OS X #193

Closed
alexandreyc opened this issue Sep 27, 2014 · 10 comments
Closed

imread bug while loading BMP file on Mac OS X #193

alexandreyc opened this issue Sep 27, 2014 · 10 comments

Comments

@alexandreyc
Copy link

Hi,

I've a problem while using the imread function for loading bmp file :

julia> img = Images.imread("data/trainResized/1.Bmp")
ERROR: key not found: 8
 in getindex at dict.jl:615
 in imread at /Users/alexandre/.julia/v0.3/Images/src/ioformats/OSXnative.jl:57
 in imread at /Users/alexandre/.julia/v0.3/Images/src/io.jl:105

I'm using OS X 10.9.5, Julia 0.3.1 and I've installed ImageMagick with MacPorts.

Is there anyone that could help me?

Thanks

@jgbos
Copy link

jgbos commented Sep 27, 2014

Can confirm this happens with PNG as well. The cause is most likely related to the latest OSX update, everything worked fine until my computer just updated.

@kmsquire
Copy link
Collaborator

Interesting. Not sure if this will work, but try running Pkg.build("Images") and seeing if that helps.

@jgbos
Copy link

jgbos commented Sep 27, 2014

No errors during the build, here's the output:

INFO: Building Homebrew
remote: Counting objects: 73, done.
remote: Compressing objects: 100% (49/49), done.
remote: Total 73 (delta 59), reused 38 (delta 24)
Unpacking objects: 100% (73/73), done.
From https://github.com/Homebrew/homebrew
   5057268..26231bb  master     -> origin/master
HEAD is now at 26231bb haxe: update dependencies
HEAD is now at 73c6cfe Bottle cbc
INFO: Building Images

On Sat, Sep 27, 2014 at 1:32 PM, Kevin Squire notifications@github.com
wrote:

Interesting. Not sure if this will work, but try running
Pkg.build("Images") and seeing if that helps.


Reply to this email directly or view it on GitHub
#193 (comment).

@timholy
Copy link
Member

timholy commented Sep 27, 2014

A couple of observations:

  • Notice the error came from OSXnative.jl.
  • Pkg.build("Images") is a great default reaction to I/O problems, but the OSXnative reader isn't affected by anything that happens in the build script. So in this case, you can cross Homebrew, BinDeps, or build.jl off as potential suspects.
  • It's quite suspicious that an OS update seems implicated.

So, let's find out what changed. See that error about line 57, and the line above it saying "key not found"? From the julia prompt, try something like this:

edit("/Users/alexandre/.julia/v0.3/Images/src/ioformats/OSXnative.jl",57)

(or just open the file in an editor any way that works). You'll notice that line is looking something up in a dictionary. Let's see what that key value actually is: put something like

@show pixeldepth

before that line and see what it says.

@timholy
Copy link
Member

timholy commented Sep 27, 2014

(I'd do this myself, but I don't have a Mac.)

@timholy
Copy link
Member

timholy commented Sep 27, 2014

Oh, wait: looking at the output more closely, I bet the key is "8". I bet 366679f broke this. Fix coming momentarily.

@timholy
Copy link
Member

timholy commented Sep 27, 2014

Fixed by 0a16a21. Available through Pkg.update().

@timholy timholy closed this as completed Sep 27, 2014
@jgbos
Copy link

jgbos commented Sep 27, 2014

That did it. Thanks, must have updated before the OSX update.

On Sat, Sep 27, 2014 at 2:33 PM, Tim Holy notifications@github.com wrote:

Closed #193 #193.


Reply to this email directly or view it on GitHub
#193 (comment).

@alexandreyc
Copy link
Author

It also worked for me. Thanks

@timholy
Copy link
Member

timholy commented Sep 27, 2014

Glad it worked, and thanks everyone for reporting back.

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

No branches or pull requests

4 participants