Skip to content
Advertisement

How to clone a gd resource in PHP

I’m looking for cloning an image in PHP created with imagecreatetruecolor or some other image creation function..

As it was said in the comment, no you can’t do a simple affection like :

JavaScript

This because ressources are reference and could not be copied like scalar values.

Example :

JavaScript

Advertisement

Answer

So, the solution found was in the comment, and this is an implementation of it in a Image management class :

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement