Ignore:
Timestamp:
Aug 6, 2013, 3:47:07 PM (11 years ago)
Author:
sommeria
Message:

various bugs corrected

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/find_imadoc.m

    r507 r672  
    1010% RootPath,SubDir,RootFile,FileExt, as given from the input file name by fileparts_uvmat
    1111function XmlFileName=find_imadoc(RootPath,SubDir,RootFile,FileExt)
    12 SubDirBase=regexprep(SubDir,'\..*','');%take the root part of SubDir, before the first dot '.'
    13 XmlFileName=[fullfile(RootPath,SubDirBase) '.xml'];%new convention: xml at the level of the image folder
     12SubDirBase=SubDir;
     13XmlFileName=fullfile(RootPath,[SubDir '.xml']);
     14if ~exist (XmlFileName,'file')
     15    dotchar=regexp(SubDir,'\.');
     16    for idot=1:numel(dotchar)
     17        XmlFileName=fullfile(RootPath,[SubDir(1:dotchar(end-idot+1)) '.xml']);
     18        if exist(XmlFileName,'file')
     19            SubDirBase=fullfile(RootPath,SubDir(1:dotchar(end-idot+1)));
     20            break
     21        end
     22    end   
     23end
     24% SubDirBase=regexprep(SubDir,'\..*','');%take the root part of SubDir, before the first dot '.'
     25% XmlFileName=[fullfile(RootPath,SubDirBase) '.xml'];%new convention: xml at the level of the image folder
    1426if ~exist(XmlFileName,'file')
    1527    XmlFileName=[fullfile(RootPath,SubDirBase,RootFile) '.xml']; % old convention: xml inside the image folder, case of images or new civ files
Note: See TracChangeset for help on using the changeset viewer.