true); if (is_array($image_process = _request('image_process_'))) { $image_process = array_keys($image_process); $image_process = reset($image_process); // application du choix de vignette if ($image_process) { // mettre a jour les formats graphiques lisibles switch ($image_process) { case 'gd1': case 'gd2': $formats_graphiques = $GLOBALS['meta']['gd_formats_read']; break; case 'netpbm': $formats_graphiques = $GLOBALS['meta']['netpbm_formats']; break; case 'convert': case 'imagick': $formats_graphiques = 'gif,jpg,png'; break; default: #debug $formats_graphiques = ''; $image_process = 'non'; break; } ecrire_meta('formats_graphiques', $formats_graphiques, 'non'); ecrire_meta('image_process', $image_process, 'non'); } } foreach (array( 'creer_preview' ) as $m) { if (!is_null($v = _request($m))) { ecrire_meta($m, $v == 'oui' ? 'oui' : 'non'); } } if (!is_null($v = _request('taille_preview'))) { ecrire_meta('taille_preview', intval($v)); } $res['message_ok'] = _T('config_info_enregistree'); return $res; } /** * Indique si une librairie graphique peut être utilisée et retourne alors * une URL pour tester la librairie * * @param string $process * Code de la libriairie, parmi gd2, gd1, netpbm, imagick ou convert * @return string * URL d'action pour tester la librairie graphique en créant une vignette **/ function url_vignette_choix($process) { switch ($process) { case 'gd2': if (!function_exists('ImageCreateTrueColor')) { return ''; } break; case 'gd1': if (!function_exists('ImageGif') and !function_exists('ImageJpeg') and !function_exists('ImagePng') ) { return ''; } break; case 'netpbm': if (defined('_PNMSCALE_COMMAND') and _PNMSCALE_COMMAND == '') { return ''; } break; case 'imagick': if (!method_exists('Imagick', 'readImage')) { return ''; } break; case 'convert': if (defined('_CONVERT_COMMAND') and _CONVERT_COMMAND == '') { return ''; } break; } return generer_url_action('tester', "arg=$process&time=" . time()); }