Mercurial > octave
diff scripts/image/imformats.m @ 28945:6e460773bdda
maint: Use newlines after "function" and before "endfunction" for clarity.
* quad2d.m, rng.m, __ok_cancel_dlg__.m, __unimplemented__.m,
get_first_help_sentence.m, imformats.m, vectorize.m, ordeig.m, inputParser.m,
tar_is_bsd.m, publish.m, axis.m, legend.m, polar.m, __plt__.m, print.m,
__add_default_menu__.m, __gnuplot_draw_axes__.m, struct2hdl.m, movfun.m,
gmres.m, pcg.m, __alltohandles__.m, tfqmr.m, betaincinv.m, gammainc.m,
gammaincinv.m, mean.m, weboptions.m:
Use newlines after "function" and before "endfunction" for clarity.
author | Rik <rik@octave.org> |
---|---|
date | Fri, 16 Oct 2020 09:27:56 -0700 |
parents | 0de38a6ef693 |
children | 7854d5752dd2 |
line wrap: on
line diff
--- a/scripts/image/imformats.m Thu Oct 15 21:24:06 2020 -0700 +++ b/scripts/image/imformats.m Fri Oct 16 09:27:56 2020 -0700 @@ -77,7 +77,7 @@ function varargout = imformats (arg1, arg2, arg3) - mlock (); # prevent formats to be removed by "clear all" + mlock (); # prevent formats being removed by "clear all" persistent formats = default_formats (); if (nargin == 0 && nargout == 0) @@ -102,7 +102,7 @@ if (! ischar (arg2)) error ("imformats: EXT to %s must be a string", arg1); endif - ## FIXME: suppose a format with multiple extensions. If one of + ## FIXME: Suppose a format with multiple extensions; if one of ## them is requested to be removed, should we remove the ## whole format, or just that extension from the format? match = find_ext_idx (formats, arg2); @@ -126,7 +126,7 @@ otherwise ## then we look for a format with that extension. match = find_ext_idx (formats, arg1); - ## For matlab compatibility, if we don't find any format we must + ## For Matlab compatibility, if we don't find any format we must ## return an empty struct with NO fields. We can't use match as mask if (any (match)) varargout{1} = formats(match); @@ -264,6 +264,7 @@ endfunction function is_valid_format (format) + ## the minimal list of fields required in the structure. We don't ## require multipage because it doesn't exist in matlab min_fields = {"ext", "read", "isa", "write", "info", "alpha", "description"}; @@ -275,10 +276,12 @@ endfunction function match = find_ext_idx (formats, ext) + ## FIXME: what should we do if there's more than one hit? ## Should this function prevent the addition of ## duplicated extensions? match = cellfun (@(x) any (strcmpi (x, ext)), {formats.ext}); + endfunction function bool = isa_magick (coder, filename)