src/hg/hgTracks/hgTracks.c 1.1586

1.1586 2009/08/05 23:34:30 angie
Added conditional use (USE_PNG) of external library libpng (http://libpng.org/pub/png/, sourceforge) to write memgfx images in the PNG format instead of GIF. Currently used (conditionally!) only for hgTracks' main image. This is to support Tim's enhancements for horizontal scrolling of the browser track image. Image file size also appears smaller than GIF but should try more test cases.
Index: src/hg/hgTracks/hgTracks.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgTracks/hgTracks.c,v
retrieving revision 1.1585
retrieving revision 1.1586
diff -b -B -U 4 -r1.1585 -r1.1586
--- src/hg/hgTracks/hgTracks.c	16 Jul 2009 23:00:41 -0000	1.1585
+++ src/hg/hgTracks/hgTracks.c	5 Aug 2009 23:34:30 -0000	1.1586
@@ -1706,10 +1706,15 @@
 if (psOutput)
     hvg = hvGfxOpenPostScript(pixWidth, pixHeight, psOutput);
 else
     {
+#ifdef USE_PNG
+    trashDirFile(&gifTn, "hgt", "hgt", ".png");
+    hvg = hvGfxOpenPng(pixWidth, pixHeight, gifTn.forCgi, FALSE);
+#else
     trashDirFile(&gifTn, "hgt", "hgt", ".gif");
     hvg = hvGfxOpenGif(pixWidth, pixHeight, gifTn.forCgi);
+#endif // USE_PNG
     #ifdef IMAGEv2_UI
     // Adds one single image for all tracks (TODO: build the track by track images)
     theOneImg = imgBoxImageAdd(theImgBox,gifTn.forHtml,NULL,pixWidth, pixHeight,FALSE);
     //curMap = imgMapStart(theOneImg,"theOne",NULL); // TODO: Not using image map in favor of slice maps, so get rid of hPrintf(<MAP... below