bug in ps.map

Lars Schylberg larss at fmi.kth.se
Fri Sep 3 10:25:09 EDT 1993


I thought every should get to know about a little bug that I found in 
ps.map a while ago.  I have also reported it to OGI with bug.report.sh

---------------------------------------------------------------------
Abstract of bug (brief, one-line description):

Wrong values in the produced ps-file

Description of bug (be as specific as possible in this section):

I found out that all values except zero was one value off.
A value 255 was shown as 254 in the ps-file.  This meant that
you could never get a totally white area when it was printed on
paper. 

The fix is to add 0.5 on line 105 in rast_plot.c in directory
$GISBASE/src.alpha/ps.map/ps.map/cmd.  This is since the int function 
is truncating.

NEW rast_plot.c

                        fprintf(PS.fp, "%02X",
                            (int)(.3 * (double)r + .59 * (double)g +
                                  .11 * (double)b + .5 ));

larss at lady> diff rast_plot.c rast_plot.c.orig
105c105
<                                 .11 * (double)b + .5 ));
---
>                                 .11 * (double)b));


Lars

Lars Schylberg                          Email: larss at fmi.kth.se  
Dept. of Geodesy and Photogrammetry 
Royal Institute of Technology (KTH)     Tel.   +46 8 790 86 33   
S-100 44  STOCKHOLM, SWEDEN             Fax.   +46 8 790 66 10







More information about the grass-dev mailing list