diff options
author | cinap_lenrek <cinap_lenrek@centraldogma> | 2011-10-05 00:05:51 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@centraldogma> | 2011-10-05 00:05:51 +0200 |
commit | 569e0181b2664032b83376eeafbc7900bb54ce44 (patch) | |
tree | 9e2daf4e2cea96c322b817918e921eec4dabd4f6 /sys | |
parent | 3efbb4fa00f8d8d055227f54e71e2eb24ff39729 (diff) |
mothra: animated gifs, page: cleanup
Diffstat (limited to 'sys')
-rw-r--r-- | sys/src/cmd/mothra/mothra.c | 15 | ||||
-rw-r--r-- | sys/src/cmd/page.c | 4 |
2 files changed, 17 insertions, 2 deletions
diff --git a/sys/src/cmd/mothra/mothra.c b/sys/src/cmd/mothra/mothra.c index 971273bfe..d85c52c27 100644 --- a/sys/src/cmd/mothra/mothra.c +++ b/sys/src/cmd/mothra/mothra.c @@ -954,6 +954,10 @@ void geturl(char *urlname, int method, char *body, int cache, int map){ fd=pipeline("/bin/gunzip", fd); typ = snooptype(fd); } + if(typ == COMPRESS){ + fd=pipeline("/bin/uncompress", fd); + typ = snooptype(fd); + } switch(typ){ default: message("Bad type %x in geturl", typ); @@ -991,6 +995,17 @@ void geturl(char *urlname, int method, char *body, int cache, int map){ setcurrent(i, selection->tag); break; case GIF: + if(rfork(RFFDG|RFPROC|RFNAMEG|RFNOWAIT) == 0){ + snprint(cmd, sizeof(cmd), "-pid %d", getpid()); + if(newwindow(cmd) != -1){ + close(1); open("/dev/cons", OWRITE); + print("reading gif...\n"); + filter("gif", fd); + } + exits(nil); + } + close(fd); + break; case JPEG: case PNG: case BMP: diff --git a/sys/src/cmd/page.c b/sys/src/cmd/page.c index 06fc359a0..ec7f6f735 100644 --- a/sys/src/cmd/page.c +++ b/sys/src/cmd/page.c @@ -625,7 +625,7 @@ popenfile(Page *p) { static struct { char *typ; - void *popen; + void *open; void *data; } tab[] = { "application/pdf", popengs, nil, @@ -709,7 +709,7 @@ popenfile(Page *p) } p->fd = fd; p->data = tab[i].data; - p->open = tab[i].popen; + p->open = tab[i].open; if(seek(fd, 0, 0) < 0) goto Noseek; if((i = read(fd, buf+n, n)) < 0) |