9951 explained code solutions for 126 technologies


php-gdHow to convert png to jpg


<?php

$im = imagecreatefrompng('image.png');
imagejpeg($im, '/tmp/image.jpg');ctrl + c
imagejpeg

saves given gd image in jpeg format to the specified path

imagecreatefrompng

creates GD image object from given PNG image