29d28 < 34,42d32 < $curlstr=""; < $iscurl=false; < < if (!isset($argc) && isset($_GET['command'])) { // curl mode of use eg. curl "http://localhost:8888/convert_wildcard.php?command=x*.jpg+-q+76+-negate+.jpeg" < $curlstr="convert_wildcard.php " . str_replace('+',' ',urldecode($_GET['command'])); < $argv=explode(" ", $curlstr); < $argc=sizeof($argv); < if (strpos(strtolower($_SERVER['SERVER_NAME']), 'rjmprogramming.com.au') !== false) { $iscurl=true; } < } 107c97 < $filteropt="

Optional Image Filtering and/or Transformations ...
"; --- > $filteropt="

Optional Image Filtering ...
"; 202,243d191 < < function ourImageFlip($imgsrc, $mode) { // thanks to https://stackoverflow.com/questions/10001728/how-to-flip-image-horizontaly-and-vertically-with-php < $width = imagesx ( $imgsrc ); < $height = imagesy ( $imgsrc ); < < $src_x = 0; < $src_y = 0; < $src_width = $width; < $src_height = $height; < < switch ($mode) { < case '1': //vertical < $src_y = $height -1; < $src_height = -$height; < break; < < case '2': //horizontal < $src_x = $width -1; < $src_width = -$width; < break; < < case '3': //both < $src_x = $width -1; < $src_y = $height -1; < $src_width = -$width; < $src_height = -$height; < break; < < default: < return $imgsrc; < break; < } < < $imgdest = imagecreatetruecolor ( $width, $height ); < < if ( imagecopyresampled ( $imgdest, $imgsrc, 0, 0, $src_x, $src_y , $width, $height, $src_width, $src_height ) ) { < return $imgdest; < } < < return $imgsrc; < } < 642,685d589 < < < } else if (isset($_GET['scale']) || isset($_POST['scale'])) { < < $jm_php = imagecreatefromstring(ourfile_get_contents(str_replace(' ','+',urldecode($_GET['flip'])) . str_replace(' ','+',urldecode($_POST['flip'])) . $zfilename)); < < $wh = imagesx($jm_php); < $ht = imagesy($jm_php); < < //file_put_contents("qwe.qwe2", "wh=" . $wh . " and ht=" . $ht); < if (isset($_GET['arg1'])) { < $iim_php = imagecreatetruecolor(intval($wh * floatval(trim(str_replace('+',' ',urldecode($_GET['arg1']))))),intval($ht * floatval(trim(str_replace('+',' ',urldecode($_GET['arg1'])))))); < imagecopyresampled($iim_php,$jm_php,0,0,0,0,intval($wh * floatval(trim(str_replace('+',' ',urldecode($_GET['arg1']))))),intval($ht * floatval(trim(str_replace('+',' ',urldecode($_GET['arg1']))))),intval($wh),intval($ht)); //, imagecolorallocate($jm_php,255,255,255)); < } else if (isset($_POST['arg1'])) { < $iim_php = imagecreatetruecolor(intval($wh * floatval(trim(str_replace('+',' ',urldecode($_POST['arg1']))))),intval($ht * floatval(trim(str_replace('+',' ',urldecode($_POST['arg1'])))))); < //file_put_contents("qwe.qwe3", '' . intval($wh)); < imagecopyresampled($iim_php,$jm_php,0,0,0,0,intval($wh * floatval(trim(str_replace('+',' ',urldecode($_POST['arg1']))))),intval($ht * floatval(trim(str_replace('+',' ',urldecode($_POST['arg1']))))),intval($wh),intval($ht)); < //file_put_contents("qwe.qwe4", '' . intval($wh * floatval(trim(str_replace('+',' ',urldecode($_POST['arg1'])))))); < } else if (isset($_GET['scale'])) { < if (strlen($_GET['scale']) == 0) { < $iim_php = imagecreatetruecolor(intval($wh),intval($ht)); < imagecopyresampled($iim_php,$jm_php,0,0,0,0,intval($wh),intval($ht),intval($wh),intval($ht)); < } else { < $iim_php = imagecreatetruecolor(intval($wh * floatval(trim(str_replace('+',' ',urldecode($_GET['scale']))))),intval($ht * floatval(trim(str_replace('+',' ',urldecode($_GET['scale'])))))); < imagecopyresampled($iim_php,$jm_php,0,0,0,0,intval($wh * floatval(trim(str_replace('+',' ',urldecode($_GET['scale']))))),intval($ht * floatval(trim(str_replace('+',' ',urldecode($_GET['scale']))))),intval($wh),intval($ht)); < } < } else if (isset($_POST['scale'])) { < //file_put_contents("qwe.qwe3", '' . (trim(str_replace('+',' ',urldecode($_POST['rotation']))))); < if (strlen($_POST['scale']) == 0) { < $iim_php = imagecreatetruecolor(intval($wh),intval($ht)); < imagecopyresampled($iim_php,$jm_php,0,0,0,0,intval($wh),intval($ht),intval($wh),intval($ht)); < } else { < $iim_php = imagecreatetruecolor(intval($wh * floatval(trim(str_replace('+',' ',urldecode($_POST['scale']))))),intval($ht * floatval(trim(str_replace('+',' ',urldecode($_POST['scale'])))))); < imagecopyresampled($iim_php,$jm_php,0,0,0,0,intval($wh * floatval(trim(str_replace('+',' ',urldecode($_POST['scale']))))),intval($ht * floatval(trim(str_replace('+',' ',urldecode($_POST['scale']))))),intval($wh),intval($ht)); < } < //file_put_contents("qwe.qwe4", '' . floatval(trim(str_replace('+',' ',urldecode($_POST['rotation']))))); < } else { < $iim_php = imagecreatetruecolor(intval($wh),intval($ht)); < imagecopyresampled($iim_php,$jm_php,0,0,0,0,intval($wh),intval($ht),intval($wh),intval($ht)); < } < //file_put_contents("qwe.qwe5", $zfilename); < imagedestroy($jm_php); < return $iim_php; //$new_name = 'anewimage0.jpg'; < 690,701c594,595 < if (isset($_GET['arg1'])) { < $iim_php=imagerotate($jm_php, floatval(trim(str_replace('+',' ',urldecode($_GET['arg1'])))), imagecolorallocate($jm_php,255,255,255)); < } else if (isset($_POST['arg1'])) { < //file_put_contents("qwe.qwe3", '' . (trim(str_replace('+',' ',urldecode($_POST['rotation']))))); < $iim_php=imagerotate($jm_php, floatval(trim(str_replace('+',' ',urldecode($_POST['arg1'])))), imagecolorallocate($jm_php,255,255,255)); < //file_put_contents("qwe.qwe4", '' . floatval(trim(str_replace('+',' ',urldecode($_POST['rotation']))))); < } else if (isset($_GET['rotation'])) { < if (strlen($_GET['rotation']) == 0) { < $iim_php=imagerotate($jm_php, 0.0, imagecolorallocate($jm_php,255,255,255)); < } else { < $iim_php=imagerotate($jm_php, floatval(trim(str_replace('+',' ',urldecode($_GET['rotation'])))), imagecolorallocate($jm_php,255,255,255)); < } --- > if (isset($_GET['rotation'])) { > $iim_php=imagerotate($jm_php, floatval(trim(str_replace('+',' ',urldecode($_GET['rotation'])))), 0); 704,708c598 < if (strlen($_POST['rotation']) == 0) { < $iim_php=imagerotate($jm_php, 0.0, imagecolorallocate($jm_php,255,255,255)); < } else { < $iim_php=imagerotate($jm_php, floatval(trim(str_replace('+',' ',urldecode($_POST['rotation'])))), imagecolorallocate($jm_php,255,255,255)); < } --- > $iim_php=imagerotate($jm_php, floatval(trim(str_replace('+',' ',urldecode($_POST['rotation'])))), 0); 711c601 < $iim_php=imagerotate($jm_php, 0.0, imagecolorallocate($jm_php,255,255,255)); --- > $iim_php=imagerotate($jm_php, 0.0, 0); 714,715c604 < imagedestroy($jm_php); < return $iim_php; //$new_name = 'anewimage0.jpg'; --- > return $jm_php; //$new_name = 'anewimage0.jpg'; 947c836 < if (isset($argc) && !$iscurl) { --- > if (isset($argc)) { 950c839 < $htmlis=" --- > echo " 962c851 < var askastr=';rotation;0;scale;1;emboss;array([-2, -1, 0], [-1, 1, 1], [0, 1, 2]);brightness;255;contrast;100;smooth;35;pixellate;9;colourize;255,255,255;colourizegreen;255;colourizeblue;255;colourizered;255;boxblur;array([1, 1, 1], [1, 1, 1], [1, 1, 1]);edge;array([-1, -1, -1], [-1, 8, -1], [-1, -1, -1]);negedge;array([-1, -1, -1], [-1, 8, -1], [-1, -1, -1]);sharpen;array([0, -1, 0], [-1, 5, -1], [0, -1, 0]);'; --- > var askastr=';emboss;array([-2, -1, 0], [-1, 1, 1], [0, 1, 2]);brightness;255;contrast;100;smooth;35;pixellate;9;colourize;255,255,255;colourizegreen;255;colourizeblue;255;colourizered;255;boxblur;array([1, 1, 1], [1, 1, 1], [1, 1, 1]);edge;array([-1, -1, -1], [-1, 8, -1], [-1, -1, -1]);negedge;array([-1, -1, -1], [-1, 8, -1], [-1, -1, -1]);sharpen;array([0, -1, 0], [-1, 5, -1], [0, -1, 0]);'; 999c888 < function zoomsame(tvo, tvv) { --- > function zoomsame(tvo) { 1001d889 < if (tvv != '') { tv=tvv; } 1061,1071d948 < if (!$iscurl) { < echo $htmlis; < } else { < $phtmlis="temphtml.html"; < while (file_exists($phtmlis)) { < $phtmlis=str_replace(".htm", "0.htm", $phtmlis); < } < file_put_contents($phtmlis, $htmlis); < //exec("cd " . dirname(__FILE__) . " ; open " . $phtmlis); // . " ; rm -f " . $phtmlis); < echo "Please issue command ...\nopen http://www.rjmprogramming.com.au/" . $phtmlis . " \n ... to see results. Omit the open word for Windows. You have up to the next minute to do this. "; < } 1073c950 < ?> --- > ?> \ No newline at end of file