help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: imread Win XP problems


From: Stefan van der Walt
Subject: Re: imread Win XP problems
Date: Sun, 31 Oct 2004 20:26:27 +0200
User-agent: Mutt/1.5.6+20040722i

Hi Jens

The 'imread' function doesn't like the spaces in the filename.

Put the following quick fix (named pathfix.m) somewhere in your
loadpath:

function f = pathfix(p)
        if (nargin != 1 || !isstr(p))
                usage("pathfix(p)");
        endif

        f = strrep(p, " ", "\\ ");
        if (strmatch("/cygdrive/", p) == 1)
                f = f(length("/cygdrive/")+1:end);
                f = [f(1) ":" f(2:end)];
        endif
endfunction

and change the "cmd=" line in imread.m to

cmd= sprintf("convert %s '%s' %s:%s 2>/dev/null ",
                  option_str, pathfix(fname), outputtype,
                  pathfix(tnam))


Hope that helps!

Regards
Stefan

On Fri, Oct 29, 2004 at 11:00:33AM -0500, Jens Köchling wrote:
> Hi.
> 
> when i use imread i get the following error messages:
> -----------
> I=imread('lena.jpg');
> error: could not read file: C:/Programme/GNU Octave 
> 2.1.50/tmp/oct-610ac7a4.0
> error: evaluating if command near line 178, column 4
> error: called from `imread' in file 
> `/opt/octave/share/octave/2.1.50/site/m/octave-forge/image/imread.m'
> error: evaluating assignment expression near line 4, column 2
> -----------
> 
> i am using Octave 2.1.50 under Win XP SP2. i have a propper installation 
> of ImageMagick-6.1.2-Q16.
> The path variable for ImageMagic is set to :
> c:\programme\imagemagick-6.1.2-q16
> 
> and it is the first path of the path variable..
> Hope you can help me :)
> 
> have a nice weekend,
> Jens
> 
> 
> 
> -------------------------------------------------------------
> Octave is freely available under the terms of the GNU GPL.
> 
> Octave's home on the web:  http://www.octave.org
> How to fund new projects:  http://www.octave.org/funding.html
> Subscription information:  http://www.octave.org/archive.html
> -------------------------------------------------------------
> 



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]