Question: Today, I wanna to scan some QR codes using C#. Because, why no?
So, I am using Emgu (package from NuGet), and when I am trying to save image, I receive this error.

```
System.Runtime.InteropServices.ExternalException: 'A generic error occurred in GDI+.'

```

This is code I am using:

```
Capture capture = new Capture(); //create a camera capture
Bitmap image = capture.QueryFrame().Bitmap; //take a picture
image.Save((path + "data" + i.ToString() + ".jpg").Replace(" ", "_"));

```

What's wrong here?

Answer: 
Ran across this and found that my issue was resolved by specifying a format in the save:

```
bmpImage.Save(filename,System.Drawing.Imaging.ImageFormat.Png);

```
Fix some path error:

```
string path = Path.Combine(baseDirectory, "img" + i.ToString() + ".jpg");

```