d=dir;


k=1;
for i=1:length(d)
    i
    if d(i).isdir==0
        if isequal(d(i).name(1:4),'DSCN')
            I=imread(d(i).name);
            IR=imresize(I,0.1,'bilinear');
            imwrite(IR,['TPics',num2str(k),'.jpg'],'jpeg')
            k=k+1;
        end
    end
end


Rotate={'WPics29.jpg','TPics29.jpg','WPics28.jpg','TPics28.jpg'};
Angles=[270,270,90,90];

for i=1:length(Rotate)
    I=imread(Rotate{i});
    I=imrotate(I,Angles(i));
    imwrite(I,Rotate{i},'jpeg');
end
