Mercurial > octave
annotate scripts/image/private/imageIO.m @ 24068:0d7a7fc657ff
scripts/image/private/imageIO.m: put filename between quotes in error message
* scripts/image/private/imageIO.m: having the filename between quotes on
an error message helps in identifying trailing whitespace on the filename.
author | Carnë Draug <carandraug@octave.org> |
---|---|
date | Thu, 21 Sep 2017 16:56:01 +0100 |
parents | e3cb3b761aa7 |
children | 194eb4bd202b |
rev | line source |
---|---|
23219
3ac9f9ecfae5
maint: Update copyright dates.
John W. Eaton <jwe@octave.org>
parents:
23083
diff
changeset
|
1 ## Copyright (C) 2013-2017 Carnë Draug |
16906
bfad37d33435
Connect imfinfo with imformats.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
2 ## |
bfad37d33435
Connect imfinfo with imformats.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
3 ## This file is part of Octave. |
bfad37d33435
Connect imfinfo with imformats.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
4 ## |
bfad37d33435
Connect imfinfo with imformats.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
5 ## Octave is free software; you can redistribute it and/or modify it |
bfad37d33435
Connect imfinfo with imformats.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
6 ## under the terms of the GNU General Public License as published by |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
7 ## the Free Software Foundation; either version 3 of the License, or |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
8 ## (at your option) any later version. |
16906
bfad37d33435
Connect imfinfo with imformats.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
9 ## |
bfad37d33435
Connect imfinfo with imformats.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
10 ## Octave is distributed in the hope that it will be useful, but |
bfad37d33435
Connect imfinfo with imformats.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
13 ## GNU General Public License for more details. |
16906
bfad37d33435
Connect imfinfo with imformats.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
14 ## |
bfad37d33435
Connect imfinfo with imformats.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
15 ## You should have received a copy of the GNU General Public License |
bfad37d33435
Connect imfinfo with imformats.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
16 ## along with Octave; see the file COPYING. If not, see |
bfad37d33435
Connect imfinfo with imformats.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
17 ## <http://www.gnu.org/licenses/>. |
bfad37d33435
Connect imfinfo with imformats.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
18 |
18298
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
19 ## This function the image input functions imread() and imfinfo() to the |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
20 ## functions that will actually be used, based on their format. See below |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
21 ## on the details on how it identifies the format, and to what it defaults. |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
22 ## |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
23 ## It will change the input arguments that were passed to imread() and |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
24 ## imfinfo(). It will change the filename to provide the absolute filepath |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
25 ## for the file, it will extract the possible format name from the rest of |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
26 ## the input arguments (in case there was one), and will give an error if |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
27 ## the file can't be found. |
16906
bfad37d33435
Connect imfinfo with imformats.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
28 ## |
18298
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
29 ## Usage: |
16906
bfad37d33435
Connect imfinfo with imformats.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
30 ## |
18298
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
31 ## func - Function name to use on error message. |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
32 ## core_func - Function handle for the default function to use if we can't |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
33 ## find the format in imformats. |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
34 ## fieldname - Name of the field in the struct returned by imformats that |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
35 ## has the function to use. |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
36 ## filename - Most likely the first input argument from the function that |
21751
b571fc85953f
maint: Use two spaces after period to indicate sentence break.
Rik <rik@octave.org>
parents:
20713
diff
changeset
|
37 ## called this. May be missing the file extension which can be |
18298
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
38 ## on varargin. |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
39 ## varargin - Followed by all the OTHER arguments passed to imread and |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
40 ## imfinfo. |
16944
1b3b3ee88284
Add optional extension argument to image IO functions.
Carnë Draug <carandraug@octave.org>
parents:
16906
diff
changeset
|
41 |
18298
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
42 function varargout = imageIO (func, core_func, fieldname, filename, varargin) |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
43 |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
44 ## First thing: figure out the filename and possibly download it. |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
45 ## The first attempt is to try the filename and see if it exists. If it |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
46 ## does not, we try to add the next argument since the file extension can |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
47 ## be given as a separate argument. If we still can't find the file, it |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
48 ## can be a URL. Lastly, if we still didn't found a file, try adding the |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
49 ## extension to the URL |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
50 |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
51 file_2_delete = false; # will we have to remove the file in the end? |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
52 persistent abs_path = @(x) file_in_path (IMAGE_PATH, tilde_expand (x)); |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
53 |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
54 ## Filename was given with file extension |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
55 fn = abs_path (filename); |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
56 if (isempty (fn) && ! isempty (varargin)) |
23240
e3cb3b761aa7
Only imread a URL if the input looks like a URL (bug #49228).
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
57 ## Maybe if we add a file extension? |
18298
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
58 fn = abs_path ([filename "." varargin{1}]); |
16906
bfad37d33435
Connect imfinfo with imformats.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
59 endif |
16944
1b3b3ee88284
Add optional extension argument to image IO functions.
Carnë Draug <carandraug@octave.org>
parents:
16906
diff
changeset
|
60 |
23240
e3cb3b761aa7
Only imread a URL if the input looks like a URL (bug #49228).
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
61 ## Maybe we have a URL |
e3cb3b761aa7
Only imread a URL if the input looks like a URL (bug #49228).
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
62 if (isempty (fn) |
e3cb3b761aa7
Only imread a URL if the input looks like a URL (bug #49228).
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
63 && ! isempty (regexp (filename, '^[a-zA-Z][a-zA-Z0-9.+-]+:'))) |
18298
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
64 file_2_delete = true; # mark file for deletion |
19278
6ca096827123
Use tempname() rather than tmpnam() in core Octave.
Rik <rik@octave.org>
parents:
18538
diff
changeset
|
65 [fn, ~] = urlwrite (filename, tempname ()); |
23240
e3cb3b761aa7
Only imread a URL if the input looks like a URL (bug #49228).
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
66 ## Maybe the URL is missing the file extension? |
18298
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
67 if (isempty (fn) && ! isempty (varargin)) |
19278
6ca096827123
Use tempname() rather than tmpnam() in core Octave.
Rik <rik@octave.org>
parents:
18538
diff
changeset
|
68 [fn, ~] = urlwrite ([filename "." varargin{1}], tempname ()); |
18298
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
69 endif |
23240
e3cb3b761aa7
Only imread a URL if the input looks like a URL (bug #49228).
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
70 endif |
18298
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
71 |
23240
e3cb3b761aa7
Only imread a URL if the input looks like a URL (bug #49228).
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
72 if (isempty (fn)) |
24068
0d7a7fc657ff
scripts/image/private/imageIO.m: put filename between quotes in error message
Carnë Draug <carandraug@octave.org>
parents:
23240
diff
changeset
|
73 error ([func ": unable to find file '" filename "'"]); |
16906
bfad37d33435
Connect imfinfo with imformats.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
74 endif |
18298
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
75 |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
76 ## unwind_protect block because we may have a file to remove in the end |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
77 unwind_protect |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
78 |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
79 ## When guessing the format to use, we first check if the second |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
80 ## argument is a format defined in imformats. If so, we remove it |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
81 ## from the rest of arguments before passing them on. If not, we |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
82 ## try to guess the format from the file extension. Finally, if |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
83 ## we still don't know the format, we use the Octave core functions |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
84 ## which is the same for all formats. |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
85 foo = []; # the function we will use |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
86 |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
87 ## We check if the call to imformats (ext) worked using |
18538
fcd87f68af4f
Deprecate nfields and replace with numfields.
Rik <rik@octave.org>
parents:
18298
diff
changeset
|
88 ## "numfields (fmt) > 0 because when it fails, the returned |
18298
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
89 ## struct is not considered empty. |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
90 |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
91 ## try the second input argument |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
92 if (! isempty (varargin) && ischar (varargin{1})) |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
93 fmt = imformats (varargin{1}); |
18538
fcd87f68af4f
Deprecate nfields and replace with numfields.
Rik <rik@octave.org>
parents:
18298
diff
changeset
|
94 if (numfields (fmt) > 0) |
18298
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
95 foo = fmt.(fieldname); |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
96 varargin(1) = []; # remove format name from arguments |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
97 endif |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
98 endif |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
99 |
20713
2469d78a1d8b
Consistently use 'filename' rather than 'file name' throughout code base.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
100 ## try extension from filename |
18298
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
101 if (isempty (foo)) |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
102 [~, ~, ext] = fileparts (fn); |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
103 if (! isempty (ext)) |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
104 ## remove dot from extension |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
105 ext = ext(2:end); |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
106 endif |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
107 fmt = imformats (ext); |
18538
fcd87f68af4f
Deprecate nfields and replace with numfields.
Rik <rik@octave.org>
parents:
18298
diff
changeset
|
108 if (numfields (fmt) > 0) |
18298
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
109 foo = fmt.(fieldname); |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
110 endif |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
111 endif |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
112 |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
113 ## use the core function |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
114 if (isempty (foo)) |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
115 foo = core_func; |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
116 endif |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
117 |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
118 [varargout{1:nargout}] = foo (fn, varargin{:}); |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
119 |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
120 unwind_protect_cleanup |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
121 if (file_2_delete) |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
122 unlink (fn); |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
123 endif |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
124 end_unwind_protect |
15db54c4a572
Fix input parsing for imageIO functions and make imread accept URL (bug #41234)
Carnë Draug <carandraug@octave.org>
parents:
17338
diff
changeset
|
125 |
16906
bfad37d33435
Connect imfinfo with imformats.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
126 endfunction |