|
From: <kin...@us...> - 2003-10-18 03:45:32
|
Update of /cvsroot/teem/teem/src/unrrdu
In directory sc8-pr-cvs1:/tmp/cvs-serv27259/unrrdu
Modified Files:
dice.c
Log Message:
tries to use PGM and PPM images, if PNG is not available
Index: dice.c
===================================================================
RCS file: /cvsroot/teem/teem/src/unrrdu/dice.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** dice.c 24 Sep 2003 06:07:01 -0000 1.23
--- dice.c 18 Oct 2003 02:20:05 -0000 1.24
***************
*** 33,37 ****
char *base, out[512], *err, format[512];
Nrrd *nin, *nout;
! int pos, axis, top, pret, start;
airArray *mop;
--- 33,37 ----
char *base, out[512], *err, format[512];
Nrrd *nin, *nout;
! int pos, axis, top, pret, start, fit;
airArray *mop;
***************
*** 93,101 ****
}
if (0 == pos) {
! /* See if these slices would be better saved as PNG images.
Altering the file name will tell nrrdSave() to use a different
file format. */
if (nrrdFormatPNG->fitsInto(nout, nrrdEncodingRaw, AIR_FALSE)) {
strcpy(format + strlen(format) - 4, "png");
}
}
--- 93,108 ----
}
if (0 == pos) {
! /* See if these slices would be better saved as PNG or PNM images.
Altering the file name will tell nrrdSave() to use a different
file format. */
if (nrrdFormatPNG->fitsInto(nout, nrrdEncodingRaw, AIR_FALSE)) {
strcpy(format + strlen(format) - 4, "png");
+ } else {
+ fit = nrrdFormatPNM->fitsInto(nout, nrrdEncodingRaw, AIR_FALSE);
+ if (2 == fit) {
+ strcpy(format + strlen(format) - 4, "pgm");
+ } else if (3 == fit) {
+ strcpy(format + strlen(format) - 4, "ppm");
+ }
}
}
|