hphp/runtime/ext/gd/ext_gd.cpp
static char *php_image_type_to_mime_type(int image_type) {
  switch( image_type) {
  case IMAGE_FILETYPE_GIF:
    return "image/gif";
  case IMAGE_FILETYPE_JPEG:
    return "image/jpeg";
  case IMAGE_FILETYPE_PNG:
    return "image/png";
  case IMAGE_FILETYPE_SWF:
  case IMAGE_FILETYPE_SWC:
    return "application/x-shockwave-flash";
  case IMAGE_FILETYPE_PSD:
    return "image/psd";
  case IMAGE_FILETYPE_BMP:
    return "image/x-ms-bmp";
  case IMAGE_FILETYPE_TIFF_II:
  case IMAGE_FILETYPE_TIFF_MM:
    return "image/tiff";
  case IMAGE_FILETYPE_IFF:
    return "image/iff";
  case IMAGE_FILETYPE_WBMP:
    return "image/vnd.wap.wbmp";
  case IMAGE_FILETYPE_JPC:
    return "application/octet-stream";
  case IMAGE_FILETYPE_JP2:
    return "image/jp2";
  case IMAGE_FILETYPE_XBM:
    return "image/xbm";
  case IMAGE_FILETYPE_ICO:
    return "image/vnd.microsoft.icon";
  case IMAGE_FILETYPE_WEBP:
    return "image/webp";
  default:
  case IMAGE_FILETYPE_UNKNOWN:
    return "application/octet-stream"; /* suppose binary format */
  }
}
/* Convert internal image_type to mime type */
Convert internal image_type to mime type
Convert internal image_type to mime type
static char *php_image_type_to_mime_type(int image_type) {
  switch( image_type) {
  case IMAGE_FILETYPE_GIF:
    return "image/gif";
  case IMAGE_FILETYPE_JPEG:
    return "image/jpeg";
  case IMAGE_FILETYPE_PNG:
    return "image/png";
  case IMAGE_FILETYPE_SWF:
  case IMAGE_FILETYPE_SWC:
    return "application/x-shockwave-flash";
  case IMAGE_FILETYPE_PSD:
    return "image/psd";
  case IMAGE_FILETYPE_BMP:
    return "image/x-ms-bmp";
  case IMAGE_FILETYPE_TIFF_II:
  case IMAGE_FILETYPE_TIFF_MM:
    return "image/tiff";
  case IMAGE_FILETYPE_IFF:
    return "image/iff";
  case IMAGE_FILETYPE_WBMP:
    return "image/vnd.wap.wbmp";
  case IMAGE_FILETYPE_JPC:
    return "application/octet-stream";
  case IMAGE_FILETYPE_JP2:
    return "image/jp2";
  case IMAGE_FILETYPE_XBM:
    return "image/xbm";
  case IMAGE_FILETYPE_ICO:
    return "image/vnd.microsoft.icon";
  case IMAGE_FILETYPE_WEBP:
    return "image/webp";
  default:
  case IMAGE_FILETYPE_UNKNOWN:
    return "application/octet-stream"; 
  }
}
static char * php_image_type_to_mime_type ( int image_type ) { switch ( image_type ) { case IMAGE_FILETYPE_GIF : return " " ; case IMAGE_FILETYPE_JPEG : return " " ; case IMAGE_FILETYPE_PNG : return " " ; case IMAGE_FILETYPE_SWF : case IMAGE_FILETYPE_SWC : return " " ; case IMAGE_FILETYPE_PSD : return " " ; case IMAGE_FILETYPE_BMP : return " " ; case IMAGE_FILETYPE_TIFF_II : case IMAGE_FILETYPE_TIFF_MM : return " " ; case IMAGE_FILETYPE_IFF : return " " ; case IMAGE_FILETYPE_WBMP : return " " ; case IMAGE_FILETYPE_JPC : return " " ; case IMAGE_FILETYPE_JP2 : return " " ; case IMAGE_FILETYPE_XBM : return " " ; case IMAGE_FILETYPE_ICO : return " " ; case IMAGE_FILETYPE_WEBP : return " " ; default : case IMAGE_FILETYPE_UNKNOWN : return " " ; } }
Convert internal image_type to mime type
Convert internal image_type to mime type
/* suppose binary format */