-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathisFilenameRawImageFile.m
More file actions
37 lines (33 loc) · 960 Bytes
/
Copy pathisFilenameRawImageFile.m
File metadata and controls
37 lines (33 loc) · 960 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
%
%% isFilenameRawImageFile
%
% Determines if the filename specified represents a raw image format by
% comparing its file extension against a list of known raw image extensions
%
% _Parameters_
% * filename - Filename to check
%
% _Return Values_
% * isRawFile - true if the filename indicates the file is a raw image, false
% otherwise.
%
function isRawFile = isFilenameRawImageFile(filename)
persistent knownRawFileExtensions;
if (isempty(knownRawFileExtensions))
knownRawFileExtensions = {...
'.3fr',... % Hasselblad
'.arw',... % Sony
'.cr2',... % Canon
'.cr3',... % Canon
'.dng',... % Multiple vendors
'.iiq',... % Phase One
'.nef',... % Nikon
'.orf',... % Olympus
'.pef',... % Pentax
'.raf',... % Fuji
'.rw2'... % Panasonic
};
end
[~,~,fileExt] = fileparts(filename);
isRawFile = any(ismember(knownRawFileExtensions, lower(fileExt)));
end