summaryrefslogtreecommitdiff
path: root/riscos
diff options
context:
space:
mode:
Diffstat (limited to 'riscos')
-rw-r--r--riscos/plugin.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/riscos/plugin.c b/riscos/plugin.c
index e6b3aabb8..1d395ade2 100644
--- a/riscos/plugin.c
+++ b/riscos/plugin.c
@@ -1,5 +1,5 @@
/**
- * $Id: plugin.c,v 1.1 2003/05/31 18:47:00 jmb Exp $
+ * $Id: plugin.c,v 1.2 2003/06/02 21:09:50 jmb Exp $
*/
#include <assert.h>
@@ -14,6 +14,8 @@
#include "netsurf/utils/log.h"
#include "netsurf/utils/utils.h"
+#include "oslib/mimemap.h"
+
char* create_mime_from_ext(char* data);
void plugin_fetch(struct content* content, char* url, struct box* box,
@@ -64,24 +66,17 @@ void plugin_fetch(struct content* content, char* url, struct box* box,
char* create_mime_from_ext(char* data){
char* ret;
+ os_error *e;
ret = strrchr(data, '.');
- LOG(("ret = %s", ++ret));
-
- if ((stricmp(ret,"jpg")) == 0 || (stricmp(ret,"jpeg")) == 0) {
- strcpy(ret,"image/jpeg");
- LOG(("jpeg image"));
+ LOG(("Extension = %s", ret));
- } else if ((stricmp(ret,"png")) == 0) {
- strcpy(ret,"image/png");
- LOG(("png image"));
+ /* Let's make the mime map module do the work for us */
+ e = xmimemaptranslate_extension_to_mime_type((const char*)ret,
+ ret);
+ LOG(("Mime Type = %s", ret));
- } /*else if ((stricmp(ret, "gif")) == 0) {
- ret = "image/gif";
- }*/ else {
-
- ret = NULL;
- }
+ if(e != NULL) ret = NULL;
return ret;
}