How does one save a PPImage found in a presentation to a file? PPImage
only has a ContentType
property, but (a) there is no out-of-the-box way to translate that to a file extension and (b) there may be several possible file extensions associated with a mime type.
For example:
foreach (PPImage image in presentation.Images)
{
File.SaveAllBytes("How_Do_I_Determine_The_File_Extension???", image.BinaryData);
}
So far I can think of:
(1) on windows, look up the content type in HKCR\MIME\Database
(2) use Aspose.Imaging.Image.GetFileFormat(Stream)
and just use .ToString() from the file format.
is there a built-in way in aspose to do this in a generic way?