A fix.patch e4336bef5d58cc96a438ba0fb5553ea57e94f4d8 0c879efab429a9c4e8c9842057c6a3b6c0508cc4 C Here\scomes\sa\sproposed\sfix\sfor\sthe\sproblem.\r\n\r\nWhat\scauses\sthis\sbug\sis\sthat\sboth\sTk_PhotoPutBlock()\sand\sTk_PhotoPutZoomedBlock()\sdo\snot\sreally\shandle\sthe\scase\swhere\ssource\sand\sdestination\sare\sthe\ssame\simage.\r\n\r\nThe\spatch\ssolves\sthis\sby\screating\sa\slocal\scopy\sof\sthe\ssource\simage\sdata\sbefore\sit\sis\scopied\sto\sthe\sdestination\simage.\sThis\sis\sdone\sonly\sif\ssource\sand\sdestination\sare\sthe\ssame\simage.\r\n\r\nImpact\son\sperformance:\sin\sthe\s"normal"\scase\s-\ssource\sand\sdestination\sare\sdifferent\simages\s-\sthere's\sno\snoticeable\simpact.\sWhen\scopying\sto\sthe\ssame\simage,\showever,\sexecution\stime\scan\sincrease\sby\sover\s50%\sfor\slarge\simages.\sI\sguess\sthat's\sthe\sprice\sof\sa\scorrect\sresult!\r\n\r\nThe\spatch\salso\sincludes\sa\sfew\stests\sto\smake\ssure\sthis\sdoesn't\shappen\sagain. D 2017-02-17T17:03:57.128 U anonymous Z 47bbae17b6d74c4c22266be3f963bcd1