Converting and save images as JPG in IMCE module during uploading? How to convert PNG to JPG when user upload images with IMCE ?
This is neccessary for disk space optimization. If it is possible to convert with any module or to execute Image Style tell me please.
It can be done in this way:


download ImageCache Actions module and enable Color Actions    module
create image style "Change file format Convert to: jpg"
download and install IMCE Image Style module
on the IMCE Image Style administration page select necessary style


And we need to add custom submit function

/**
 * Implements hook_form_FORM_ID_alter().
 */
 function mymodule_form_imce_upload_form_alter(&amp;$form, &amp;$form_state, $form_id) {
   array_unshift($form['fset_upload']['upload']['#submit'], "mymodule_upload_form_submit");
 }

/**
 * Change uploaded image extension.
 */
 function mymodule_upload_form_submit($form, &amp;$form_state) {
   if ($_FILES['files']['type']['imce'] == 'image/png' &amp;&amp;    $form_state['values']['imce_image_style']['optimize_image'] != '0') {
      $_FILES['files']['name']['imce'] = str_replace('.png', '.jpg', $_FILES['files']['name']['imce']);
   }
 }