Convert uploaded PNG to JPEG automatically

There is a way, I recommend you combine the imagefx plugin with a custom function , http://wordpress.org/extend/plugins/imagefx/

You can read about it here: http://ottopress.com/tag/gd/ , and use a function like one found here: https://stackoverflow.com/questions/1201798/use-php-to-convert-png-to-jpg-with-compression

It would look something like (not tested):

imagefx_register_filter('custom-name','my_custom_filter');

function my_custom_filter(&$image, $outputFile, $quality) {
$image = imagecreatefrompng(&$image);
imagejpeg($image, $outputFile, $quality);
imagedestroy($image);

}

But remember they are not the same format and .jpg does doesn’t support alpha-transparency

Leave a Comment

tech