title: Identify Raster (jpg, png, etc.) or svg file format from ByteString
body: <p>In C# (.NET FW 4.5), is there a way to understand if a bytestring holds an .svg file or any raster file? I use this routine:</p>
  
  <pre><code>[...]
  byte[] img = System.Convert.FromBase64String(res);
  ctrlImage = new BitmapImage();
  ctrlImage.BeginInit();
  MemoryStream ms = new MemoryStream(img);                                        
  ctrlImage.StreamSource = ms;
  ctrlImage.EndInit();
  </code></pre>
  
  <p>to convert the stream to a <code>BitmpatImage</code>, but now I need to verify if <code>res</code> contains an svg file and not a raster file.</p>
  
  <p>Thank you.</p>