title: How to convert TIFF to JPEG?
body: <p>I am trying to convert a TIFF file to JPEG using FreeImage.</p>
  
  <p>The problem is that <code>FreeIamge.SaveToStream</code> doesn't actually do anything. Even after the call, <code>stream</code> has a <code>Length</code>, <code>Capacity</code> and <code>Position</code> of 0.</p>
  
  <p>This is my code:</p>
  
  <pre><code>using (var stream = new MemoryStream())
  {
      var image = FreeImage.LoadEx(fileName);
      FreeImage.SaveToStream(image, stream, FREE_IMAGE_FORMAT.FIF_JPEG,
                             FREE_IMAGE_SAVE_FLAGS.JPEG_QUALITYSUPERB);
  
      // stream.Length, stream.Capacity &amp; stream.Position are all 0 here
  }
  </code></pre>
  
  <p>What am I doing wrong?</p>