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.
So now i have a problem to covert gif images to jpeg.
Sample code:
data = File.ReadAllBytes(ImgPath);
data is byte[] type so i have image path now i want to convert into jpeg before ReadAllBytes() callls
I tried like this :
using (Image img = Image.FromFile(ImgPath))
{
img.Save(ImgPath, System.Drawing.Imaging.ImageFormat.Jpeg);
}
But i got Generic error Gdi something is came. thanks.