# HG changeset patch # User jwe # Date 854727421 0 # Node ID 64aff25e8be30d806bd5e336ee7dbf2278339249 # Parent c3453130473b3b9799279f7d9d648855b4a0285c [project @ 1997-01-31 16:16:53 by jwe] diff -r c3453130473b -r 64aff25e8be3 scripts/ChangeLog --- a/scripts/ChangeLog Fri Jan 31 16:01:06 1997 +0000 +++ b/scripts/ChangeLog Fri Jan 31 16:17:01 1997 +0000 @@ -1,3 +1,14 @@ +Fri Jan 31 09:30:16 1997 John W. Eaton + + * image/loadimage.m: Make it possible to load files with image + data named X or img. + + * image/default.img: Change name of image from X to img to match + what saveimage does now. + + * image/loadimage.m: Rename X to be img, to match what saveimage + does now. + Mon Jan 27 13:48:31 1997 John W. Eaton * Version 2.0.2 released. diff -r c3453130473b -r 64aff25e8be3 scripts/image/default.img --- a/scripts/image/default.img Fri Jan 31 16:01:06 1997 +0000 +++ b/scripts/image/default.img Fri Jan 31 16:17:01 1997 +0000 @@ -66,7 +66,7 @@ 0.96825 0.96825 0.96825 0.98413 0.98413 0.98413 1.00000 1.00000 1.00000 -# name: img +# name: X # type: matrix # rows: 53 # columns: 40 diff -r c3453130473b -r 64aff25e8be3 scripts/image/loadimage.m --- a/scripts/image/loadimage.m Fri Jan 31 16:01:06 1997 +0000 +++ b/scripts/image/loadimage.m Fri Jan 31 16:17:01 1997 +0000 @@ -19,7 +19,7 @@ ## Load an image file. ## -## [X, map] = loadimage (img_file) loads an image and it's associated +## [img, map] = loadimage (img_file) loads an image and it's associated ## color map from file img_file. The image must be in stored in ## octave's image format. ## @@ -29,10 +29,10 @@ ## Created: July 1994 ## Adapted-By: jwe -function [X, map] = loadimage (filename) +function [img_retval, map_retval] = loadimage (filename) if (nargin != 1) - usage ("loadimage (filename)"); + usage ("[img, map] = loadimage (filename)"); elseif (! isstr (filename)) error ("loadimage: expecting filename as a string"); endif @@ -43,8 +43,22 @@ error ("loadimage: unable to find image file"); endif - ## XXX FIXME XXX -- file is assumed to have variables X and map. + ## The file is assumed to have variables img and map, or X and map. eval (['load ', file]); + if (exist ("img")) + img_retval = img; + elseif (exist ("X")) + img_retval = X; + else + error ("loadimage: invalid image file found"); + endif + + if (exist ("map")) + map_retval = map; + else + error ("loadimage: invalid image file found"); + endif + endfunction