void gifLabelVerticalText(char *fileName, char **labels, int labelCount, int height) /* Make a gif file with given labels. This will check to see if fileName * exists already and has not changed, and if so do nothing. */ { struct memGfx *straight = altColorLabels(labels, labelCount, height); struct memGfx *rotated = mgRotate90(straight); struct memGfx *existing = NULL; #ifdef USE_PNG struct tempName tn; makeTempName(&tn, "gifLabelVertTemp", ".png"); mgSavePng(rotated, tn.forCgi, FALSE); rename(tn.forCgi, fileName); #else if (fileExists(fileName)) existing = mgLoadGif(fileName); /* the savings here is in the user's own browser cache - not updated if no change */ if (!sameGifContents(rotated, existing)) { struct tempName tn; makeTempName(&tn, "gifLabelVertTemp", ".gif"); mgSaveGif(rotated, tn.forCgi, FALSE); rename(tn.forCgi, fileName); } #endif mgFree(&straight); mgFree(&rotated); if (existing) mgFree(&existing); }
void gifLabelVerticalText(char *fileName, char **labels, int labelCount, int height) /* Make a gif file with given labels. This will check to see if fileName * exists already, and if so do nothing. */ { struct memGfx *straight = altColorLabels(labels, labelCount, height); struct memGfx *rotated = mgRotate90(straight); char tempName[512]; safef(tempName, sizeof(tempName), "%s_trash", fileName); mgSaveGif(rotated, tempName); /* note we cannot delete this later because of permissions */ /* the savings here is in the user's own browser cache - not updated if no change */ if (!sameFileContents(tempName,fileName)) mgSaveGif(rotated, fileName); mgFree(&straight); mgFree(&rotated); }
void gifLabelVerticalText(char *fileName, char **labels, int labelCount, int height) /* Make a gif file with given labels. This will check to see if fileName * exists already and has not changed, and if so do nothing. */ { struct memGfx *straight = altColorLabels(labels, labelCount, height); struct memGfx *rotated = mgRotate90(straight); struct memGfx *existing = NULL; struct tempName tn; makeTempName(&tn, "gifLabelVertTemp", ".png"); mgSavePng(rotated, tn.forCgi, FALSE); rename(tn.forCgi, fileName); mgFree(&straight); mgFree(&rotated); if (existing) mgFree(&existing); }