Tk Source Code

Attachments To Ticket e4336bef
Login

Attachments for ticket e4336bef

  1. Attachment 8eb39d61
    fix.patch [download]
    Here comes a proposed fix for the problem. What causes this bug is that both Tk_PhotoPutBlock() and Tk_PhotoPutZoomedBlock() do not really handle the case where source and destination are the same image. The patch solves this by creating a local copy of the source image data before it is copied to the destination image. This is done only if source and destination are the same image. Impact on performance: in the "normal" case - source and destination are different images - there's no noticeable impact. When copying to the same image, however, execution time can increase by over 50% for large images. I guess that's the price of a correct result! The patch also includes a few tests to make sure this doesn't happen again.
    Added by anonymous on 2017-02-17 17:03:57.