to foam
在这里提问肯定是要通过delphi编写程序来实现改变jpeg图片尺寸,按常规方法,会丢失了exif信息。
常规方法:
bmp:=TbitMap.Create;
jpg:=TJpegImage.Create;
img:=Timage.Create(nil);
try
img.Picture.LoadFromFile(img1);
if img.Picture.Width>imgWidth then
begin
bmp.width:=imgWidth;
bmp.Height:=img.Picture.Height*imgWidth div img.Picture.Width;
end else
begin
bmp.Width:=img.Picture.Width;
bmp.Height:=img.Picture.Height;
end;
bmp.Canvas.StretchDraw(bmp.Canvas.ClipRect,img.Picture.Graphic);
jpg.Assign(bmp);
jpg.CompressionQuality:=cq;
jpg.Performance:=jpBestQuality;
jpg.Smoothing:=true;
jpg.SaveToFile(img2);
finally
bmp.Free;
jpg.Free;
img.Free;
end;