Search code examples
matlaboctavebmpimread

Octave imread bmp file


I need to read a file myFile.bmp in Octave but it doesn't work.

I have:

  • Ubuntu 15.04
  • Ocatve 3.8.2
  • ImageMagick 8:6.8.9.9-5

When I run imread('myFile.bmp'), I get this:

octave:10> imread ("myFile.bmp")
error: imread: invalid image file: /usr/lib/x86_64-linux-gnu/octave/3.8.2/oct/x86_64-pc-linux-gnu/__magick_read__.oct: failed to load: /usr/lib/x86_64-linux-gnu/octave/3.8.2/oct/x86_64-pc-linux-gnu/__magick_read__.oct: undefined symbol: _ZN6Magick5ColorC1Ehhh
error: called from:
error:   /usr/share/octave/3.8.2/m/image/private/__imread__.m at line 181, column 7
error:   /usr/share/octave/3.8.2/m/image/private/imageIO.m at line 66, column 26
error:   /usr/share/octave/3.8.2/m/image/imread.m at line 107, column 30

When I run imread('myFile.bmp', 'Format', 'bmp'), I get the same error.


Solution

  • If you installed everything from the Ubuntu repositories, then you are probably affected by an Ubuntu packaging issue. It was described in comment #6 of Ubuntu bug #1372202.

    Since Ubuntu 15.04 has already reached end of life, they probably won't fix it. You can:

    1. upgrade Ubuntu
    2. build Octave from source yourself