reset password
Author Message
DavidGilbert
Posts: 40
Posted 14:22 Mar 13, 2012 |

 

So, I had trouble writing the image to file, it turns out that if there is a comment added to the pgm files it would write the comment AND the dimensions on the same line, like so...
 
#comment512 512
 
Adding w.newLine() as below fixes this issue with pgm.java, again, this is for the write method
 
if(p.Comment!=null)
      {
          w.write(p.Comment, 0, p.Comment.length());
          w.newLine();
      }
 
Basically, just says, "if there's a comment, write the comment and then write a new line."
hpguo
Posts: 139
Posted 18:52 Mar 13, 2012 |

Comment is optional. You can choose not to write a comment.