ext/gd: imageclone support.#14487
Conversation
|
I believe it would cause a memory leak if the cloned image has a tile or a brush. And likely an infinite recursion if the tile has the cloned image as its tile.. but that's something that should be addressed by libgd. |
|
Also, this overlaps with #10241. Personally I like the explicit |
|
LGTM but I'm not familiar with ext/gd... It would be nice to find someone who is familiar with it. |
Given that @devnexen is code owner of ext/gd and also maintainer of libgd, I would think this is not an issue. :) Generally, I agree that we should support But regardless whether we take this approach or the one from #10241, we should port |
|
Apparently gdImageClone made it to the bundled libgd in #15640. Now, what about the userland method? Why can't we have both imageclone and clone $im support? Also I would still unset brushes and tiles from the cloned image to avoid memory leaks. But there are other issues with those anyway. |
having both makes sense for me |
What about having
That should be reported to upstream, and fixed there first. In my opinion, fixing our bundled libgd should be a last resort. |
I can sense the sarcasm, but yes why not adding all image functions as methods of the gd object? Similar to the mysqli approach. But that's off topic here. If this happens, i'd really like to see the imageclone function for consistency. Mixing oop and functional approach is just ugly. How about we go with the function now and then we do a separate pr where we alias all the functions and add the clone as well?
I would, and also report other minor problems I found, but the project looks dead in the water. |
That is actually the long-term goal; changing resources to opaque objects was/is just a stop-gap measure to get of resources as soon as possilbe.
I know at least two libgd maintainers who are actively working on php-src; these might find some time to at least provide fixes against libgd (ideally just merging a PR). |
|
See #22532 |
No description provided.