% makeThumbNails
% 
% 
% Makes thumbnails of Figure with specified pxl resolution
%
% Useful script for the generation of thumbnails to enable figures' visualization in 
% http://kml.deltares.nl/kml/rijkswaterstaat/jarkus/jarkus_coastlineGraphs/

impath  = 'd:\test\';
subpath = 'subtest\';

image     = dir([impath subpath '*.png']);
tnpath    = '\\kml\kml\kml\rijkswaterstaat\testGiorgio\tn\';
subtnpath = 'subtntest\';

if ~isdir([tnpath subtnpath])
    mkdir([tnpath subtnpath])
end

% Choose Nan for Xres or Yres if you just want to adapt the image to Xres
% either Yres
ResRow   = 300;
ResCol   = 450; 

for i = 1:length(image)

    J = imread([impath subpath image(i).name]);
    I = imresize(J, [ResRow ResCol]);

    imwrite(I,[tnpath subtnpath image(i).name])

end