• Login or register

discuss.effbot.org

  • Popular
  • Recent
  • 2 points by nu 1 year ago on The aggdraw Module 1 child

    [ Bug report for aggdraw Dib module]
    Hi. I'm a Japanese, so plese excuse my poor English.

    1) Scanlines of Windows DIB must be 4-byte aligned , but draw_dib() function in aggdraw.cxx doesn't consider that.
    The result of this is somewhat distorted output, when width % 4 != 0.

    2) In function draw_dealloc(), buffer_data[] is deleted by ordinary operater delete[].
    This is OK for Draw object created by draw_new(), but too bad for Dib object created by draw_dib().
    In case of Dib, buffer_data is a pointer given by the CreateDIBSection() API , and not allocated by ordinary operator new[].
    So you must not delete[] this.

    • parent
    • reply
    • 1 point by effbot 1 year ago 0 children

      The alignment bug was supposed to be fixed in 1.2a3, but doesn't seem to have made it to the source drop (pilot error?). Anyway, just change the stride calculation to "int stride = (xsize * 3 + 3) & -4;" and you're fine.

      I'll look into the other bug; there are some other fixes done since the a3 release, and it's been sitting in alpha for way too long, so I guess it's time for a new (and non-alpha) release... Thanks /F

      • link
      • reply
  • Widget
  • Recent Comments
  • Leaders
Powered by