6e83488e9bcbaa22141e6896ad5f871eefd7fc41 galt Wed Jan 15 16:45:42 2014 -0800 It turns out that although it compiles,it does not actually work unless one turns off COLOR32 setting in common.mk, which is not going to happen. I have a local development branch where this works. Alternatives such as converting color values from 32-bit to 256 colors for gif saving could be explored in the future. Revert "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." This reverts commit 6f8f179499a5fccd49717db4af56d7aec5c9b26c. diff --git src/hg/phyloGif/phyloGif.c src/hg/phyloGif/phyloGif.c index 39665ab..667ed9a 100644 --- src/hg/phyloGif/phyloGif.c +++ src/hg/phyloGif/phyloGif.c @@ -51,36 +51,34 @@ #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 */ @@ -719,36 +717,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/gif\r\n"); + printf("Content-type: image/png\r\n"); printf("\r\n"); } -if (!mgSaveToGif(stdout, mg, FALSE)) +if (!mgSaveToPng(stdout, mg, FALSE)) { - errAbort("Couldn't save gif to stdout"); + errAbort("Couldn't save png 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; }