[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Image search path?
From: |
Mike Miller |
Subject: |
Re: Image search path? |
Date: |
Thu, 5 Feb 2015 09:21:23 -0500 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Fri, Feb 06, 2015 at 00:36:07 +1100, Alasdair McAndrew wrote:
> I understand that "addpath" can be set up in .octaverc to add directories
> of commands to Octave. But how do I search for images?
>
> I've tried using "IMAGE_PATH" in my .octaverc, and indeed when I call
> "dump_prefs()" the paths are all listed. But "imread" from the image
> package can't find images in these directories.
>
> How can I add directories that are searchable by imread?
Are you setting IMAGE_PATH to a pathsep-delimited list of directories
appropriate to your OS? This works for me:
octave:1> IMAGE_PATH (".")
octave:2> x = imread ("debian-logo.png");
warning: your version of GraphicsMagick limits images to 8 bits per pixel
error: imread: cannot find debian-logo.png
error: called from:
error: /usr/share/octave/3.8.2/m/image/private/__imread__.m at line 56,
column 5
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
octave:2> IMAGE_PATH (strjoin ({".", "/usr/share/pixmaps"}, pathsep));
octave:3> x = imread ("debian-logo.png");
octave:4> size (x)
ans =
48 48 3
--
mike