I found this function on stackoverflow which is :
imagepng(imagecreatefromstring(file_get_contents($filename)), "output.png");
I thought it would fit my needs since it renames/change path/convert to png at the same time, but it doesn't exactly convert the image, it creates a "png copy". I would like the old jpg/gif/jped/png image to be erased aswell.
Is there a way I can add that to this "one-line converting function" ?
Thanks a lot !