Index: sd.ino =================================================================== --- sd.ino (revision 340) +++ sd.ino (working copy) @@ -210,8 +210,21 @@ // get image width String numberString = ""; buf = pbmFile.read(); - while (buf != 10) + + Serial.println(buf); + + if (buf == 35) // This code is to eat up any comment line { + while (buf != 10) + { + buf = pbmFile.read(); + } + + buf = pbmFile.read(); + } + + while (buf != 32) // There is a space between width and height + { numberString = numberString + buf; buf = pbmFile.read(); } @@ -271,4 +284,5 @@ Serial.println(pbmImageoffset); return true; -} +} +