TImage32.GetExtFromImageStream

class function GetExtFromImageStream(stream: TStream): string;

Returns the stream's format as a three character string (eg BMP, PNG, JPG).