Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Problem with MESH transform /w transparent background #254
This may apply to other transformations as well, but I've specifically observed it using the MESH transform.
In the above image, the image in the middle is the desired result... everything around it should be transparent, but is instead filled with the results of previous transform operations.
I was eventually able to fix this by using
I'd be happy to submit a fix for this, but I have two questions:
First glance, it looks like a bug from using uninitialized memory. If ImagingNewBlock isn't clearing the memory, and it's allocating it from previously allocated and recently freed memory, then you'd get just this sort of thing. And I'd certainly expect it more on a machine with more memory pressure.
As for a test, I'd start with posting what you did to make that image. I'd think that if the non-transformed region contains anything other than whatever the background should be initialized to, then we'd have a test failure, though admittedly, a passed test isn't always going to mean that the bug is fixed. But it will be useful to run on resource constrained machines to stress test.
I can submit a fix (it's a one liner) but I haven't had time to implement a test for the problem yet. It doesn't look like there are any tests for transform at the moment, so I'll need to create a new one. Would you like me to submit the fix on its own or wait until I can submit it with an appropriate test?