function ResizeImg(Image : TJPegImage) : TJPegImage;
var bitmap: TBitmap;
const Dispwidth = 309;
begin
Try
bitmap := TBitmap.create;
result := TJPegImage.create;
bitmap.width := Dispwidth;
bitmap.height := round(Image.Height/(Image.Width/Dispwidth));
bitmap.canvas.stretchDraw(rect( 0,0, Dispwidth, round(Image.Height/(Image.Width/Dispwidth))), Image);
result.Assign(bitmap);
result.JpegNeeded;
Finally
bitmap.free;
end;
end;