I'm sorry, I found no possibility to directly extract a "proper" ImageFormat from the parsed or generated Image object.
This is my code, you can adopt it by storing the static ImageFormat member instead of the mimetype.
if (image.RawFormat.Equals(ImageFormat.Jpeg))
binary.MetaInfo.Mimetype = "image/jpeg";
else if (image.RawFormat.Equals(ImageFormat.Bmp))
binary.MetaInfo.Mimetype = "image/bmp";
else if (image.RawFormat.Equals(ImageFormat.Emf))
binary.MetaInfo.Mimetype = "image/emf";
else if (image.RawFormat.Equals(ImageFormat.Exif))
binary.MetaInfo.Mimetype = "image/exif";
else if (image.RawFormat.Equals(ImageFormat.Gif))
binary.MetaInfo.Mimetype = "image/gif";
else if (image.RawFormat.Equals(ImageFormat.Icon))
binary.MetaInfo.Mimetype = "image/icon";
else if (image.RawFormat.Equals(ImageFormat.Png))
binary.MetaInfo.Mimetype = "image/png";
else if (image.RawFormat.Equals(ImageFormat.Tiff))
binary.MetaInfo.Mimetype = "image/tiff";
else if (image.RawFormat.Equals(ImageFormat.Wmf))
binary.MetaInfo.Mimetype = "image/wmf";
You could tidy it up by using an array of static ImageFormat members, but I think you won't be able to avoid a switch or a loop.
Best regards, Matthias