How to load an arbitrary image from a BLOB stream into a TImage?
If I understand it correctly, `TGraphic.LoadFromFile` determines the type of picture from the file extension.

Is there any way to detect the image type automatically from a `TBlobStream` with a raw image in it?

My current code:

    procedure LoadImageFromStream(AImage: TImage; ADataSet: TDataSet);
    var
      Stream: TStream;
    begin
      Stream := ADataSet.CreateBlobStream(Field, bmRead);
      try
        AImage.Picture.Graphic.LoadFromStream(Stream);
      finally
        Stream.Free;
      end;
    end
How to load an arbitrary image from a BLOB stream into a TImage?
===

If I understand it correctly, `TGraphic.LoadFromFile` determines the type of picture from the file extension.

Is there any way to detect the image type automatically from a `TBlobStream` with a raw image in it?

My current code:

    procedure LoadImageFromStream(AImage: TImage; ADataSet: TDataSet);
    var
      Stream: TStream;
    begin
      Stream := ADataSet.CreateBlobStream(Field, bmRead);
      try
        AImage.Picture.Graphic.LoadFromStream(Stream);
      finally
        Stream.Free;
      end;
    end