title: BitmapEncoder.CreateForTranscoding corrupts the png image
body: <p>I am trying to write metadata to a png file using BitmapEncoder.</p>
  <pre><code>stream = co_await storageFile.OpenAsync(WS::FileAccessMode::ReadWrite);
  decoder = co_await Windows::Graphics::Imaging::BitmapDecoder::CreateAsync(stream);
  encoder = co_await Windows::Graphics::Imaging::BitmapEncoder::CreateForTranscoding(stream, decoder);
  
  auto propertySet = winrt::Windows::Graphics::Imaging::BitmapPropertySet();
  auto ratingValue = winrt::box_value(L&quot;10&quot;);
  auto value = winrt::Windows::Graphics::Imaging::BitmapTypedValue(ratingValue, winrt::Windows::Foundation::PropertyType::String);
  propertySet.Insert(L&quot;/tEXt/{str=Rating}&quot;, value);
  
  co_await encoder.BitmapProperties().SetPropertiesAsync(propertySet);
  co_await encoder.FlushAsync();
  
  </code></pre>
  <p>Image before:
  <a href="https://i.stack.imgur.com/aYSxV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aYSxV.png" alt="enter image description here" /></a></p>
  <p>Image after:
  <a href="https://i.stack.imgur.com/jxPgI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jxPgI.png" alt="enter image description here" /></a></p>