title: How to convert gif images to jpeg in c# code winforms?
body: <p>I am trying to convert my gif/png images to jpeg then after that i want to pass
    these images to sqldatabase. Because crystal report doesnot support gif images
    for displaying as a report.</p>
  
  <p>So now i have a problem to covert gif images to jpeg.</p>
  
  <p>Sample code:</p>
  
  <pre><code>data = File.ReadAllBytes(ImgPath);
  </code></pre>
  
  <p>data is byte[] type so i have image path now i want to convert into jpeg
      before ReadAllBytes() callls </p>
  
  <p>I tried like this :</p>
  
  <pre><code>   using (Image img = Image.FromFile(ImgPath))
     {
               img.Save(ImgPath, System.Drawing.Imaging.ImageFormat.Jpeg);
     }
  </code></pre>
  
  <p>But i got Generic error Gdi something is came.
     thanks.</p>