diff options
-rw-r--r-- | libgphoto2/gphoto2-file.c | 22 | ||||
-rw-r--r-- | libgphoto2/gphoto2-file.h | 1 |
2 files changed, 16 insertions, 7 deletions
diff --git a/libgphoto2/gphoto2-file.c b/libgphoto2/gphoto2-file.c index f2461f8b5..a9bd91544 100644 --- a/libgphoto2/gphoto2-file.c +++ b/libgphoto2/gphoto2-file.c @@ -212,7 +212,10 @@ gp_file_open (CameraFile *file, const char *filename) "tif", GP_MIME_TIFF, "ppm", GP_MIME_PPM, "pgm", GP_MIME_PGM, + "pnm", GP_MIME_PNM, "png", GP_MIME_PNG, + "wav", GP_MIME_WAV, + "avi", GP_MIME_AVI, NULL}; CHECK_NULL (file && filename); @@ -249,11 +252,7 @@ gp_file_open (CameraFile *file, const char *filename) dot = strrchr (filename, '.'); if (dot) { for (i = 0; mime_table[i] ; i+=2) -#ifdef HAVE_STRCASECMP - if (!strcasecmp (mime_table[i], dot+1)) { -#else - if (!stricmp (mime_table[i], dot+1)) { -#endif + if (!strcmp (mime_table[i], dot+1)) { strncpy (file->mime_type, mime_table[i+1], sizeof(file->mime_type)); break; } @@ -421,14 +420,23 @@ gp_file_adjust_name_for_mime_type (CameraFile *file) GP_MIME_PNG, "png", GP_MIME_PPM, "ppm", GP_MIME_PGM, "pgm", - GP_MIME_TIFF, "tif", NULL}; + GP_MIME_PNM, "pnm", + GP_MIME_TIFF, "tif", + GP_MIME_WAV, "wav", + GP_MIME_BMP, "bmp", + GP_MIME_AVI, "avi", + NULL}; CHECK_NULL (file); gp_log (GP_LOG_DEBUG, "gphoto2-file", "Adjusting file name for " "mime type '%s'...", file->mime_type); for (x = 0; table[x]; x += 2) - if (!strcmp (file->mime_type, table[x])) { +#ifdef HAVE_STRCASECMP + if (!strcasecmp (file->mime_type, table[x])) { +#else + if (!stricmp (file->mime_type, table[x])) { +#endif /* Search the current suffix and erase it */ #ifdef HAVE_STRCHR diff --git a/libgphoto2/gphoto2-file.h b/libgphoto2/gphoto2-file.h index 41832fc90..254021949 100644 --- a/libgphoto2/gphoto2-file.h +++ b/libgphoto2/gphoto2-file.h @@ -32,6 +32,7 @@ extern "C" { #define GP_MIME_PNG "image/png" #define GP_MIME_PGM "image/x-portable-graymap" #define GP_MIME_PPM "image/x-portable-pixmap" +#define GP_MIME_PNM "image/x-portable-anymap" #define GP_MIME_JPEG "image/jpeg" #define GP_MIME_TIFF "image/tiff" #define GP_MIME_BMP "image/bmp" |