Uh oh!
There was an error while loading. Please reload this page.
ext/gd: imageclone support. - #14487
Conversation
thg2k
commented
Jun 10, 2024
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 |
kocsismate
commented
Jun 21, 2024
LGTM but I'm not familiar with ext/gd... It would be nice to find someone who is familiar with it. |
cmb69
commented
Aug 29, 2024
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 |
thg2k
commented
Aug 31, 2024
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. |
devnexen
commented
Aug 31, 2024
having both makes sense for me |
cmb69
commented
Aug 31, 2024
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. |
thg2k
commented
Aug 31, 2024
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. |
cmb69
commented
Aug 31, 2024
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). |
pierrejoye
commented
Jul 8, 2026
See #22532 |
No description provided.