commit 71b070f3682f6b3df00915b4aef4cc5f4df26897
parent 5b5e686819a947fac75868f418debfaf3a8b5d4a
Author: ukai <ukai>
Date: Fri, 15 Mar 2002 16:35:46 +0000
[w3m-dev 03132] Re: Reload image
* file.c (loadGeneralFile): b->type = "text/html"
* file.c (loadImageBuffer): comment out getImageSize()
image_flag = IMG_FLAG_AUTO
* file.c (openGeneralPagerBuffer): buf->type = "text/html"
* frame.c (resetFrameElement): if (buf->mailcap_source) ...
* frame.c (frame_download_source): if (buf->mailcap_source) ...
* main.c (vwSrc): #ifdef USE_IMAGE
From: Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
Diffstat:
4 files changed, 33 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,3 +1,14 @@
+2002-03-16 Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
+
+ * [w3m-dev 03132] Re: Reload image
+ * file.c (loadGeneralFile): b->type = "text/html"
+ * file.c (loadImageBuffer): comment out getImageSize()
+ image_flag = IMG_FLAG_AUTO
+ * file.c (openGeneralPagerBuffer): buf->type = "text/html"
+ * frame.c (resetFrameElement): if (buf->mailcap_source) ...
+ * frame.c (frame_download_source): if (buf->mailcap_source) ...
+ * main.c (vwSrc): #ifdef USE_IMAGE
+
2002-03-16 Fumitoshi UKAI <ukai@debian.or.jp>
* [w3m-dev 03133] Re: w3mman.1
diff --git a/file.c b/file.c
@@ -1977,11 +1977,11 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer,
}
#ifdef USE_IMAGE
else if (proc == loadImageBuffer)
- b->type = b->real_type;
+ b->type = "text/html";
#endif
#ifdef USE_GOPHER
else if (proc == loadGopherDir)
- b->type = b->real_type;
+ b->type = "text/html";
#endif
else
b->type = "text/plain";
@@ -6518,7 +6518,9 @@ loadImageBuffer(URLFile *uf, Buffer *newBuf)
cache->loaded = IMG_FLAG_LOADED;
cache->index = 0;
+/*
getImageSize(cache);
+*/
image_buffer:
tmp = Sprintf("<img src=\"%s\"><br><br>", html_quote(image->url));
@@ -6542,6 +6544,7 @@ loadImageBuffer(URLFile *uf, Buffer *newBuf)
newBuf->topLine = newBuf->firstLine;
newBuf->lastLine = newBuf->currentLine;
newBuf->currentLine = newBuf->firstLine;
+ newBuf->image_flag = IMG_FLAG_AUTO;
return newBuf;
}
#endif
@@ -6738,7 +6741,7 @@ openGeneralPagerBuffer(InputStream stream)
cur_baseURL = New(ParsedURL);
parseURL("-", cur_baseURL, NULL);
buf = loadImageBuffer(&uf, t_buf);
- buf->type = t;
+ buf->type = "text/html";
}
#endif
else {
diff --git a/frame.c b/frame.c
@@ -342,7 +342,12 @@ resetFrameElement(union frameset_element *f_element,
f_body->attr = F_BODY;
f_body->name = f_name;
f_body->url = parsedURL2Str(&buf->currentURL)->ptr;
- if (buf->real_scheme == SCM_LOCAL) {
+ if (buf->mailcap_source) {
+ f_body->source = buf->mailcap_source;
+ f_body->flags |= FB_TODELETE;
+ buf->mailcap_source = NULL;
+ }
+ else if (buf->real_scheme == SCM_LOCAL) {
f_body->source = buf->sourcefile;
}
else {
@@ -404,7 +409,12 @@ frame_download_source(struct frame_body *b, ParsedURL *currentURL,
b->url = parsedURL2Str(&buf->currentURL)->ptr;
b->source = buf->sourcefile;
b->type = buf->type;
- if ((buf->real_scheme != SCM_LOCAL)
+ if (buf->mailcap_source) {
+ b->source = buf->mailcap_source;
+ b->flags |= FB_TODELETE;
+ buf->mailcap_source = NULL;
+ }
+ else if ((buf->real_scheme != SCM_LOCAL)
#ifdef USE_IMAGE
|| (activeImage && !useExtImageViewer &&
buf->real_type && !strncasecmp(buf->real_type, "image/", 6))
diff --git a/main.c b/main.c
@@ -4139,6 +4139,10 @@ vwSrc(void)
if (Currentbuf->type == NULL || Currentbuf->bufferprop & BP_FRAME)
return;
+#ifdef USE_IMAGE
+ if (!strncasecmp(Currentbuf->real_type, "image/", 6))
+ return;
+#endif
if ((buf = Currentbuf->linkBuffer[LB_SOURCE]) != NULL ||
(buf = Currentbuf->linkBuffer[LB_N_SOURCE]) != NULL) {
Currentbuf = buf;