Menu

Bug in BMP save

Greg
2013-03-01
2013-03-01
  • Greg

    Greg - 2013-03-01

    EDIT: My mistake. The IO write function is not expecting return of bytes written but of records written.
    I only saw PluginJPEG.cpp checking for != OUTPUT_BUF_SIZE and mistook this for bytes.

     

    Last edit: Greg 2013-03-01
  • Ryan Rubley

    Ryan Rubley - 2013-03-01

    I'm pretty sure write_proc mimics fwrite() of which the 2nd param is the element size, and the 3rd param is the number of elements to write. The return value is the number of elements written. Since 1 is requested, the return value can't be any larger than 1, so unless sizeof(BITMAPFILEHEADER) is 1, you're going to basically always return FALSE there no matter what.

     
  • Greg

    Greg - 2013-03-01

    Thanks Ryan, just realized it was expecting elements/records written, not bytes. HAd not compared enough files and was confused by code in PluginJPEG.cpp.

     

Log in to post a comment.