function htwmimgdb(fp, inputdir, outputdir, img_ext, imsizes) %HTWMIMGDB % HTWMIMGDB(fp, 'inputdir', 'outputdir', 'urldir', img_ext) % % See also HTOPEN, HTCLOSE, HTWHR, HTWIMNAME, HTWPAR, HTWHANDLE % % Further Information: % http://www.vision.ime.usp.br/~casado/matlab/htmltoolbox/ % % This program is free software; you can redistribute it and/or % modify it under the terms of the GNU General Public License % as published by the Free Software Foundation; either version 2 % of the License, or (at your option) any later version. % % This program is distributed in the hope that it will be useful, % but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, write to the Free Software % Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. % % Copyright (c) 2000 by Andre Casado Castano and Roberto M Cesar Jr. % e-mail:casado@vision.ime.usp.br, cesar@ime.usp.br % $Revision: 1.01 $ $Date: 2001/01/03 $ if (nargin<4) img_ext = 'jpg'; end if (nargin<5) imsizes = 20; end if (imsizes>100) error('imsizes > 100 in HTWIMGDB!'); end % copy some information to www directory and URL them cpsmm = ['!cp ' inputdir '*.' img_ext ' ' outputdir '.']; eval(cpsmm); ht544(outputdir); imfiles = dir([inputdir '*.' img_ext]); nfiles = length(imfiles); for indf=1:nfiles im = imread([inputdir imfiles(indf).name]); im = im(:,:,1); [lins,cols] = size(im); lstep = floor(100/imsizes); cstep = floor(100/imsizes); iconim = im(1:lstep:lins, 1:cstep:cols); iconimfilename = ['icon_' imfiles(indf).name]; imwrite(iconim, [outputdir iconimfilename], 'jpg'); fprintf(fp,'',imfiles(indf).name); fprintf(fp,'', iconimfilename); fprintf(fp,'\n'); end