5a451c3cc7cb9b76708daa089fc443ad19158887
jcasper
  Sun Aug 4 16:58:55 2024 -0700
Adding an hg.conf option to control max image height, refs #34152

diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c
index 6e7d395..d87c016 100644
--- src/hg/hgTracks/hgTracks.c
+++ src/hg/hgTracks/hgTracks.c
@@ -5145,31 +5145,33 @@
     track = flatTrack->track;
 
     if (track->limitedVis == tvHide)
 	{
 	continue;
 	}
 
     setFlatTrackMaxHeight(flatTrack, fontHeight);
 
     }
 
 
 // fill out track->prevTrack, and check for maxSafeHeight
 boolean safeHeight = TRUE;
 /* firefox on Linux worked almost up to 34,000 at the default 620 width */
-#define maxSafeHeight   32000
+/* More recent hardware/browsers may be able to handle more - we had a success with an 8192x64891 image */
+#define MAXSAFEHEIGHT "maxTrackImageHeightPx"
+int maxSafeHeight = atoi(cfgOptionDefault(MAXSAFEHEIGHT, "32000"));
 struct track *prevTrack = NULL;
 for (flatTrack = flatTracks,prevTrack=NULL; flatTrack != NULL; flatTrack = flatTrack->next)
     {
     track = flatTrack->track;
     assert(track->limitedVis != tvHide);
     // ORIG int totalHeight = pixHeight+trackPlusLabelHeight(track,fontHeight);
     int totalHeight = pixHeight+flatTrack->maxHeight;
     if (totalHeight > maxSafeHeight)
         {
         char numBuf[SMALLBUF];
         sprintLongWithCommas(numBuf, maxSafeHeight);
         if (safeHeight)  // Only one message
             warn("Image is over %s pixels high (%d pix) at the following track which is now "
                  "hidden:<BR>\"%s\".%s", numBuf, totalHeight, track->tdb->longLabel,
                  (flatTrack->next != NULL ?