Changeset 27145 for trunk/psLib/src/jpeg/psImageJpeg.c
- Timestamp:
- Mar 2, 2010, 3:39:54 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/jpeg/psImageJpeg.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/jpeg/psImageJpeg.c
r24220 r27145 202 202 if (isfinite(row[i])) { 203 203 pixel = PS_JPEG_SCALEVALUE(row[i],zero,scale); 204 outPix[0] = Rpix[pixel];205 outPix[1] = Gpix[pixel];206 outPix[2] = Bpix[pixel];204 outPix[0] = Rpix[pixel]; 205 outPix[1] = Gpix[pixel]; 206 outPix[2] = Bpix[pixel]; 207 207 } else { 208 // XXX NAN value should be set per-color map 209 outPix[0] = 0xff; 210 outPix[1] = 0x00; 211 outPix[2] = 0xff; 212 } 213 } 214 jpeg_write_scanlines(&cinfo, jpegLineList, 1); 208 // XXX NAN value should be set per-color map 209 outPix[0] = 0xff; 210 outPix[1] = 0x00; 211 outPix[2] = 0xff; 212 } 213 } 214 if (jpeg_write_scanlines(&cinfo, jpegLineList, 1) == 0) { 215 psError(PS_ERR_IO, true, "Unable to write line %d to JPEG", j); 216 psFree(jpegLine); 217 return false; 218 } 215 219 } 216 220 217 221 jpeg_finish_compress(&cinfo); 218 fclose(f); 222 if (fclose(f) == EOF) { 223 psError(PS_ERR_IO, true, "Failed to close %s", filename); 224 psFree(jpegLine); 225 return false; 226 } 219 227 jpeg_destroy_compress(&cinfo); 220 228
Note:
See TracChangeset
for help on using the changeset viewer.
