How to get the MIME type of the picture

Hi,

I have picture in excel sheet. I would like to know the MIME type of the picture. Is there a way to get this info through aspose?

Regards,
Azhar

Hi Azhar,

Thanks for your posting and using Aspose.Cells.

You cannot get the MIME type of the picture using Aspose.Cells API. However, you can get the Image Format of the picture i.e png, bmp, jpeg etc using Picture.getImageFormat() method.

Once, you retrieve it, you can create the MIME type by yourself e.g

  • image/png
  • image/gif
  • image/jpg

etc

Most pictures in MS-Excel will be of png type because MS-Excel converts most pictures into PNG format by itself.

This link lists down all the MIME types for your reference.

  • http://www.feedforall.com/mime-types.htm