Code covered by the BSD License  

Highlights from
HTML Indexer

image thumbnail

HTML Indexer

by

 

16 Aug 2004 (Updated )

automated multi-language html index, index for print, batch image scaling

prjUpdate(FileList, Dir, Options)
function FileList = prjUpdate(FileList, Dir, Options)
% update info in FileList dupa ce umbli la resolutii, batch, etc.
% 
% FileList = prjUpdate(FileList, Dir, Options)
%
% FileList  - o structura provenita din dir, filtrata pe tipuri grafice
% Dir       - directoarele in care lucrez
% Options   - contine html, resolutiile de iesire
%
% v.045c    - 2004.04.09, new

for i=1: size(FileList,2)
    fn_src = [FileList(i).path '\' FileList(i).name];
    fid_src = fopen(fn_src); fclose(fid_src);
    img_info = imfinfo(fn_src);
    
    FileList(i).scalefactor_th = max(img_info.Height, img_info.Width)/Options.ThSize;
    FileList(i).scalefactor_gy = max(img_info.Height, img_info.Width)/Options.GySize;
    % aici check : daca e aproape de N, fa-l N
    if Options.smartscale
        FileList(i).scalefactor_th = round(FileList(i).scalefactor_th);
        FileList(i).scalefactor_gy = round(FileList(i).scalefactor_gy);
    end;
    
    FileList(i).th_height = round(img_info.Height/FileList(i).scalefactor_th);
    FileList(i).th_width = round(img_info.Width/FileList(i).scalefactor_th);
    FileList(i).gy_height = round(img_info.Height/FileList(i).scalefactor_gy);
    FileList(i).gy_width = round(img_info.Width/FileList(i).scalefactor_gy);
    FileList(i).or_height = img_info.Height;
    FileList(i).or_width = img_info.Width;     
end;

Contact us