ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/px/ra_bmp.c
(Generate patch)

Comparing ray/src/px/ra_bmp.c (file contents):
Revision 2.7 by greg, Fri Apr 30 21:16:58 2004 UTC vs.
Revision 2.8 by greg, Tue Jul 20 03:08:42 2004 UTC

# Line 292 | Line 292 | tmap2bmp(char *fnin, char *fnout, char *expec, RGBPRIM
292          int             tmflags;
293          BMPHeader       *hdr;
294          BMPWriter       *wtr;
295        RESOLU          rs;
295          FILE            *fp;
296          int             xr, yr;
297          BYTE            *pa;
# Line 318 | Line 317 | tmap2bmp(char *fnin, char *fnout, char *expec, RGBPRIM
317                  fprintf(stderr, "%s: cannot open\n", fnin);
318                  exit(1);
319          }
321                                        /* get picture orientation */
322        if (fnin != NULL) {
323                if (getheader(fp, NULL, NULL) < 0 || !fgetsresolu(&rs, fp))
324                        quiterr("bad Radiance picture format");
325                rewind(fp);
326        } else                          /* assume stdin has normal orient */
327                rs.rt = PIXSTANDARD;
320                                          /* tone-map picture */
321          if (tmMapPicture(&pa, &xr, &yr, tmflags, monpri, gamval,
322                          0., 0., fnin, fp) != TM_E_OK)
# Line 364 | Line 356 | tmap2bmp(char *fnin, char *fnout, char *expec, RGBPRIM
356          if (fflush((FILE *)wtr->c_data) < 0)
357                  quiterr("error writing BMP output");
358                                          /* clean up */
359 +        if (fnin != NULL)
360 +                fclose(fp);
361          free((void *)pa);
362          BMPcloseOutput(wtr);
363   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines