Mercurial > octave
diff scripts/image/imformats.m @ 21758:ffad2baa90f7
maint: Use newlines to make code more readable.
author | Rik <rik@octave.org> |
---|---|
date | Fri, 20 May 2016 15:46:45 -0700 |
parents | b571fc85953f |
children | bac0d6f07a3e |
line wrap: on
line diff
--- a/scripts/image/imformats.m Fri May 20 12:03:39 2016 -0700 +++ b/scripts/image/imformats.m Fri May 20 15:46:45 2016 -0700 @@ -71,6 +71,7 @@ ## Author: Carnë Draug <carandraug@octave.org> function varargout = imformats (arg1, arg2, arg3) + if (nargin > 3) print_usage (); endif @@ -138,6 +139,7 @@ else varargout{1} = formats; endif + endfunction function formats = default_formats () @@ -254,6 +256,7 @@ ## fills rest of format information by checking with GraphicsMagick formats = __magick_formats__ (formats); + endfunction function is_valid_format (format) @@ -264,21 +267,24 @@ if (! all (fields_mask)) error ("imformats: structure has missing field `%s'.", min_fields(! fields_mask){1}); endif + endfunction function match = find_ext_idx (formats, ext) - ## XXX: what should we do if there's more than one hit? - ## Should this function prevent the addition of - ## duplicated extensions? + ## 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) + bool = false; try info = __magick_ping__ (filename, 1); bool = strcmp (coder, info.Format); end_try_catch + endfunction function pretty_print_formats (formats) @@ -315,6 +321,7 @@ endfunction + ## This must work, even without support for image IO %!test %! formats = imformats ();