title: How can I open a bitmap file , change it and then save it?
body: <p>I am trying to open a bitmap file and then change it and save it, but I am getting some error. The code is as follow:</p>
  
  <pre><code>var tempFileNamePath = Path.Combine(workingDirectory, fileName);
  Bitmap image = new Bitmap(tempFileNamePath);
  var newImage = (Bitmap)image.Clone();
  image.Dispose();
  
  newImage.EnhanceImage();
  newImage.Save(tempFileNamePath, System.Drawing.Imaging.ImageFormat.Jpeg);
  newImage.Dispose();
  </code></pre>
  
  <p>But it fails to save the file with error: A generic error happens in GDI+</p>
  
  <p>Any thought of why tis is happening? </p>