Organize old files
This commit is contained in:
22
workflow/.old/apps/matlab/ezview/TempBU/folderBmp2jpgSpareCpy.m
Executable file
22
workflow/.old/apps/matlab/ezview/TempBU/folderBmp2jpgSpareCpy.m
Executable file
@@ -0,0 +1,22 @@
|
||||
%tif2jpeg converter
|
||||
[Scanfiles, pathname]=uigetfile('*', 'Select a Folder File');
|
||||
path=pathname;
|
||||
dirLst=dir(path);
|
||||
for i=1:size(dirLst,1)
|
||||
if ~isempty(str2num(dirLst(i).name))
|
||||
selDir=fullfile(path,dirLst(i).name);
|
||||
filelst=dir(selDir);
|
||||
|
||||
for n=1:size(filelst,1)
|
||||
try
|
||||
if ~isempty(strfind(filelst(n).name,'bmp'))
|
||||
inFile=filelst(n).name;
|
||||
a=imread(fullfile(selDir,inFile)); %(inFile{1});
|
||||
outFile= strrep(inFile,'.bmp','.jpg');
|
||||
imwrite(a,fullfile(selDir,outFile), 'quality',95)
|
||||
end
|
||||
catch
|
||||
end
|
||||
end
|
||||
end %if ~isempty(str2num(dirLst(i).name))
|
||||
end %for all numeric folders
|
||||
Reference in New Issue
Block a user