1 ## Copyright (C) 2008-2012 Soren Hauberg <hauberg@gmail.com>
3 ## This file is part of Octave.
5 ## Octave is free software; you can redistribute it and/or modify it
6 ## under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation; either version 3 of the License, or (at
8 ## your option) any later version.
10 ## Octave is distributed in the hope that it will be useful, but
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 ## General Public License for more details.
15 ## You should have received a copy of the GNU General Public License
16 ## along with Octave; see the file COPYING. If not, see
17 ## <http://www.gnu.org/licenses/>.
20 ## @deftypefn {Function File} {@var{info} =} imfinfo (@var{filename})
21 ## @deftypefnx {Function File} {@var{info} =} imfinfo (@var{url})
22 ## Read image information from a file.
24 ## @code{imfinfo} returns a structure containing information about the image
25 ## stored in the file @var{filename}. The output structure contains the
30 ## The full name of the image file.
33 ## Number of bytes of the image on disk
36 ## Date of last modification to the file.
39 ## Image height in pixels.
42 ## Image Width in pixels.
45 ## Number of bits per channel per pixel.
48 ## Image format (e.g., @code{"jpeg"}).
51 ## Long form image format description.
54 ## X resolution of the image.
57 ## Y resolution of the image.
60 ## Number of unique colors in the image.
65 ## @item AnimationDelay
66 ## Time in 1/100ths of a second (0 to 65535) which must expire before displaying
67 ## the next image in an animated sequence.
69 ## @item AnimationIterations
70 ## Number of iterations to loop an animation (e.g., Netscape loop extension)
74 ## Endian option for formats that support it. Is either @code{"little-endian"},
75 ## @code{"big-endian"}, or @code{"undefined"}.
78 ## Gamma level of the image. The same color image displayed on two different
79 ## workstations may look different due to differences in the display monitor.
82 ## @code{true} if the image has transparency.
85 ## Image modulus depth (minimum number of bits required to support
87 ## components without loss of accuracy).
90 ## JPEG/MIFF/PNG compression level.
92 ## @item QuantizeColors
93 ## Preferred number of colors in the image.
95 ## @item ResolutionUnits
96 ## Units of image resolution. Is either @code{"pixels per inch"},
97 ## @code{"pixels per centimeter"}, or @code{"undefined"}.
100 ## Image type. Is either @code{"grayscale"}, @code{"indexed"},
101 ## @code{"truecolor"},
102 ## or @code{"undefined"}.
105 ## FlashPix viewing parameters.
108 ## @seealso{imread, imwrite}
111 function info = imfinfo (filename)
117 if (!ischar (filename))
118 error ("imfinfo: FILENAME must be a string");
121 filename = tilde_expand (filename);
127 fn = file_in_path (IMAGE_PATH, filename);
131 ## Couldn't find file. See if it's an URL.
135 [fn, status, msg] = urlwrite (filename, tmp);
138 error ("imfinfo: cannot find %s", filename);
147 info = __magick_finfo__ (fn);
149 unwind_protect_cleanup