Code covered by the BSD License  

Highlights from
Generate HTML Table with thumbnails from jpg images

image thumbnail
from Generate HTML Table with thumbnails from jpg images by Theodoros Giannakopoulos
Creates an html table that contains the thumbnails (and links) of the jpg images of a whole director

resizeJPG(fileName,newFileName,preferredW)
function resizeJPG(fileName,newFileName,preferredW)
RGB = imread(fileName);
[H,W,t] = size(RGB);
if (W>H)
    ratio = preferredW / W;
else
    ratio = preferredW / H;
end
RGBnew = imresize(RGB,ratio);
[X,map] = rgb2ind(RGBnew);
[M,N] = size(X);
imwrite(RGBnew,newFileName,'Quality',100,'BitDepth',8);

Contact us at files@mathworks.com