/** * @return array List of supported image formats to be used as setting variants */ function fn_get_supported_image_format_variants() { $formats = array('original' => __('same_as_source')); $supported_formats = ImageHelper::getSupportedFormats(); if (in_array('jpg', $supported_formats)) { $formats['jpg'] = 'JPEG'; } if (in_array('png', $supported_formats)) { $formats['png'] = 'PNG'; } if (in_array('gif', $supported_formats)) { $formats['gif'] = 'GIF'; } return $formats; }