aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2002-11-15 15:51:23 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2002-11-15 15:51:23 +0000
commit073f8a91054a0b84fc2a3c6feaada832d2818bf7 (patch)
treedb50876cd427e92a1173013500373b04e40e4778 /file.c
parentfix indent (diff)
downloadw3m-073f8a91054a0b84fc2a3c6feaada832d2818bf7.tar.gz
w3m-073f8a91054a0b84fc2a3c6feaada832d2818bf7.zip
[w3m-dev 03435] save image with SAVE
* buffer.c (discardBuffer): check image * file.c (loadImageBuffer): add st IMG_FLAG_DONE_REMOVE s/sourcefile/mailcap_source/ * fm.h (IMG_FLAG_DONT_REMOVE): added * image.c (drawImage): & IMG_FLAG_LOADED (deleteImage): & IMG_FLAG_DONT_REMOVE (showImageProgress): & IMG_FLAG_LOADED (getImage): & IMG_FLAG_LOADED (getImageSize): & IMG_FLAG_LOADED * main.c (vmSrc): delete ifdef USE_IMAGE From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
Diffstat (limited to 'file.c')
-rw-r--r--file.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/file.c b/file.c
index c04d0ad..e4a723f 100644
--- a/file.c
+++ b/file.c
@@ -1,4 +1,4 @@
-/* $Id: file.c,v 1.117 2002/11/15 15:21:07 ukai Exp $ */
+/* $Id: file.c,v 1.118 2002/11/15 15:51:23 ukai Exp $ */
#include "fm.h"
#include <sys/types.h>
#include "myctype.h"
@@ -6569,6 +6569,7 @@ loadImageBuffer(URLFile *uf, Buffer *newBuf)
FILE *src = NULL;
URLFile f;
MySignalHandler(*prevtrap) ();
+ struct stat st;
loadImage(IMG_FLAG_STOP);
image = New(Image);
@@ -6577,7 +6578,8 @@ loadImageBuffer(URLFile *uf, Buffer *newBuf)
image->width = -1;
image->height = -1;
cache = getImage(image, cur_baseURL, IMG_FLAG_AUTO);
- if (!cur_baseURL->is_nocache && cache->loaded == IMG_FLAG_LOADED)
+ if (!cur_baseURL->is_nocache && cache->loaded & IMG_FLAG_LOADED &&
+ !stat(cache->file, &st))
goto image_buffer;
prevtrap = signal(SIGINT, KeyAbort);
@@ -6597,24 +6599,20 @@ loadImageBuffer(URLFile *uf, Buffer *newBuf)
cache->loaded = IMG_FLAG_LOADED;
cache->index = 0;
- /*
- * getImageSize(cache);
- */
image_buffer:
+ cache->loaded |= IMG_FLAG_DONT_REMOVE;
+ if (uf->scheme != SCM_LOCAL)
+ newBuf->sourcefile = cache->file;
+
tmp = Sprintf("<img src=\"%s\"><br><br>", html_quote(image->url));
if (newBuf == NULL)
newBuf = newBuffer(INIT_BUFFER_WIDTH);
- /*
- * if (frame_source) {
- */
tmpf = tmpfname(TMPF_SRC, ".html");
src = fopen(tmpf->ptr, "w");
- newBuf->sourcefile = tmpf->ptr;
+ newBuf->mailcap_source = tmpf->ptr;
pushText(fileToDelete, tmpf->ptr);
- /*
- * }
- */
+
init_stream(&f, SCM_LOCAL, newStrStream(tmp));
loadHTMLstream(&f, newBuf, src, TRUE);
if (src)