Error while reading image

221 views
Skip to first unread message

Siddha Ganju

unread,
Mar 14, 2014, 6:36:10 AM3/14/14
to julia...@googlegroups.com
I am trying to read an image and get the following error: 

julia> img = imread("rose.png")
ErrorException("Do not know how to read file rose.png")

julia> img = imread("rose.jpg")
ErrorException("Do not know how to read file rose.jpg")

Its the same for all file extensions. I have tried updating by Pkg.update(). Still get the same result. Also Pkg.status() does not show anything weird. I have gone over the threads but could not find any related answer. Any idea what am I missing here? 

Ivar Nesje

unread,
Mar 14, 2014, 6:57:32 AM3/14/14
to julia...@googlegroups.com
You are at least missing some references to what package you are using.

I would assume that you are using Images, and from the source of imread, it seems like the file you are trying to open is not in a supported format, and you do not have ImageMagick. From the Images documentation it looks like ImageMagick is required for PNG and JPEG files.

Regards Ivar

Ivar Nesje

unread,
Mar 14, 2014, 7:01:54 AM3/14/14
to julia...@googlegroups.com
See also the README on how to install ImageMagick on your system.

Tim Holy

unread,
Mar 14, 2014, 8:33:08 AM3/14/14
to julia...@googlegroups.com
What does Pkg.build("Images") say?

--Tim

Siddha Ganju

unread,
Mar 14, 2014, 10:38:41 AM3/14/14
to julia...@googlegroups.com
On giving the following command I get: 

julia> Pkg.build("Images")
INFO: Building Images

Also I have already installed ImageMagick.


Tim Holy

unread,
Mar 14, 2014, 10:46:15 AM3/14/14
to julia...@googlegroups.com
What platform are you on? On Windows, `build` doesn't do anything now---you
have to install ImageMagick manually.

Basically, this is almost certainly a case of it not finding the proper path.
Did you add the appropriate directory to DL_LOAD_PATH? See the README.

--Tim

Siddha Ganju

unread,
Mar 15, 2014, 9:50:05 AM3/15/14
to julia...@googlegroups.com


On Windows I had installed ImageMagick manually. ImageMagick is working fine, so I think. But with Julia, I get the same errors.

Then on Ubuntu 12.04, while doing

Pkg.build("ImageView")

I get the errors as in the image. I have installed ImageMagick on Ubuntu, and added and exported the path too.

So the problem ultimately is the same I am unable to read any image, be it either on Windows or Ubuntu. Is it possible that this is hardware based?

Siddha Ganju

unread,
Mar 15, 2014, 9:54:56 AM3/15/14
to julia...@googlegroups.com
Sorry I forgot this part:

Should I try building each package and all its dependencies independently?

Tim Holy

unread,
Mar 15, 2014, 11:17:07 AM3/15/14
to julia...@googlegroups.com, Keno Fischer
Images and ImageView are separate. The easier case should be Linux, as my own
platform is Ubuntu 12.04 and it works fine. So let's start there.

First, does Pkg.build("Images") work? Note: Images, not ImageView!

Second, Pkg.build("ImageView") is failing because Pkg.build("Tk") is failing.
To me it looks like the build script (in $PKGDIR/Tk/deps/build.jl) is
expecting to find a tk8.6 package, but on Ubuntu 12.04 the latest is tk8.5. I'd
recommend manually doing
sudo apt-get install tk8.5 tcl8.5

Then try Pkg.build("Tk"). If that works, try Pkg.build("ImageView").

Let us know whether this works, so we know what to do to improve the build
script.

--Tim

Siddha Ganju

unread,
Mar 16, 2014, 12:44:32 AM3/16/14
to julia...@googlegroups.com
Yes, that works absolutely fine. But every-time I have to do "using
ImageView" I have to build it first. Pkg.build("Images") works
absolutely fine. Thank you for your help.
--
Siddha Ganju
3rd Year Undergraduate Student
Computer Science and Engineering Department
National Institute of Technology, Hamirpur - 177005
E-mail Id : siddh...@gmail.com

Tim Holy

unread,
Mar 16, 2014, 7:00:42 AM3/16/14
to julia...@googlegroups.com
Once it's built, you shouldn't have to build it again---the build script gets
called only when you upgrade to a new version. In other words, once both
`Pkg.build("Images")` and `Pkg.build("ImageView")` have completed without
error, you should be able to use either package freely. I have the impression
that you may have gotten errors when you first tried to install these packages
that you ignored or didn't tell us about, and that's part of the confusion.

Given that you're still experiencing trouble, I'd say your best course of
action is to remove these packages (Pkg.rm) and reinstall from scratch
(Pkg.add). I'd strongly recommend deleting Cairo and Tk as well as Images and
ImageView.

If you get any build errors, please paste in the complete record of the
output. Also please provide complete details about your platform, the results
of versioninfo(), and how you got Julia (install from distribution packages or
PPA? JuliaStudio? Direct clone from source?). Without this kind of
information, it's very hard to guess what's wrong.

--Tim
Reply all
Reply to author
Forward
0 new messages