annotate scripts/image/imfinfo.m @ 27918:b442ec6dda5c

use centralized file for copyright info for individual contributors * COPYRIGHT.md: New file. * In most other files, use "Copyright (C) YYYY-YYYY The Octave Project Developers" instead of tracking individual names in separate source files. The motivation is to reduce the effort required to update the notices each year. Until now, the Octave source files contained copyright notices that list individual contributors. I adopted these file-scope copyright notices because that is what everyone was doing 30 years ago in the days before distributed version control systems. But now, with many contributors and modern version control systems, having these file-scope copyright notices causes trouble when we update copyright years or refactor code. Over time, the file-scope copyright notices may become outdated as new contributions are made or code is moved from one file to another. Sometimes people contribute significant patches but do not add a line claiming copyright. Other times, people add a copyright notice for their contribution but then a later refactoring moves part or all of their contribution to another file and the notice is not moved with the code. As a practical matter, moving such notices is difficult -- determining what parts are due to a particular contributor requires a time-consuming search through the project history. Even managing the yearly update of copyright years is problematic. We have some contributors who are no longer living. Should we update the copyright dates for their contributions when we release new versions? Probably not, but we do still want to claim copyright for the project as a whole. To minimize the difficulty of maintaining the copyright notices, I would like to change Octave's sources to use what is described here: https://softwarefreedom.org/resources/2012/ManagingCopyrightInformation.html in the section "Maintaining centralized copyright notices": The centralized notice approach consolidates all copyright notices in a single location, usually a top-level file. This file should contain all of the copyright notices provided project contributors, unless the contribution was clearly insignificant. It may also credit -- without a copyright notice -- anyone who helped with the project but did not contribute code or other copyrighted material. This approach captures less information about contributions within individual files, recognizing that the DVCS is better equipped to record those details. As we mentioned before, it does have one disadvantage as compared to the file-scope approach: if a single file is separated from the distribution, the recipient won't see the contributors' copyright notices. But this can be easily remedied by including a single copyright notice in each file's header, pointing to the top-level file: Copyright YYYY-YYYY The Octave Project Developers See the COPYRIGHT file at the top-level directory of this distribution or at https://octave.org/COPYRIGHT.html. followed by the usual GPL copyright statement. For more background, see the discussion here: https://lists.gnu.org/archive/html/octave-maintainers/2020-01/msg00009.html Most files in the following directories have been skipped intentinally in this changeset: doc libgui/qterminal liboctave/external m4
author John W. Eaton <jwe@octave.org>
date Mon, 06 Jan 2020 15:38:17 -0500
parents 00f796120a6d
children 1891570abac8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27918
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
1 ## Copyright (C) 2008-2019 The Octave Project Developers
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
2 ##
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
3 ## See the file COPYRIGHT.md in the top-level directory of this distribution
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
4 ## or <https://octave.org/COPYRIGHT.html/>.
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
5 ##
8144
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
6 ##
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
7 ## This file is part of Octave.
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
8 ##
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 24049
diff changeset
9 ## Octave is free software: you can redistribute it and/or modify it
8144
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
10 ## under the terms of the GNU General Public License as published by
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 24049
diff changeset
11 ## the Free Software Foundation, either version 3 of the License, or
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22558
diff changeset
12 ## (at your option) any later version.
8144
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
13 ##
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
14 ## Octave is distributed in the hope that it will be useful, but
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
15 ## WITHOUT ANY WARRANTY; without even the implied warranty of
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22558
diff changeset
16 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22558
diff changeset
17 ## GNU General Public License for more details.
8144
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
18 ##
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
19 ## You should have received a copy of the GNU General Public License
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
20 ## along with Octave; see the file COPYING. If not, see
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 24049
diff changeset
21 ## <https://www.gnu.org/licenses/>.
8144
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
22
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
23 ## -*- texinfo -*-
20852
516bb87ea72e 2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents: 20158
diff changeset
24 ## @deftypefn {} {@var{info} =} imfinfo (@var{filename})
516bb87ea72e 2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents: 20158
diff changeset
25 ## @deftypefnx {} {@var{info} =} imfinfo (@var{url})
516bb87ea72e 2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents: 20158
diff changeset
26 ## @deftypefnx {} {@var{info} =} imfinfo (@dots{}, @var{ext})
8144
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
27 ## Read image information from a file.
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
28 ##
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
29 ## @code{imfinfo} returns a structure containing information about the image
16944
1b3b3ee88284 Add optional extension argument to image IO functions.
Carnë Draug <carandraug@octave.org>
parents: 16906
diff changeset
30 ## stored in the file @var{filename}. If there is no file @var{filename},
1b3b3ee88284 Add optional extension argument to image IO functions.
Carnë Draug <carandraug@octave.org>
parents: 16906
diff changeset
31 ## and @var{ext} was specified, it will look for a file named @var{filename}
1b3b3ee88284 Add optional extension argument to image IO functions.
Carnë Draug <carandraug@octave.org>
parents: 16906
diff changeset
32 ## and extension @var{ext}, i.e., a file named @var{filename}.@var{ext}.
1b3b3ee88284 Add optional extension argument to image IO functions.
Carnë Draug <carandraug@octave.org>
parents: 16906
diff changeset
33 ##
1b3b3ee88284 Add optional extension argument to image IO functions.
Carnë Draug <carandraug@octave.org>
parents: 16906
diff changeset
34 ## The output structure @var{info} contains the following fields:
8144
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
35 ##
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
36 ## @table @samp
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
37 ## @item Filename
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
38 ## The full name of the image file.
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
39 ##
17350
ba79ba4e83ab Rewrite of imfinfo.
Carnë Draug <carandraug@octave.org>
parents: 17338
diff changeset
40 ## @item FileModDate
ba79ba4e83ab Rewrite of imfinfo.
Carnë Draug <carandraug@octave.org>
parents: 17338
diff changeset
41 ## Date of last modification to the file.
ba79ba4e83ab Rewrite of imfinfo.
Carnë Draug <carandraug@octave.org>
parents: 17338
diff changeset
42 ##
8144
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
43 ## @item FileSize
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
44 ## Number of bytes of the image on disk
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
45 ##
17350
ba79ba4e83ab Rewrite of imfinfo.
Carnë Draug <carandraug@octave.org>
parents: 17338
diff changeset
46 ## @item Format
ba79ba4e83ab Rewrite of imfinfo.
Carnë Draug <carandraug@octave.org>
parents: 17338
diff changeset
47 ## Image format (e.g., @qcode{"jpeg"}).
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
48 ##
8144
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
49 ## @item Height
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
50 ## Image height in pixels.
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
51 ##
8144
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
52 ## @item Width
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
53 ## Image Width in pixels.
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
54 ##
8144
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
55 ## @item BitDepth
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
56 ## Number of bits per channel per pixel.
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
57 ##
17350
ba79ba4e83ab Rewrite of imfinfo.
Carnë Draug <carandraug@octave.org>
parents: 17338
diff changeset
58 ## @item ColorType
ba79ba4e83ab Rewrite of imfinfo.
Carnë Draug <carandraug@octave.org>
parents: 17338
diff changeset
59 ## Image type. Value is @qcode{"grayscale"}, @qcode{"indexed"},
ba79ba4e83ab Rewrite of imfinfo.
Carnë Draug <carandraug@octave.org>
parents: 17338
diff changeset
60 ## @qcode{"truecolor"}, @qcode{"CMYK"}, or @qcode{"undefined"}.
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
61 ##
8144
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
62 ## @item XResolution
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
63 ## X resolution of the image.
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
64 ##
8144
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
65 ## @item YResolution
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
66 ## Y resolution of the image.
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
67 ##
17350
ba79ba4e83ab Rewrite of imfinfo.
Carnë Draug <carandraug@octave.org>
parents: 17338
diff changeset
68 ## @item ResolutionUnit
ba79ba4e83ab Rewrite of imfinfo.
Carnë Draug <carandraug@octave.org>
parents: 17338
diff changeset
69 ## Units of image resolution. Value is @qcode{"Inch"},
ba79ba4e83ab Rewrite of imfinfo.
Carnë Draug <carandraug@octave.org>
parents: 17338
diff changeset
70 ## @qcode{"Centimeter"}, or @qcode{"undefined"}.
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
71 ##
17350
ba79ba4e83ab Rewrite of imfinfo.
Carnë Draug <carandraug@octave.org>
parents: 17338
diff changeset
72 ## @item DelayTime
25003
2365c2661b3c doc: Spellcheck documentation ahead of 4.4 release.
Rik <rik@octave.org>
parents: 24534
diff changeset
73 ## Time in @nospell{1/100ths} of a second (0 to 65535) which must expire before
20158
7503499a252b doc: Update docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19697
diff changeset
74 ## displaying the next image in an animated sequence.
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
75 ##
17350
ba79ba4e83ab Rewrite of imfinfo.
Carnë Draug <carandraug@octave.org>
parents: 17338
diff changeset
76 ## @item LoopCount
ba79ba4e83ab Rewrite of imfinfo.
Carnë Draug <carandraug@octave.org>
parents: 17338
diff changeset
77 ## Number of iterations to loop an animation.
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
78 ##
8144
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
79 ## @item ByteOrder
21546
f7f97d7e9294 doc: Wrap m-file docstrings to 79 characters + newline (80 total).
Rik <rik@octave.org>
parents: 20852
diff changeset
80 ## Endian option for formats that support it. Value is
f7f97d7e9294 doc: Wrap m-file docstrings to 79 characters + newline (80 total).
Rik <rik@octave.org>
parents: 20852
diff changeset
81 ## @qcode{"little-endian"}, @qcode{"big-endian"}, or @qcode{"undefined"}.
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
82 ##
8144
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
83 ## @item Gamma
9051
1bf0ce0930be Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents: 8920
diff changeset
84 ## Gamma level of the image. The same color image displayed on two different
1bf0ce0930be Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents: 8920
diff changeset
85 ## workstations may look different due to differences in the display monitor.
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
86 ##
17350
ba79ba4e83ab Rewrite of imfinfo.
Carnë Draug <carandraug@octave.org>
parents: 17338
diff changeset
87 ## @item Quality
ba79ba4e83ab Rewrite of imfinfo.
Carnë Draug <carandraug@octave.org>
parents: 17338
diff changeset
88 ## JPEG/MIFF/PNG compression level. Value is an integer in the range [0 100].
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
89 ##
17350
ba79ba4e83ab Rewrite of imfinfo.
Carnë Draug <carandraug@octave.org>
parents: 17338
diff changeset
90 ## @item DisposalMethod
ba79ba4e83ab Rewrite of imfinfo.
Carnë Draug <carandraug@octave.org>
parents: 17338
diff changeset
91 ## Only valid for GIF images, control how successive frames are rendered (how
ba79ba4e83ab Rewrite of imfinfo.
Carnë Draug <carandraug@octave.org>
parents: 17338
diff changeset
92 ## the preceding frame is disposed of) when creating a GIF animation. Values
ba79ba4e83ab Rewrite of imfinfo.
Carnë Draug <carandraug@octave.org>
parents: 17338
diff changeset
93 ## can be @qcode{"doNotSpecify"}, @qcode{"leaveInPlace"}, @qcode{"restoreBG"},
ba79ba4e83ab Rewrite of imfinfo.
Carnë Draug <carandraug@octave.org>
parents: 17338
diff changeset
94 ## or @qcode{"restorePrevious"}. For non-GIF files, value is an empty string.
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
95 ##
17350
ba79ba4e83ab Rewrite of imfinfo.
Carnë Draug <carandraug@octave.org>
parents: 17338
diff changeset
96 ## @item Chromaticities
ba79ba4e83ab Rewrite of imfinfo.
Carnë Draug <carandraug@octave.org>
parents: 17338
diff changeset
97 ## Value is a 1x8 Matrix with the x,y chromaticity values for white, red,
ba79ba4e83ab Rewrite of imfinfo.
Carnë Draug <carandraug@octave.org>
parents: 17338
diff changeset
98 ## green, and blue points, in that order.
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
99 ##
17350
ba79ba4e83ab Rewrite of imfinfo.
Carnë Draug <carandraug@octave.org>
parents: 17338
diff changeset
100 ## @item Comment
ba79ba4e83ab Rewrite of imfinfo.
Carnë Draug <carandraug@octave.org>
parents: 17338
diff changeset
101 ## Image comment.
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
102 ##
17350
ba79ba4e83ab Rewrite of imfinfo.
Carnë Draug <carandraug@octave.org>
parents: 17338
diff changeset
103 ## @item Compression
ba79ba4e83ab Rewrite of imfinfo.
Carnë Draug <carandraug@octave.org>
parents: 17338
diff changeset
104 ## Compression type. Value can be @qcode{"none"}, @qcode{"bzip"},
ba79ba4e83ab Rewrite of imfinfo.
Carnë Draug <carandraug@octave.org>
parents: 17338
diff changeset
105 ## @qcode{"fax3"}, @qcode{"fax4"}, @qcode{"jpeg"}, @qcode{"lzw"},
ba79ba4e83ab Rewrite of imfinfo.
Carnë Draug <carandraug@octave.org>
parents: 17338
diff changeset
106 ## @qcode{"rle"}, @qcode{"deflate"}, @qcode{"lzma"}, @qcode{"jpeg2000"},
ba79ba4e83ab Rewrite of imfinfo.
Carnë Draug <carandraug@octave.org>
parents: 17338
diff changeset
107 ## @qcode{"jbig2"}, @qcode{"jbig2"}, or @qcode{"undefined"}.
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
108 ##
17350
ba79ba4e83ab Rewrite of imfinfo.
Carnë Draug <carandraug@octave.org>
parents: 17338
diff changeset
109 ## @item Colormap
ba79ba4e83ab Rewrite of imfinfo.
Carnë Draug <carandraug@octave.org>
parents: 17338
diff changeset
110 ## Colormap for each image.
ba79ba4e83ab Rewrite of imfinfo.
Carnë Draug <carandraug@octave.org>
parents: 17338
diff changeset
111 ##
ba79ba4e83ab Rewrite of imfinfo.
Carnë Draug <carandraug@octave.org>
parents: 17338
diff changeset
112 ## @item Orientation
ba79ba4e83ab Rewrite of imfinfo.
Carnë Draug <carandraug@octave.org>
parents: 17338
diff changeset
113 ## The orientation of the image with respect to the rows and columns. Value
ba79ba4e83ab Rewrite of imfinfo.
Carnë Draug <carandraug@octave.org>
parents: 17338
diff changeset
114 ## is an integer between 1 and 8 as defined in the TIFF 6 specifications, and
17513
fedcd3717ebc doc: grammarcheck of documentation before 3.8 release.
Rik <rik@octave.org>
parents: 17359
diff changeset
115 ## for @sc{matlab} compatibility.
17359
cf5d41cc3695 Expand imfinfo to read Exif tags and GPS information.
Carnë Draug <carandraug@octave.org>
parents: 17350
diff changeset
116 ##
cf5d41cc3695 Expand imfinfo to read Exif tags and GPS information.
Carnë Draug <carandraug@octave.org>
parents: 17350
diff changeset
117 ## @item Software
cf5d41cc3695 Expand imfinfo to read Exif tags and GPS information.
Carnë Draug <carandraug@octave.org>
parents: 17350
diff changeset
118 ## Name and version of the software or firmware of the camera or image input
cf5d41cc3695 Expand imfinfo to read Exif tags and GPS information.
Carnë Draug <carandraug@octave.org>
parents: 17350
diff changeset
119 ## device used to generate the image.
cf5d41cc3695 Expand imfinfo to read Exif tags and GPS information.
Carnë Draug <carandraug@octave.org>
parents: 17350
diff changeset
120 ##
cf5d41cc3695 Expand imfinfo to read Exif tags and GPS information.
Carnë Draug <carandraug@octave.org>
parents: 17350
diff changeset
121 ## @item Make
cf5d41cc3695 Expand imfinfo to read Exif tags and GPS information.
Carnë Draug <carandraug@octave.org>
parents: 17350
diff changeset
122 ## The manufacturer of the recording equipment. This is the manufacture of the
17514
5b916efea542 doc: spellcheck of documentation before 3.8 release.
Rik <rik@octave.org>
parents: 17513
diff changeset
123 ## @nospell{DSC}, scanner, video digitizer or other equipment that generated
5b916efea542 doc: spellcheck of documentation before 3.8 release.
Rik <rik@octave.org>
parents: 17513
diff changeset
124 ## the image.
17359
cf5d41cc3695 Expand imfinfo to read Exif tags and GPS information.
Carnë Draug <carandraug@octave.org>
parents: 17350
diff changeset
125 ##
cf5d41cc3695 Expand imfinfo to read Exif tags and GPS information.
Carnë Draug <carandraug@octave.org>
parents: 17350
diff changeset
126 ## @item Model
20158
7503499a252b doc: Update docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19697
diff changeset
127 ## The model name or model number of the recording equipment as mentioned on
7503499a252b doc: Update docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19697
diff changeset
128 ## the field @qcode{"Make"}.
17359
cf5d41cc3695 Expand imfinfo to read Exif tags and GPS information.
Carnë Draug <carandraug@octave.org>
parents: 17350
diff changeset
129 ##
cf5d41cc3695 Expand imfinfo to read Exif tags and GPS information.
Carnë Draug <carandraug@octave.org>
parents: 17350
diff changeset
130 ## @item DateTime
17513
fedcd3717ebc doc: grammarcheck of documentation before 3.8 release.
Rik <rik@octave.org>
parents: 17359
diff changeset
131 ## The date and time of image creation as defined by the Exif standard, i.e.,
17359
cf5d41cc3695 Expand imfinfo to read Exif tags and GPS information.
Carnë Draug <carandraug@octave.org>
parents: 17350
diff changeset
132 ## it is the date and time the file was changed.
cf5d41cc3695 Expand imfinfo to read Exif tags and GPS information.
Carnë Draug <carandraug@octave.org>
parents: 17350
diff changeset
133 ##
cf5d41cc3695 Expand imfinfo to read Exif tags and GPS information.
Carnë Draug <carandraug@octave.org>
parents: 17350
diff changeset
134 ## @item ImageDescription
cf5d41cc3695 Expand imfinfo to read Exif tags and GPS information.
Carnë Draug <carandraug@octave.org>
parents: 17350
diff changeset
135 ## The title of the image as defined by the Exif standard.
cf5d41cc3695 Expand imfinfo to read Exif tags and GPS information.
Carnë Draug <carandraug@octave.org>
parents: 17350
diff changeset
136 ##
cf5d41cc3695 Expand imfinfo to read Exif tags and GPS information.
Carnë Draug <carandraug@octave.org>
parents: 17350
diff changeset
137 ## @item Artist
cf5d41cc3695 Expand imfinfo to read Exif tags and GPS information.
Carnë Draug <carandraug@octave.org>
parents: 17350
diff changeset
138 ## Name of the camera owner, photographer or image creator.
cf5d41cc3695 Expand imfinfo to read Exif tags and GPS information.
Carnë Draug <carandraug@octave.org>
parents: 17350
diff changeset
139 ##
cf5d41cc3695 Expand imfinfo to read Exif tags and GPS information.
Carnë Draug <carandraug@octave.org>
parents: 17350
diff changeset
140 ## @item Copyright
cf5d41cc3695 Expand imfinfo to read Exif tags and GPS information.
Carnë Draug <carandraug@octave.org>
parents: 17350
diff changeset
141 ## Copyright notice of the person or organization claiming rights to the image.
cf5d41cc3695 Expand imfinfo to read Exif tags and GPS information.
Carnë Draug <carandraug@octave.org>
parents: 17350
diff changeset
142 ##
cf5d41cc3695 Expand imfinfo to read Exif tags and GPS information.
Carnë Draug <carandraug@octave.org>
parents: 17350
diff changeset
143 ## @item DigitalCamera
cf5d41cc3695 Expand imfinfo to read Exif tags and GPS information.
Carnë Draug <carandraug@octave.org>
parents: 17350
diff changeset
144 ## A struct with information retrieved from the Exif tag.
cf5d41cc3695 Expand imfinfo to read Exif tags and GPS information.
Carnë Draug <carandraug@octave.org>
parents: 17350
diff changeset
145 ##
cf5d41cc3695 Expand imfinfo to read Exif tags and GPS information.
Carnë Draug <carandraug@octave.org>
parents: 17350
diff changeset
146 ## @item GPSInfo
cf5d41cc3695 Expand imfinfo to read Exif tags and GPS information.
Carnë Draug <carandraug@octave.org>
parents: 17350
diff changeset
147 ## A struct with geotagging information retrieved from the Exif tag.
8144
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
148 ## @end table
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
149 ##
16944
1b3b3ee88284 Add optional extension argument to image IO functions.
Carnë Draug <carandraug@octave.org>
parents: 16906
diff changeset
150 ## @seealso{imread, imwrite, imshow, imformats}
8144
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
151 ## @end deftypefn
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
152
16768
e2de3c8882be copyright notice fixes
John W. Eaton <jwe@octave.org>
parents: 15683
diff changeset
153 ## Author: Soren Hauberg <hauberg@gmail.com>
e2de3c8882be copyright notice fixes
John W. Eaton <jwe@octave.org>
parents: 15683
diff changeset
154
18298
15db54c4a572 Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents: 17744
diff changeset
155 function info = imfinfo (filename, varargin)
21758
ffad2baa90f7 maint: Use newlines to make code more readable.
Rik <rik@octave.org>
parents: 21575
diff changeset
156
16944
1b3b3ee88284 Add optional extension argument to image IO functions.
Carnë Draug <carandraug@octave.org>
parents: 16906
diff changeset
157 if (nargin < 1 || nargin > 2)
8144
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
158 print_usage ();
18298
15db54c4a572 Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents: 17744
diff changeset
159 elseif (! ischar (filename))
11472
1740012184f9 Use uppercase for variable names in error() strings to match Info documentation. Only m-files done.
Rik <octave@nomad.inbox5.com>
parents: 10821
diff changeset
160 error ("imfinfo: FILENAME must be a string");
24049
6782105f1820 imfinfo.m: Fix error when a second argument is used (bug #52041).
Mike Miller <mtmiller@octave.org>
parents: 23416
diff changeset
161 elseif (nargin > 1 && ! ischar (varargin{1}))
16944
1b3b3ee88284 Add optional extension argument to image IO functions.
Carnë Draug <carandraug@octave.org>
parents: 16906
diff changeset
162 error ("imfinfo: EXT must be a string");
8144
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
163 endif
21758
ffad2baa90f7 maint: Use newlines to make code more readable.
Rik <rik@octave.org>
parents: 21575
diff changeset
164
18298
15db54c4a572 Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents: 17744
diff changeset
165 info = imageIO ("imfinfo", @__imfinfo__, "info", filename, varargin{:});
21758
ffad2baa90f7 maint: Use newlines to make code more readable.
Rik <rik@octave.org>
parents: 21575
diff changeset
166
8144
01fac748b680 Add the 'imfinfo' function for reading image file information.
sh@sh-laptop
parents:
diff changeset
167 endfunction
17338
1c89599167a6 maint: End m-files with 1 blank line.
Rik <rik@octave.org>
parents: 17281
diff changeset
168
21758
ffad2baa90f7 maint: Use newlines to make code more readable.
Rik <rik@octave.org>
parents: 21575
diff changeset
169
21575
bc9aa534bc29 maint: Clean up BIST tests so they don't produce warnings.
Rik <rik@octave.org>
parents: 21546
diff changeset
170 ## This test is the same as the similar one in imread. imfinfo must check
bc9aa534bc29 maint: Clean up BIST tests so they don't produce warnings.
Rik <rik@octave.org>
parents: 21546
diff changeset
171 ## if file exists before calling __imfinfo_. This BIST test confirms this.
18298
15db54c4a572 Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents: 17744
diff changeset
172 %!testif HAVE_MAGICK
23416
a40434df6f54 Rename warning ID GraphicsMagic-Quantum-Depth GraphicsMagick-Quantum-Depth.
Carnë Draug <carandraug@octave.org>
parents: 23220
diff changeset
173 %! warning ("off", "Octave:GraphicsMagick-Quantum-Depth", "local");
18298
15db54c4a572 Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents: 17744
diff changeset
174 %! fmt = fmt_ori = imformats ("jpg");
15db54c4a572 Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents: 17744
diff changeset
175 %! fmt.info = @true;
15db54c4a572 Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents: 17744
diff changeset
176 %! error_thrown = false;
15db54c4a572 Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents: 17744
diff changeset
177 %! imformats ("update", "jpg", fmt);
15db54c4a572 Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents: 17744
diff changeset
178 %! unwind_protect
15db54c4a572 Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents: 17744
diff changeset
179 %! try
22558
1751d490dc2f test: Change tests w/imread to use names without spaces (bug #49219).
Rik <rik@octave.org>
parents: 22323
diff changeset
180 %! imread ("I_sure_hope_this_file_does_not_exist.jpg");
18298
15db54c4a572 Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents: 17744
diff changeset
181 %! catch
15db54c4a572 Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents: 17744
diff changeset
182 %! error_thrown = true;
15db54c4a572 Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents: 17744
diff changeset
183 %! end_try_catch
15db54c4a572 Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents: 17744
diff changeset
184 %! unwind_protect_cleanup
15db54c4a572 Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents: 17744
diff changeset
185 %! imformats ("update", "jpg", fmt_ori);
15db54c4a572 Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents: 17744
diff changeset
186 %! end_unwind_protect
15db54c4a572 Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents: 17744
diff changeset
187 %! assert (error_thrown, true);
24049
6782105f1820 imfinfo.m: Fix error when a second argument is used (bug #52041).
Mike Miller <mtmiller@octave.org>
parents: 23416
diff changeset
188
6782105f1820 imfinfo.m: Fix error when a second argument is used (bug #52041).
Mike Miller <mtmiller@octave.org>
parents: 23416
diff changeset
189 ## Test input validation
6782105f1820 imfinfo.m: Fix error when a second argument is used (bug #52041).
Mike Miller <mtmiller@octave.org>
parents: 23416
diff changeset
190 %!error imfinfo ()
6782105f1820 imfinfo.m: Fix error when a second argument is used (bug #52041).
Mike Miller <mtmiller@octave.org>
parents: 23416
diff changeset
191 %!error imfinfo (1,2,3)
6782105f1820 imfinfo.m: Fix error when a second argument is used (bug #52041).
Mike Miller <mtmiller@octave.org>
parents: 23416
diff changeset
192 %!error <FILENAME must be a string> imfinfo (1)
6782105f1820 imfinfo.m: Fix error when a second argument is used (bug #52041).
Mike Miller <mtmiller@octave.org>
parents: 23416
diff changeset
193 %!error <EXT must be a string> imfinfo ("foo", 1)