6f8f179499a5fccd49717db4af56d7aec5c9b26c galt Wed Jan 15 14:40:38 2014 -0800 Changing output of phyloGif back go actual gif instead of png. I first tried changing stuff to be png, but there were many references in html files that would be a real pain to change back. Besides, the gif code is stable and works well. There is no patents on it anymore, and no reason to not use it when it is convenient, which it is here. diff --git src/hg/phyloGif/phyloGif.c src/hg/phyloGif/phyloGif.c index 667ed9a..39665ab 100644 --- src/hg/phyloGif/phyloGif.c +++ src/hg/phyloGif/phyloGif.c @@ -51,34 +51,36 @@ #include "common.h" #include "linefile.h" #include "dystring.h" #include "net.h" #include "cheapcgi.h" #include "errabort.h" #include "phyloTree.h" #include "portable.h" #include "memgfx.h" #include "cart.h" #include "hui.h" #include "htmshell.h" #include "web.h" - #include "errabort.h" #include "errCatch.h" +// external declaration +boolean mgSaveToGif(FILE *gif_file, struct memGfx *screen, boolean useTransparency); +short gif_compress_data(int min_code_size, unsigned char *pt, long size, FILE *out); struct cart *cart=NULL; /* The user's ui state. */ struct hash *oldVars = NULL; boolean onWeb = FALSE; int width=240,height=512; boolean branchLengths = FALSE; /* branch lengths */ boolean lengthLegend = FALSE; /* length ruler*/ boolean branchLabels = FALSE; /* labelled branch lengths */ boolean htmlPageWrapper = FALSE; /* wrap output in an html page */ boolean preserveUnderscores = FALSE; /* preserve underscores in input as spaces in output */ boolean monospace = FALSE; /* use monospace font */ int branchDecimals = 2; /* show branch label length to two decimals by default */ int branchMultiplier = 1; /* multiply branch length by factor */ char *escapePattern = NULL; /* use to escape dash '-' char in input */ @@ -717,36 +719,36 @@ { dh = fHeight / 4; } mgDrawLine(mg, MARGIN+x, height+fHeight/2-dh, MARGIN+x, height+fHeight/2+dh, MG_BLACK); ++i; } } } if (onWeb) { - printf("Content-type: image/png\r\n"); + printf("Content-type: image/gif\r\n"); printf("\r\n"); } -if (!mgSaveToPng(stdout, mg, FALSE)) +if (!mgSaveToGif(stdout, mg, FALSE)) { - errAbort("Couldn't save png to stdout"); + errAbort("Couldn't save gif to stdout"); } if (cgiOptionalString("phyloGif_submit")) cartCheckout(&cart); /* there's no code for freeing the phyloTree yet in phyloTree.c */ mgFree(&mg); freez(&phyloData); return 0; }