diff options
author | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-11-27 16:46:30 +0000 |
---|---|---|
committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-11-27 16:46:30 +0000 |
commit | 93073107389ae6612068af8b99217c90c87e8612 (patch) | |
tree | cc87d0189d5f125b60f64019f9803e37074cc025 /w3mimgdisplay.c | |
parent | fix indent (diff) | |
download | w3m-93073107389ae6612068af8b99217c90c87e8612.tar.gz w3m-93073107389ae6612068af8b99217c90c87e8612.zip |
[w3m-dev 03497] incorrect image size
* image.c (getImageSize): invoke w3mimgdiplay -size instead of "5;..."
* w3mimgdisplay.c (defined_size): added
(main): if defined_size get_image_size()
(GetOption): -size
From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
Diffstat (limited to '')
-rw-r--r-- | w3mimgdisplay.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/w3mimgdisplay.c b/w3mimgdisplay.c index 8df2e5c..ad52671 100644 --- a/w3mimgdisplay.c +++ b/w3mimgdisplay.c @@ -1,4 +1,4 @@ -/* $Id: w3mimgdisplay.c,v 1.9 2002/11/06 03:50:49 ukai Exp $ */ +/* $Id: w3mimgdisplay.c,v 1.10 2002/11/27 16:46:34 ukai Exp $ */ #include <stdio.h> #include <stdlib.h> #include <ctype.h> @@ -13,6 +13,7 @@ static char *background = NULL; static int offset_x = 0, offset_y = 0; static int defined_bg = 0, defined_x = 0, defined_y = 0, defined_test = 0; static int defined_debug = 0; +static char *defined_size = NULL; #define MAX_IMAGE 1000 static W3MImage *imageBuf = NULL; @@ -63,6 +64,16 @@ main(int argc, char **argv) exit(0); } + if (defined_size) { + if (w_op->init(w_op)) { + W3MImage img; + int w, h; + if (w_op->get_image_size(w_op, &img, defined_size, &w, &h)) + printf("%d %d\n", w, h); + } + exit(0); + } + w_op->set_background(w_op, background); while (fgets(buf, sizeof(buf), stdin) != NULL) { @@ -166,6 +177,11 @@ GetOption(int argc, char **argv) else if (!strcmp("-test", argv[i])) { defined_test = 1; } + else if (!strcmp("-size", argv[i])) { + if (++i >= argc) + exit(1); + defined_size = argv[i]; + } else if (!strcmp("-debug", argv[i])) { defined_debug = 1; } |