summaryrefslogtreecommitdiff
path: root/libgphoto2
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2002-04-12 12:03:07 +0000
committerMarcus Meissner <marcus@jet.franken.de>2002-04-12 12:03:07 +0000
commit262bd0a8ea6514cf082b5e1e04b2530cbb5971d8 (patch)
tree165f80a22c894ef4cad2c691bca22103ab7fb62a /libgphoto2
parentc1abc7257311d79acc11bd755f7b1f8f12cda37c (diff)
downloadlibgphoto2-262bd0a8ea6514cf082b5e1e04b2530cbb5971d8.tar.gz
* libgphoto2/gphoto2-file.[ch]: Added GP_MIME_PNM, added some missing
types to the mimetype comparison. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@4413 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'libgphoto2')
-rw-r--r--libgphoto2/gphoto2-file.c22
-rw-r--r--libgphoto2/gphoto2-file.h1
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"