--- ppm.cpp Thu Aug 1 12:00:14 2002 +++ /home/pod/src/graphics/povray-3.50a/src/ppm.cpp Sat Jan 25 13:26:32 2003 @@ -433,6 +433,7 @@ type = infile->Read_Byte (); if((type != '3') && (type != '6')) Error ("File is not in PPM format."); + infile->Read_Byte(); /*dispose of newline*/ /* Ignore any comments */ while ((data = infile->Read_Byte ()) == '#') @@ -446,9 +447,9 @@ *s = '\0' ; if (*infile) width = atoi (junk) ; - - for (i = 0, s = junk ; (i < 8) && ((data = infile->Read_Byte ()) != ' ') ; i++, s++) + for (i = 0, s = junk ; (i < 8) && ((data = infile->Read_Byte ()) != 0x0a) ; i++, s++) *s = (char) data ; + infile->UnRead_Byte (data); /* put newline back */ *s = '\0' ; if (*infile) height = atoi (junk) ; @@ -459,7 +460,6 @@ /* Ignore any comments */ while ((data = infile->Read_Byte ()) == '#') infile->getline(junk,512); - infile->UnRead_Byte (data) ; infile->getline(junk,512); depth = atoi(junk); @@ -511,12 +511,12 @@ line_data->red[x] = data*255/depth; if ((data = infile->Read_Byte ()) == EOF) - Error("Cannot reading data from PPM image."); + Error("Cannot read data from PPM image."); line_data->green[x] = data*255/depth; if ((data = infile->Read_Byte ()) == EOF) - Error("Cannot reading data from PPM image."); + Error("Cannot read data from PPM image."); line_data->blue[x] = data*255/depth; }