IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 7736


Ignore:
Timestamp:
Jun 28, 2006, 10:50:51 AM (20 years ago)
Author:
magnier
Message:

fixed overflow bug in psImageJpeg

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/jpeg/psImageJpeg.c

    r7697 r7736  
    140140    PS_ASSERT_INT_POSITIVE(strlen(filename), false);
    141141
     142    float zero, scale;
    142143    struct jpeg_compress_struct cinfo;
    143144    struct jpeg_error_mgr jerr;
     
    177178    psU8 *Bpix = map->blue->data.U8;
    178179
    179     float zero = min;
    180     float scale = 256.0/(max - min);
     180    if (max == min) {
     181        zero = min - 0.1;
     182        scale = 256.0/0.2;
     183    } else {
     184        zero = min;
     185        scale = 256.0/(max - min);
     186    }
    181187
    182188    for (int j = 0; j < image->numRows; j++) {
Note: See TracChangeset for help on using the changeset viewer.