[key1] => value1 // [key2] => Array // ( // [key3] => value3 // ) // function split_key_value($str) { $info = array(); $str = trim($str); if (substr($str, 0, 1)=='{' and substr($str, -1)=='}') { $str = substr($str, 1, -1); $inbrkt = 0; $inquot = false; $inkkko = false; $isakey = true; $key = ""; $val = ""; for ($i=0; $i file.tga // function j2k_to_tga($file, $iscopy=true) { if (!file_exists($file)) return false; $com_totga = get_j2k_to_tga_command(); if ($com_totga=='') return false; if ($iscopy) $ret = copy ($file, $file.'.j2k'); else $ret = rename($file, $file.'.j2k'); if (!$ret) return false; exec("$com_totga -i $file.j2k -o $file.tga 1>/dev/null 2>&1"); unlink($file.'.j2k'); return true; } function get_j2k_to_tga_command() { $command = find_command_path('j2k_to_image'); return $command; } // // Image Size Convert Command String // function get_image_size_convert_command($xsize, $ysize) { if (!isNumeric($xsize) or !isNumeric($ysize)) return ''; $command = find_command_path('convert'); if ($command=='') return ''; $prog = $command.' - -geometry '.$xsize.'x'.$ysize.'! -'; return $prog; } function find_command_path($command) { $path = ''; if (file_exists('/usr/local/bin/'.$command)) $path = '/usr/local/bin/'; else if (file_exists('/usr/bin/'.$command)) $path = '/usr/bin/'; else if (file_exists('/usr/X11R6/bin/'.$command)) $path = '/usr/X11R6/bin/'; else if (file_exists('/bin/'.$command)) $path = '/bin/'; else return ''; return $path.$command; }