Reading the Magic-Header signatures first and then guessing from the file
extension may be a better approach.

In spatialite gaia_exif.c, the function gaiaGuessBlobType has a collection
of signatures to start with, combined with spatialite.c guess_mime_type
returning the mime type as string.

  //----------------------------------------------------------
  // https://en.wikipedia.org/wiki/List_of_file_signatures
  // https://gist.github.com/navinpai/983632
  // https://www.iana.org/assignments/media-types/media-types.xhtml
  //----------------------------------------------------------

Mark Johnson, Berlin Germany
_______________________________________________
gdal-dev mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to