uses jpeg;procecure TForm1.ShowPicture(const FileName: string);
var
  w, h, x: integer;
  JpegImage: TJpegImage;
begin
  x := 99;
  Image1.Stretch := true;
  Image1.AutoSize := false;
  if LowerCase(ExtractFileExt(FileName)) = '.jpg' then
  begin
    JpegImage := TJpegImage.Create;
    JpegImage.LoadFromFile(FileName);
    Image1.Picture.Graphic.Assign(JpegImage);
    JpegImage.Free;
  end
  else
    Image1.Picture.LoadFromFile(FileName);
  with Image1.Picture do
  begin
    w := Width;
    h := Height;
    while (w>100) or (h>100) do
    begin
      w := trunc(Width * x / 100);
      h := trunc(Height * x / 100);
      dec(x);
    end;
  end;
  Image1.Width := w;
  Image1.Height := h;
end;