scale problem using ppm-files

Greg Koerper greg at dubious.cor2.epa.gov
Tue Nov 16 12:03:10 EST 1993


> The are only one difference between ppm-driver from 4.0 to 4.1, this is in
> the $GISBASE/src/paint/Drivers/ppm/npixels.c file. In order to solve the bug
> of ppm driver and scale parameter in Grass4.1, if you don't have
> the old code, you could change the line :
> 
> >if (NULL==(p=getenv ("HEIGHT")) || sscanf(p,"%d",rows)!=1 || *rows<0)
> 
> by the next line
> 
> <if (NULL==(p=getenv ("HEIGHT")) || sscanf(p,"%d",cols)!=1 || *cols<=0)
> 
> and re-compile the ppm driver.
> Then, the ppm driver will work well with the scale parameter.
> Thanks to Philip Verhagen for your help about this problem.
> 
> Anabel Donadios
> Eurogis
> Spain
> 

I am in need of reassurance here.  Is the intent to change:

    if (NULL==(p=getenv ("HEIGHT")) || sscanf(p,"%d",rows)!=1 || *rows<0)
    *rows = 1000;
    if (NULL==(p=getenv ("WIDTH")) || sscanf(p,"%d",cols)!=1 || *cols<=0)
    *cols = 750;

to

    if (NULL==(p=getenv ("HEIGHT")) || sscanf(p,"%d",cols)!=1 || *cols<=0)
    *rows = 1000;
    if (NULL==(p=getenv ("WIDTH")) || sscanf(p,"%d",cols)!=1 || *cols<=0)
    *cols = 750;

???
The logic here looks a bit out of balance.  Can this fix be confirmed?

greg



More information about the grass-user mailing list