{"id":67210,"date":"2025-03-01T03:01:00","date_gmt":"2025-02-28T17:01:00","guid":{"rendered":"https:\/\/www.rjmprogramming.com.au\/ITblog\/?p=67210"},"modified":"2025-02-28T15:54:43","modified_gmt":"2025-02-28T05:54:43","slug":"image-conversions-via-php-gd-browsing-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/image-conversions-via-php-gd-browsing-tutorial\/","title":{"rendered":"Image Conversions via PHP GD Browsing Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/convert_wildcard.php\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Image Conversions via PHP GD Browsing Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/convert_wildcard_browse.gif\" title=\"Image Conversions via PHP GD Browsing Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Image Conversions via PHP GD Browsing Tutorial<\/p><\/div>\n<p>As well as the recent <a title='Image Conversions via PHP GD URL Tutorial' href='#icphpgdurlt'>Image Conversions via PHP GD URL Tutorial<\/a>&#8216;s <font color=blue>input data modes of use<\/font> &#8230;<\/p>\n<ul>\n<li>relative URLs (to the RJM Programming domain) &#8230; and we see why we may have left this like this &#8230; we wanted to allow for image file specifications &#8230; something quite involved <font size=1>(but might be contemplated in a reduced functionality sense into the future &#8230;)<\/font> regarding the first of two new URL modus operandi additions to functionality, those being &#8230;<\/li>\n<li><font color=blue>absolute URL single image file &#8230; and &#8230;<\/font><\/li>\n<li><font color=blue>image data URI single image<\/font> &#8230; and today we want to add &#8230;<\/li>\n<li>local image file browsing via the Javascript environment based <a target=\"_blank\" title='Great link' href='http:\/\/www.html5rocks.com\/en\/tutorials\/file\/dndfiles\/' rel=\"noopener\">File API<\/a><\/li>\n<\/ul>\n<p> &#8230; and as we got this new input mode functionality option going we widened the processing scope in <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/convert_wildcard.php--------GETME\" title='convert_wildcard.php' rel=\"noopener\">the changed<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/convert_wildcard.php--------GETME\" title='convert_wildcard.php' rel=\"noopener\">convert_wildcard.php<\/a>&#8216;s <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/convert_wildcard.php\" title=\"Click picture\" rel=\"noopener\">image conversion PHP web application<\/a> to &#8230;<\/p>\n<ul>\n<li>offer video creation functionality when several browsed image files are selected &#8230; and\/or &#8230;<\/li>\n<li>offer animated GIF creation functionality when several browsed image files are selected<\/li>\n<\/ul>\n<p>The allowance for multiple selection browsing helped out by <a target=\"_blank\" href='https:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=https:\/\/www.rjmprogramming.com.au\/HTMLCSS\/client_browsing.html------------------------------------------------------GETME' rel=\"noopener\">the changed<\/a> <a target=\"_blank\" href='https:\/\/www.rjmprogramming.com.au\/HTMLCSS\/client_browsing.html------------------------------------------------------GETME' rel=\"noopener\">client_browsing.htm<\/a> client side HTML and Javascript inhouse helper helped out here.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=\"_blank\" href='\/\/www.rjmprogramming.com.au\/ITblog\/image-conversions-via-php-gd-browsing-tutorial\/' rel=\"noopener\">Image Conversions via PHP GD Browsing Tutorial<\/a>.<\/p-->\n<hr>\n<p id='icphpgdurlt'>Previous relevant <a target=\"_blank\" title='Image Conversions via PHP GD URL Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/image-conversions-via-php-gd-url-tutorial\/' rel=\"noopener\">Image Conversions via PHP GD URL Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/convert_wildcard.php\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Image Conversions via PHP GD URL Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/convert_wildcard_overlay_reveal_revisit.gif\" title=\"Image Conversions via PHP GD URL Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Image Conversions via PHP GD URL Tutorial<\/p><\/div>\n<p>The PHP inhouse Image Converter web application last talked about at <a title='Image Conversions via PHP GD Overlay Reveal Tutorial' href='#icphpgdort'>Image Conversions via PHP GD Overlay Reveal Tutorial<\/a> got a revisit today.  It&#8217;s been more than two years, and that amount of separation sometimes gives you the chance to &#8220;go back to square one&#8221; and not be caught in amongst the &#8220;labyrinth of thought&#8221; as you get too far into complex optional logics you might apply to a web application project.<\/p>\n<p>And what stood out to us, on this revisit?  It was the image input options that immediately stuck out to us, in that it used to be limited to &#8230;<\/p>\n<ul>\n<li>relative URLs (to the RJM Programming domain) &#8230; and we see why we may have left this like this &#8230; we wanted to allow for image file specifications &#8230; something quite involved <font size=1>(but might be contemplated in a reduced functionality sense into the future &#8230;)<\/font> regarding the first of two new URL modus operandi additions to functionality, those being &#8230;<\/li>\n<li>absolute URL single image file &#8230; and &#8230;<\/li>\n<li>image data URI single image<\/li>\n<\/ul>\n<p>Of course, should the absolute URL web servers allow such access, this opens up whole new vistas of functionality possibility here.<\/p>\n<p>Both new URL modus operandi above used an HTML iframe (shown along with an HTML form referenced later, also) &#8230;<\/p>\n<p>&lt;?php echo &#8221;<br \/>\n<code><br \/>\n&lt;iframe style=display:none; id=ifi name=ifi src=.\/convert_wildcard.php&gt;&lt;\/iframe&gt;<br \/>\n&lt;form method=POST action='\/convert_wildcard.php' target=ifi style=display:none;&gt;<br \/>\n&lt;input type=hidden name=absimg id=absimg value=''&gt;&lt;\/input&gt;&lt;input id=sabsi type=submit value=Submit style=display:none;&gt;&lt;\/input&gt;&lt;\/form&gt;<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;<\/p>\n<p> &#8230; but in two interestingly different ways <font size=1>&#8230; well, you had to be there!<\/font><\/p>\n<table>\n<tr>\n<th><font color=blue>absolute URL<\/font> single image file<\/th>\n<\/tr>\n<tr>\n<td>\n&lt;?php echo &#8221;<br \/>\n<code><br \/>\nfunction lookforabsolute(ino) {<br \/>\n   if (ino.value.indexOf('data:') == 0 && ino.value.indexOf('image\/') != -1) {<br \/>\n     document.getElementById('absimg').value=ino.value;<br \/>\n     document.getElementById('sabsi').click();<br \/>\n   } else <font color=blue>if (ino.value.indexOf('\/\/') != -1) {<br \/>\n     ino.title=ino.value;<br \/>\n     document.getElementById('ifi').src='.\/convert_wildcard.php?absimg=' + encodeURIComponent('http:\/\/' + ino.value.split('\/\/')[1]);<br \/>\n   }<\/font><br \/>\n}<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;<br \/>\n &#8230; meeting up with receiving PHP logic, skeletally &#8230;<br \/>\n&lt;?php<br \/>\n<code><br \/>\n$gabsimg='';<br \/>\nif (isset($_GET['absimg'])) {<br \/>\n  $gabsimg=$_GET['absimg'];<br \/>\n}<br \/>\nif (isset($_POST['absimg'])) {<br \/>\n  \/\/ Perform necessary $_POST scenario populating of $gabsimg<br \/>\n}<br \/>\nif ($gabsimg != '') { \/\/isset($_GET['absimg'])) {<br \/>\n  \/\/ Perform necessary image URL processing here adjusting parent.document.getElementById('ispec') in the process<br \/>\n}<br \/>\n<\/code><br \/>\n?&gt;\n<\/td>\n<\/tr>\n<tr>\n<th>image <font color=purple>data URI<\/font> single image<\/th>\n<\/tr>\n<tr>\n<td>\n&lt;?php echo &#8221;<br \/>\n<code><br \/>\nfunction lookforabsolute(ino) {<br \/>\n   <font color=purple>if (ino.value.indexOf('data:') == 0 && ino.value.indexOf('image\/') != -1) {<br \/>\n     document.getElementById('absimg').value=ino.value;<br \/>\n     document.getElementById('sabsi').click();<br \/>\n   }<\/font>  else if (ino.value.indexOf('\/\/') != -1) {<br \/>\n     ino.title=ino.value;<br \/>\n     document.getElementById('ifi').src='.\/convert_wildcard.php?absimg=' + encodeURIComponent('http:\/\/' + ino.value.split('\/\/')[1]);<br \/>\n   }<br \/>\n}<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;<br \/>\n &#8230; meeting up with receiving PHP logic, skeletally &#8230;<br \/>\n&lt;?php<br \/>\n<code><br \/>\n$gabsimg='';<br \/>\nif (isset($_GET['absimg'])) {<br \/>\n  \/\/ Perform necessary $_GET scenario populating of $gabsimg<br \/>\n}<br \/>\nif (isset($_POST['absimg'])) {<br \/>\n  $gabsimg=$_POST['absimg'];<br \/>\n  if (strpos(('~' . $gabsimg), '~data') !== false) {<br \/>\n    $dcont=str_replace(' ','+',urldecode($gabsimg));<br \/>\n    if (strpos($dcont, 'image\/') !== false && strpos($dcont, ';base64,') !== false) {<br \/>\n      $inext=strtolower(explode(';base64,', explode('image\/', $dcont)[1])[0]);<br \/>\n      $imgname='\/tmp\/mycw_' . server_remote_addr() . '.' . $inext;<br \/>\n      file_put_contents($imgname, base64_decode(explode(';base64,', $dcont)[1]));<br \/>\n      echo '&lt;html&gt;&lt;body onload=\" parent.document.getElementById(' . \"'ispec'\" . ').value=' . \"'\" . $imgname . \"'\" . ';  parent.document.getElementById(' . \"'ispec'\" . ').title=' . \"''\" . ';    \"&gt;&lt;\/body&gt;&lt;\/html&gt;';<br \/>\n      exit;<br \/>\n    }<br \/>\n  }<br \/>\n}<br \/>\nif ($gabsimg != '') { \/\/isset($_GET['absimg'])) {<br \/>\n  \/\/ Perform necessary image URL processing here adjusting parent.document.getElementById('ispec') in the process, if not already done above (and not getting here)<br \/>\n}<br \/>\n<\/code><br \/>\n?&gt;\n<\/td>\n<\/tr>\n<\/table>\n<p> &#8230; the most obvious reason for divergent approaches happening here being that data URIs are large and need $_POST[] form navigation while absolute URLs are short enough to use the simpler $_GET[] approach in <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/convert_wildcard.php-------GETME\" title='convert_wildcard.php' rel=\"noopener\">the changed<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/convert_wildcard.php-------GETME\" title='convert_wildcard.php' rel=\"noopener\">convert_wildcard.php<\/a>&#8216;s <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/convert_wildcard.php\" title=\"Click picture\" rel=\"noopener\">image conversion PHP web application<\/a>.<\/p>\n<p><b><i>Did you know?<\/i><\/b><\/p>\n<p>Are you interested in the image data of a particular date at this WordPress Blog?  Maybe you want to apply some GD filtering to it, download it, and move on?   We don&#8217;t mind such image data repurposing.  Well, for the example date 19th February, 2025 (ie. 20250219) you could &#8230;<\/p>\n<ul>\n<li>at the topmost textbox, enter in &#8230;<br \/>\n<code><br \/>\nhttps:\/\/www.rjmprogramming.com.au\/ITblog\/500\/500\/?mustbedated=20250219<br \/>\n<\/code><br \/>\n &#8230; <font size=1>(and, if you are lazy, you can just type in 20250219 &#8230; eight character dates before 2000 present a random image thanks to <a target=\"_blank\" href='https:\/\/picsum.photos\/' rel=\"noopener\">Lorem Picsum<\/a>)<\/font> or &#8230;<\/li>\n<li>a web browser address bar URL such as (the derived from action above) &#8230;<br \/>\n<code><br \/>\n<a target=\"_blank\" title='https:\/\/www.rjmprogramming.com.au\/convert_wildcard.php?inval=http%3A%2F%2Fwww.rjmprogramming.com.au%2Finhouse_slideshow_substance_multiple.jpg' href='\/\/www.rjmprogramming.com.au\/convert_wildcard.php?inval=hTTp%3A%2F%2Fwww.rjmprogramming.com.au%2Finhouse_slideshow_substance_multiple.jpg' rel=\"noopener\">ht<font color=purple>tp<\/font><\/font>:\/\/www.rjmprogramming.com.au\/convert_wildcard.php?inval=ht<font color=purple>tp<\/font>%3A%2F%2Fwww.rjmprogramming.com.au%2Finhouse_slideshow_substance_multiple.jpg<\/a><br \/>\n<\/code>\n<\/li>\n<\/ul>\n<p> &#8230; readying you for your PHP GD based filtering &#8220;smarts&#8221; to apply, and process, and download &#8230; etcetera etcetera etcetera.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=\"_blank\" href='\/\/www.rjmprogramming.com.au\/ITblog\/image-conversions-via-php-gd-url-tutorial\/' rel=\"noopener\">Image Conversions via PHP GD URL Tutorial<\/a>.<\/p-->\n<hr>\n<p id='icphpgdort'>Previous relevant <a target=\"_blank\" title='Image Conversions via PHP GD Overlay Reveal Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/image-conversions-via-php-gd-overlay-reveal-tutorial\/' rel=\"noopener\">Image Conversions via PHP GD Overlay Reveal Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/convert_wildcard.php\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Image Conversions via PHP GD Overlay Reveal Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/convert_wildcard_overlay_reveal.gif\" title=\"Image Conversions via PHP GD Overlay Reveal Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Image Conversions via PHP GD Overlay Reveal Tutorial<\/p><\/div>\n<p>Around here, we have two words we like to approach the topic of &#8220;web design&#8221;, where it meets &#8220;practicality&#8221;, with &#8230;<\/p>\n<ul>\n<li><a target=\"_blank\" href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/reveal\" title=\"Reveal postings\" rel=\"noopener\">reveal<\/a><\/li>\n<li><a target=\"_blank\" href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/overlay\" title=\"Overlay postings\" rel=\"noopener\">overlay<\/a><\/li>\n<\/ul>\n<p>And so, onto yesterday&#8217;s <a title='Image Conversions via PHP GD Multiple Actions Tutorial' href='#icphpgdmat'>Image Conversions via PHP GD Multiple Actions Tutorial<\/a>&#8216;s progress with our Image Conversions via PHP GD web application we were keen to think that an &#8220;overlay&#8221; concept could be part of the workings, at the image creation stage of the web design.   Supposing you have a set of images that go to make up the whole, we can use the new &#8220;Merge&#8221; option as per &#8230;<\/p>\n<details>\n<summary style=background-color:yellow;>Show me &#8220;Merge&#8221; Image Conversion <a target=\"_blank\" title='Overlay idea' href='http:\/\/www.rjmprogramming.com.au\/convert_wildcard.php?command=crop_this_*.png+-q+76+-merge+70+.jpeg&#038;amnotcurl=yes' rel=\"noopener\">&#8220;Overlay&#8221; Idea<\/a> below &#8230;<\/summary>\n<p><iframe style='width:100%;height:1700px;' src='http:\/\/www.rjmprogramming.com.au\/convert_wildcard.php?command=crop_this_*.png+-q+76+-merge+70+.jpeg&#038;amnotcurl=yes'><\/iframe><br \/>\n<\/details>\n<p> &#8230; we found was most feasible with PNG input image files, with transparency.<\/p>\n<p>And then, onto yesterday&#8217;s <a title='Image Conversions via PHP GD Multiple Actions Tutorial' href='#icphpgdmat'>Image Conversions via PHP GD Multiple Actions Tutorial<\/a>&#8216;s progress with our Image Conversions via PHP GD web application we were keen to think that an &#8220;reveal&#8221; concept (a bit like a cartoon, perhaps) could be part of the workings, at the image creation stage of the web design.   Supposing you have a set of images that go to make up the whole, we can use the new &#8220;Merge&#8221; option as per &#8230;<\/p>\n<details>\n<summary style=background-color:yellow;>Show me &#8220;Merge&#8221; Image Conversion <a target=\"_blank\" title='Reveal idea' href='http:\/\/www.rjmprogramming.com.au\/convert_wildcard.php?command=scene_*.*g*+-q+100+-merge+80+.jpeg&#038;amnotcurl=yes' rel=\"noopener\">&#8220;Reveal&#8221; Idea<\/a> below &#8230;<\/summary>\n<p><iframe style='width:100%;height:2000px;' src='http:\/\/www.rjmprogramming.com.au\/convert_wildcard.php?command=scene_*.*g*+-q+100+-merge+80+.jpeg&#038;amnotcurl=yes'><\/iframe><br \/>\n<\/details>\n<p> &#8230; we found was most feasible with &#8230;<\/p>\n<ul>\n<li>PNG input image file(s) <font size=1>&#8230; self made or source from a free source such as <a target=\"_blank\" title='Pixabay original image source, thanks' href='https:\/\/pixabay.com\/images\/search\/cartoon%20dog\/' rel=\"noopener\">Pixabay<\/a>, <a target=\"_blank\" title='Pixabay image saved' href='http:\/\/www.rjmprogramming.com.au\/whole_scene.png' rel=\"noopener\">thanks<\/a><\/font> &#8230;<\/i>\n<li>cut up via <a target=\"_blank\" href='http:\/\/www.gimp.org' title='Gimp, or GIMP' rel=\"noopener\">Gimp<\/a>&#8216;s &#8230;\n<ol>\n<li><i>Selection Tools -&gt; Free Select<\/i> &#8230; and &#8230;<\/li>\n<li><i>Edit -&gt; Clear<\/i> &#8230; and &#8230;<\/li>\n<li><i>File -&gt; Export As&#8230; -&gt; .png (set &#8220;Save color values from Transparent Pixels&#8221; on)<\/i><\/li>\n<\/ol>\n<\/li>\n<li>open PNG in <a target=\"_blank\" title='macOS PaintBrush' href='https:\/\/paintbrush.sourceforge.io\/' rel=\"noopener\">Paintbrush<\/a> and <i>File -&gt; Save As&#8230; -&gt; JPEG<\/i><\/li>\n<li>use &#8220;Merge&#8221; option of <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/convert_wildcard.php\" title=\"Click picture\" rel=\"noopener\">Image Conversion via GD web application<\/a><\/li>\n<\/ul>\n<p>And then, at least with our <a target=\"_blank\" title='MAMP' href='http:\/\/www.mamp.info' rel=\"noopener\">MAMP<\/a> <font size=1>local Apache web server<\/font> PHP version we can also offer &#8230;<\/p>\n<ul>\n<li>crop <font size=1>&#8230; nominate a colour in images to crop via, and gets a look in with today&#8217;s <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/convert_wildcard_overlay_reveal.gif\" title=\"Tutorial picture\" rel=\"noopener\">animated GIF tutorial picture<\/a><\/font><\/li>\n<li>transparent <font size=1>&#8230; nominate a colour in images to make transparent<\/font><\/li>\n<\/ul>\n<p> &#8230; additional functionalities  in <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/convert_wildcard.php-----GETME\" title='convert_wildcard.php' rel=\"noopener\">the changed<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/convert_wildcard.php-----GETME\" title='convert_wildcard.php' rel=\"noopener\">convert_wildcard.php<\/a>&#8216;s <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/convert_wildcard.php\" title=\"Click picture\" rel=\"noopener\">image conversion PHP web application<\/a>.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=\"_blank\" href='\/\/www.rjmprogramming.com.au\/ITblog\/image-conversions-via-php-gd-overlay-reveal-tutorial\/' rel=\"noopener\">Image Conversions via PHP GD Overlay Reveal Tutorial<\/a>.<\/p-->\n<hr>\n<p id='icphpgdmat'>Previous relevant <a target=\"_blank\" title='Image Conversions via PHP GD Multiple Actions Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/image-conversions-via-php-gd-multiple-actions-tutorial\/' rel=\"noopener\">Image Conversions via PHP GD Multiple Actions Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/convert_wildcard.php\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Image Conversions via PHP GD Multiple Actions Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/convert_wildcard_multi.jpg\" title=\"Image Conversions via PHP GD Multiple Actions Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Image Conversions via PHP GD Multiple Actions Tutorial<\/p><\/div>\n<p>We&#8217;ve waited a while preparing for today&#8217;s release of &#8220;multiple actions&#8221; functionality onto yesterday&#8217;s <a title='Image Conversions via PHP GD Transformations Tutorial' href='#icphpgdtt'>Image Conversions via PHP GD Transformations Tutorial<\/a>.  From how we see it we had a choice of two approaches to delivering this new functionality &#8230;<\/p>\n<ul>\n<li>start using select (ie. dropdown) element <a target=\"_blank\" title='HTML select element multiple attribute information from W3schools' href='https:\/\/www.w3schools.com\/tags\/att_select_multiple.asp#:~:text=For%20windows%3A%20Hold%20down%20the,button%20to%20select%20multiple%20options' rel=\"noopener\">multiple attribute<\/a> approach &#8230; but, especially because we are separating <a target=\"_blank\" title='PHP GD' href='https:\/\/www.php.net\/manual\/en\/function.gd-info.php' rel=\"noopener\">GD<\/a> &#8220;Filters&#8221; into one dropdown and &#8220;Transformations&#8221; into another, we think it would be better to &#8230;<\/li>\n<li>start prefixing &#10004; (&amp;#10004; tick) emoji to selected action(s) to apply to any images involved in the conversions<\/li>\n<\/ul>\n<p>The &#10004; (&amp;#10004; tick) emoji was enough for us, yet we wanted to indicate to the user the order of actions they&#8217;ve entered.  To do this we were helped out by Javascript <a target=\"_blank\" href='https:\/\/www.w3schools.com\/js\/js_array_sort.asp' title='Javascript sort information from W3schools' rel=\"noopener\">sort<\/a> methodology used in &#8230;<\/p>\n<p>&lt;?php echo &#8221;<br \/>\n<code><br \/>\nfunction sortsel(insel) {<br \/>\n  var sv=insel.value;<br \/>\n  var optsa=insel.innerHTML.split('&lt;\/option&gt;');<br \/>\n  var sopta=optsa.sort();<br \/>\n  var newih='';<br \/>\n  for (var ioj=0; ioj&lt;sopta.length; ioj++) {<br \/>\n    newih+=sopta[ioj] + '&lt;\/option&gt;';<br \/>\n  }<br \/>\n  insel.innerHTML=newih;<br \/>\n  insel.value=sv;<br \/>\n}<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;<\/p>\n<p> &#8230; accepting the GD &#8220;Filter&#8221; dropdown object as a parameter.  But how is that going to help when &#8220;action&#8221; titles will just determine the sort order?   Well, the select (ie. dropdown) element here is made up of &#8230;<\/p>\n<p>&lt;?php echo &#8221;<\/p>\n<blockquote><p>\n&lt;option value=\\&#8221;action_desc\\&#8221;&gt;Action Desc&lt;\/option&gt;\n<\/p><\/blockquote>\n<p>&#8220;; ?&gt;<\/p>\n<p> &#8230; parts where <font color=blue>we started defining the first two this way<\/font> &#8230;<\/p>\n<p>&lt;?php echo &#8221;<\/p>\n<blockquote><p>\n&lt;option<font color=blue> class=\\&#8221;opt000\\&#8221;<\/font> value=\\&#8221;\\&#8221;&gt;Image Filter &#8230;&lt;\/option&gt;&lt;option<font color=blue> class=\\&#8221;opt001\\&#8221;<\/font> value=\\&#8221; \\&#8221;&gt;Image Filter Ask Arguments &#8230;&lt;\/option&gt;\n<\/p><\/blockquote>\n<p>&#8220;; ?&gt;<\/p>\n<p> &#8230; and then <font color=blue>changed our dropdown onchange event logic<\/font> supplementing a new &#8220;whenmulti&#8221; <i>total picture<\/i> data member that is now maintained &#8230;<\/p>\n<p>&lt;?php echo &#8221;<br \/>\n<code><br \/>\n  var nextcls=2;<br \/>\n<br \/>\nfunction zoomsame(tvo, tvv) {<br \/>\n  var tv=tvo.value;<br \/>\n  var rest='';<br \/>\n  var getcls='';<br \/>\n  if (tvv != '') { tv=tvv;  }<br \/>\n  var pa=null;<br \/>\n  if (tv.trim() == '' && ('' + tv.length) != '0') { aska=true; }<br \/>\n  if (tv.trim() != '') {<br \/>\n    <font color=blue>if (document.getElementById('whenmulti').value.indexOf(tv + '=') != -1) {<br \/>\n      rest=tv + '=' + document.getElementById('whenmulti').value.split(tv + '=')[1].split(';')[0];<br \/>\n      if (document.getElementById('whenmulti').value.indexOf(rest + ';') != -1) { rest+=';'; }<br \/>\n      document.getElementById('whenmulti').value=document.getElementById('whenmulti').value.replace(rest, '');<br \/>\n      if (document.getElementById('whenmulti').value != '') {<br \/>\n        tvo.name=document.getElementById('whenmulti').value.split('=')[0];<br \/>\n      } else {<br \/>\n        tvo.name='sfilter';<br \/>\n      }<br \/>\n      tvo.innerHTML=tvo.innerHTML.replace(' value=\\\"' + tv + '\\\"&gt;' + tvo.innerHTML.split(' value=\\\"' + tv + '\\\"&gt;')[1].split(' ')[0] + ' ', ' value=\\\"' + tv + '\\\"&gt;');<br \/>\n      getcls=tvo.innerHTML.split(' value=\\\"' + tv + '\\\"&gt;')[0].split(' class=\\\"')[eval(-1 + tvo.innerHTML.split(' value=\\\"' + tv + '\\\"&gt;')[0].split(' class=\\\"').length)].split('\\\"')[0];<br \/>\n      if (getcls != '') { tvo.innerHTML=tvo.innerHTML.replace(' class=\\\"' + getcls + '\\\"', '');  }<br \/>\n      return '';<br \/>\n    }<br \/>\n    if (tvo.outerHTML.indexOf(' name=') == -1) { tvo.name=tv.trim(); } else if (('' + tvo.name) == 'sfilter') {  tvo.name=tv.trim();    } <\/font><br \/>\n    if (aska && askastr.indexOf(';' + tv.trim().toLowerCase() + ';') != -1) {<br \/>\n     pa=prompt('Optionally enter argument(s) for ' + tv.trim(), askastr.split(';' + tv.trim().toLowerCase() + ';')[1].split(';')[0]);<br \/>\n     if (pa != null) {<br \/>\n      if (pa.trim() == '') { pa=null; }<br \/>\n     }<br \/>\n    }<br \/>\n    if (pa != null) {<br \/>\n      <font color=blue>if (document.getElementById('whenmulti').value == '') {<br \/>\n       document.getElementById('whenmulti').value=tv + '=' + pa;<br \/>\n      } else {<br \/>\n       document.getElementById('whenmulti').value+=';' + tv + '=' + pa;<br \/>\n       document.getElementById('presub').innerHTML+='&lt;input type=hidden name=' + tv.trim() + ' value=&gt;&lt;\/input&gt;';<br \/>\n      }<\/font><br \/>\n      if (('' + pa.split(',').length) == '3') {<br \/>\n        document.getElementById('rotation').name='args';<br \/>\n        document.getElementById('rotation').value=pa;<br \/>\n      } else {<br \/>\n        document.getElementById('rotation').name='arg1';<br \/>\n        document.getElementById('rotation').value=pa;<br \/>\n      }<br \/>\n      <font color=blue>tvo.innerHTML=tvo.innerHTML.replace(' value=\\\"' + tv + '\\\"&gt;', ' class=\\\"opt' + ('00' + nextcls).slice(-3) + '\\\" value=\\\"' + tv + '\\\"&gt;&amp;#10004; ');<br \/>\n      nextcls++;<br \/>\n      sortsel(tvo);<\/font><br \/>\n    } else {<br \/>\n      <font color=blue>if (document.getElementById('whenmulti').value == '') {<br \/>\n       document.getElementById('whenmulti').value=tv + '=' + '';<br \/>\n      } else {<br \/>\n       document.getElementById('whenmulti').value+=';' + tv + '=' + '';<br \/>\n       document.getElementById('presub').innerHTML+='&lt;input type=hidden name=' + tv.trim() + ' value=&gt;&lt;\/input&gt;';<br \/>\n      }<br \/>\n      tvo.innerHTML=tvo.innerHTML.replace(' value=\\\"' + tv + '\\\"&gt;', ' class=\\\"opt' + ('00' + nextcls).slice(-3) + '\\\" value=\\\"' + tv + '\\\"&gt;&amp;#10004; ');<br \/>\n      nextcls++;<\/font><br \/>\n      document.getElementById('rotation').name='rotation';<br \/>\n      document.getElementById('rotation').value='' + document.getElementById('trot').value;<br \/>\n      <font color=blue>sortsel(tvo);<\/font><br \/>\n    }<br \/>\n    if (tv.trim().toLowerCase() == 'redo') {<br \/>\n    redo();<br \/>\n    }     \/\/alert(11);<br \/>\n    \/\/}<br \/>\n  }<br \/>\n}<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;<\/p>\n<p> &#8230; helping out that Javascript sort with disruptive, but useful, <i>class<\/i> attribute inclusion into those <i>option<\/i> <font size=1>sub<\/font>element outerHTML (which makes up the select element innerHTML) content in <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/convert_wildcard.php----GETME\" title='convert_wildcard.php' rel=\"noopener\">the changed<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/convert_wildcard.php----GETME\" title='convert_wildcard.php' rel=\"noopener\">convert_wildcard.php<\/a>&#8216;s <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/convert_wildcard.php\" title=\"Click picture\" rel=\"noopener\">image conversion PHP web application<\/a>.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=\"_blank\" href='\/\/www.rjmprogramming.com.au\/ITblog\/image-conversions-via-php-gd-multiple-actions-tutorial\/' rel=\"noopener\">Image Conversions via PHP GD Multiple Actions Tutorial<\/a>.<\/p-->\n<hr>\n<p id='icphpgdtt'>Previous relevant <a target=\"_blank\" title='Image Conversions via PHP GD Transformations Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/image-conversions-via-php-gd-transformations-tutorial\/' rel=\"noopener\">Image Conversions via PHP GD Transformations Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/convert_wildcard.php\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Image Conversions via PHP GD Transformations Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/convert_wildcard_curl.jpg\" title=\"Image Conversions via PHP GD Transformations Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Image Conversions via PHP GD Transformations Tutorial<\/p><\/div>\n<p>In today&#8217;s work progressing yesterday&#8217;s <a title='Image Conversions via PHP GD Command Line Tutorial' href='#icphpgdclt'>Image Conversions via PHP GD Command Line Tutorial<\/a>&#8216;s outcomes &#8230;<\/p>\n<ul>\n<li>we add into the GD &#8220;Filtering&#8221; thinking, some &#8220;Transformations&#8221; &#8230;<br \/>\n<select size=7><option value=''>Image Transformations &#8230;<\/option><option value=' '>Image Transformation Ask Arguments &#8230;<\/option><option value=flip>Flip<\/option><option value=flipvertical>Flip Vertical<\/option><option value=fliphorizontal>Flip Horizontal<\/option><option value=rotation>Rotation<\/option><option value=scale>Scale<\/option><\/select><br \/>\n &#8230; thinking and functionality &#8230; and then &#8230;<\/li>\n<li>we cater for a <a target=\"_blank\" title='Linux or unix curl information from computerhope' href='http:\/\/www.computerhope.com\/unix\/curl.htm' rel=\"noopener\">&#8220;curl&#8221;<\/a> mode of use &#8230; by, up in that top new<font size=1>ish<\/font> block of code <font color=blue>&#8220;recreating&#8221; a non-existant $argv[] and $argc<\/font> to precede any &#8220;command line&#8221; code that fills in $_POST[] array to join in with &#8220;surfing the web&#8221; mode of use &#8230;<br \/>\n&lt;?php<br \/>\n<code><br \/>\n$beginswitch=false;<br \/>\n$nextquality=false;<br \/>\n$argnext=false;<br \/>\n$results=\"\";<br \/>\n<font color=blue>$curlstr=\"\";<br \/>\n$iscurl=false;<br \/>\n<br \/>\nif (!isset($argc) && isset($_GET['command'])) { \/\/ curl mode of use eg. curl \"ht<\/font><font color=blue>tp:\/\/localhost:8888\/convert_wildcard.php?command=x*.jpg+-q+76+-negate+.jpeg\"<br \/>\n  $curlstr=\"convert_wildcard.php \" . str_replace('+',' ',urldecode($_GET['command']));<br \/>\n  $argv=explode(\" \", $curlstr);<br \/>\n  $argc=sizeof($argv);<br \/>\n  if (strpos(strtolower($_SERVER['SERVER_NAME']), 'rjmprogramming.com.au') !== false) { $iscurl=true; }<br \/>\n}<\/font><br \/>\n<br \/>\nif (isset($argc)) { \/\/ command line mode of use eg. php convert_wildcard.php x*.jpg -q 76 -negate .jpeg<br \/>\n  $results=\"\\n\";<br \/>\n  for ($ii=1; $ii<$argc; $ii++) {\n   if (trim($argv[$ii]) != '') {\n    if ($nextquality) {\n      $nextquality=false;\n      $_POST['quality']=str_replace('%','',$argv[$ii]);\n    } else if (strpos($argv[$ii], '-quality') !== false || strpos($argv[$ii], '-QUALITY') !== false) {\n      $beginswitch=true;\n      if (strpos($argv[$ii],'=') !== false) {\n        $_POST['quality']=str_replace('%','',explode('=', $argv[$ii])[1]);\n      } else if (strlen($argv[$ii]) > 8) {<br \/>\n        $_POST['quality']=str_replace('%','',substr($argv[$ii], 8));<br \/>\n      } else {<br \/>\n        $nextquality=true;<br \/>\n      }<br \/>\n    } else if (strpos($argv[$ii], '-q') !== false || strpos($argv[$ii], '-Q') !== false) {<br \/>\n      $beginswitch=true;<br \/>\n      if (strpos($argv[$ii],'=') !== false) {<br \/>\n        $_POST['quality']=str_replace('%','',explode('=', $argv[$ii])[1]);<br \/>\n      } else if (strlen($argv[$ii]) > 2) {<br \/>\n        $_POST['quality']=str_replace('%','',substr($argv[$ii], 2));<br \/>\n      } else {<br \/>\n        $nextquality=true;<br \/>\n      }<br \/>\n    } else if (substr($argv[$ii],0,1) == '-') {<br \/>\n      $beginswitch=true;<br \/>\n      if (strpos($argv[$ii],'=') !== false) {<br \/>\n        $_POST[substr(strtolower(explode('=',$argv[$ii])[0]),1)]='';<br \/>\n        if (sizeof(explode(',',explode('=',$argv[$ii])[1])) == 3) {<br \/>\n          $_POST['args']=explode('=',$argv[$ii])[1];<br \/>\n        } else {<br \/>\n          $_POST['arg1']=explode('=',$argv[$ii])[1];<br \/>\n        }<br \/>\n      } else {<br \/>\n        $_POST[substr(strtolower(explode('=',$argv[$ii])[0]),1)]='';<br \/>\n        $argnext=true;<br \/>\n      }<br \/>\n    } else if (!isset($_POST['ispec'])) {<br \/>\n      $_POST['ispec']=$argv[$ii];<br \/>\n    } else if (!$beginswitch) {<br \/>\n      $_POST['ispec'].=\",\" . $argv[$ii];<br \/>\n    } else if (substr($argv[$ii],0,1) == '.' || strlen($argv[$ii]) == 3) {<br \/>\n      $argnext=false;<br \/>\n      $_POST['outext']=str_replace(\"..\", \".\", \".\" . $argv[$ii]);<br \/>\n    } else if ($argnext) {<br \/>\n      $argnext=false;<br \/>\n      if (sizeof(explode(',',$argv[$ii])) == 3) {<br \/>\n        $_POST['args']=$argv[$ii];<br \/>\n      } else {<br \/>\n        $_POST['arg1']=$argv[$ii];<br \/>\n      }<br \/>\n    }<br \/>\n   }<br \/>\n  }<br \/>\n}<br \/>\n<\/code><br \/>\n?&gt;<br \/>\n &#8230; and <font color=blue>then rearranged<\/font> <font size=1>(where first blue section just used to be <i>echo <\/i>)<\/font> the last bit of PHP code &#8230;<br \/>\n&lt;?php<br \/>\n<code><br \/>\n<font color=blue>if (isset($argc) && !$iscurl) {<br \/>\necho openthese($results);<br \/>\n} else {<br \/>\n$htmlis=<\/font> \"&lt;!doctyle html&gt;<br \/>\n&lt;html&gt;<br \/>\n&lt;head&gt;<br \/>\n&lt;title&gt;Image Conversions via PHP GD - RJM Programming - October, 2022&lt;\/title&gt;<br \/>\n ... etcetera etcetera etcetera ...<br \/>\n&lt;select id=extsel style=display:none; id=xxxoutext&gt;&lt;option value=''&gt;Enter output relative image file extension [.jpeg]&lt;\/option&gt;&lt;option value=.jpeg&gt;.jpeg&lt;\/option&gt;&lt;option value=.jpg&gt;.jpg&lt;\/option&gt;&lt;option value=.png&gt;.png&lt;\/option&gt;&lt;option value=.gif&gt;.gif&lt;\/option&gt;&lt;option value=.JPEG&gt;.JPEG&lt;\/option&gt;&lt;option value=.JPG&gt;.JPG&lt;\/option&gt;&lt;option value=.PNG&gt;.PNG&lt;\/option&gt;&lt;option value=.GIF&gt;.GIF&lt;\/option&gt;&lt;\/select&gt;<br \/>\n&lt;\/body&gt;<br \/>\n&lt;\/html&gt;\";<br \/>\n<font color=blue> if (!$iscurl) {<br \/>\n   echo $htmlis;<br \/>\n } else {<br \/>\n   $phtmlis=\"temphtml.html\";<br \/>\n   while (file_exists($phtmlis)) {<br \/>\n     $phtmlis=str_replace(\".htm\", \"0.htm\", $phtmlis);<br \/>\n   }<br \/>\n   file_put_contents($phtmlis, $htmlis);<br \/>\n   \/\/exec(\"cd \" . dirname(__FILE__) . \" ; open \" . $phtmlis); \/\/ . \" ; rm -f \" . $phtmlis);<br \/>\n   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. \";<br \/>\n }<br \/>\n}<\/font><br \/>\n<\/code><br \/>\n?&gt;<br \/>\n &#8230; making a <a target=\"_blank\" title='MAMP' href='http:\/\/www.mamp.info' rel=\"noopener\">MAMP<\/a> curl usage such as &#8230;<br \/>\n<code><br \/>\ncurl \"ht<font color=black>tp<\/font>:\/\/localhost:8888\/convert_wildcard.php?command=x*.jpg+-q+76+-negate+.jpeg\"<br \/>\n<\/code><br \/>\n &#8230; open the images in your default desktop image editor, while an RJM Programming incarnation such as &#8230;<br \/>\n<code><br \/>\ncurl \"ht<font color=black>tp<\/font>:\/\/www.rjmprogramming.com.au\/convert_wildcard.php?command=wh*.*g*+-q+76+-negate+.jpeg\"<br \/>\n<\/code><br \/>\n &#8230; will return a string such as &#8230;<\/p>\n<blockquote><p>\nPlease issue command &#8230;<br \/>\nopen ht<font color=black>tp<\/font>:\/\/www.rjmprogramming.com.au\/temphtml.html<br \/>\n &#8230; to see results.  Omit the open word for Windows.  You have up to the next minute to do this.\n<\/p><\/blockquote>\n<p> &#8230; and a quick witted user will copy and paste that <i>open ht<font color=black>tp<\/font>:\/\/www.rjmprogramming.com.au\/temphtml.html<\/i> quickly enough to see a webpage offering image download functionalities\n<\/li>\n<\/ul>\n<p> &#8230; in <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/convert_wildcard.php---GETME\" title='convert_wildcard.php' rel=\"noopener\">the changed<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/convert_wildcard.php---GETME\" title='convert_wildcard.php' rel=\"noopener\">convert_wildcard.php<\/a>&#8216;s <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/convert_wildcard.php\" title=\"Click picture\" rel=\"noopener\">image conversion PHP web application<\/a>.<\/p>\n<p><b><i>Did you know?<\/i><\/b><\/p>\n<p>With that last &#8220;rjmprogramming.com.au&#8221; curl scenario it occurs to us, you could optionally do a multiple command (or use type ahead buffer on Windows) like &#8230;<\/p>\n<p><code><br \/>\ncurl \"ht<font color=black>tp<\/font>:\/\/www.rjmprogramming.com.au\/convert_wildcard.php?command=wh*.*g*+-q+76+-negate+.jpeg\" ; open ht<font color=black>tp<\/font>:\/\/www.rjmprogramming.com.au\/temphtml.html<br \/>\n<\/code><\/p>\n<p> &#8230; for a 99% chance of success without having to worry about the &#8220;too quick&#8221; copying and pasting in less than a minute caper!  Blurb output will correct you if <i>temphtml.html<\/i> is not the go.<\/p>\n<p>Or think procedural scripting where Windows has *.bat batch files and macOS or Linux have shells like sh or bash or csh or ksh (our favourite, called Korn Shell).  A scheduled procedural <a target=\"_blank\" title='crontab information from computerhope ... thanks' href='http:\/\/www.computerhope.com\/jargon\/c\/cron.htm' rel=\"noopener\"><i>crontab<\/i><\/a> command action part could be a Korn Shell one liner like &#8230;<\/p>\n<p><code><br \/>\nksh -c 'curl \"ht<font color=black>tp<\/font>:\/\/www.rjmprogramming.com.au\/convert_wildcard.php?command=wh*.*g*+-q+76+-negate+.jpeg\" ; open ht<font color=black>tp<\/font>:\/\/www.rjmprogramming.com.au\/temphtml.html'<br \/>\n<\/code><\/p>\n<p>Then a Korn Shell script we&#8217;ll call &#8220;daily.ksh&#8221; on macOS or Linux could contain &#8230;<\/p>\n<p><code><br \/>\n#!\/bin\/ksh<br \/>\ncurl \"ht<font color=black>tp<\/font>:\/\/www.rjmprogramming.com.au\/convert_wildcard.php?command=wh*.*g*+-q+76+-negate+.jpeg\"<br \/>\nopen ht<font color=black>tp<\/font>:\/\/www.rjmprogramming.com.au\/temphtml.html<br \/>\nexit<br \/>\n<\/code><\/p>\n<p> &#8230; then, thinking macOS or Linux, make it <font size=1>(perhaps too)<\/font> <a target=\"_blank\" title='chmod info' href='https:\/\/www.computerhope.com\/unix\/uchmod.htm' rel=\"noopener\">executable via<\/a> &#8230;<\/p>\n<p><code><br \/>\nchmod 777 daily.ksh<br \/>\n<\/code><\/p>\n<p> &#8230; and make happen via &#8230;<\/p>\n<p><code><br \/>\n.\/daily.ksh<br \/>\n<\/code><\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=\"_blank\" href='\/\/www.rjmprogramming.com.au\/ITblog\/image-conversions-via-php-gd-transformations-tutorial\/' rel=\"noopener\">Image Conversions via PHP GD Transformations Tutorial<\/a>.<\/p-->\n<hr>\n<p id='icphpgdclt'>Previous relevant <a target=\"_blank\" title='Image Conversions via PHP GD Command Line Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/image-conversions-via-php-gd-command-line-tutorial\/' rel=\"noopener\">Image Conversions via PHP GD Command Line Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/convert_wildcard.php\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Image Conversions via PHP GD Command Line Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/convert_wildcard_commandline.jpg\" title=\"Image Conversions via PHP GD Command Line Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Image Conversions via PHP GD Command Line Tutorial<\/p><\/div>\n<p>In the online woooooorrrrrlllllddd <font size=1>(of surfing the net in a web browser)<\/font> we hope you see &#8220;nothing to see here&#8221; different to yesterday&#8217;s <a title='Image Conversions via PHP GD Filters Tutorial' href='#icphpgdft'>Image Conversions via PHP GD Filters Tutorial<\/a>&#8216;s exploits with <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/convert_wildcard.php\" title=\"Click picture\" rel=\"noopener\">our image conversion PHP web application<\/a>.<\/p>\n<p>And though this is the boring partner in &#8230;<\/p>\n<ul>\n<li>must not break previous logics &#8230;<\/li>\n<li>must work for new functionality<\/li>\n<\/ul>\n<p> &#8230; adage around here trying to keep &#8220;backward compatibility&#8221; as you move forward with a project, it is, often, the most important partner.<\/p>\n<p>As for today, it is more likely our RJM Programming users of <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/convert_wildcard.php--GETME\" title='convert_wildcard.php' rel=\"noopener\">the changed<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/convert_wildcard.php--GETME\" title='convert_wildcard.php' rel=\"noopener\">convert_wildcard.php<\/a> will never access our &#8230;<\/p>\n<ul>\n<li><font size=1>new<\/font> command line <i>mode of use<\/i> &#8230; adding to existant &#8230;<\/li>\n<li>surfing the net <font size=1>(in a web browser)<\/font> <i>mode of use<\/i> &#8230; and perhaps into the future a &#8230;<\/li>\n<li>curl <i>mode of use<\/i><\/li>\n<\/ul>\n<p> &#8230; but we think this PHP web application really suits a command line <i>mode of use<\/i>, given that it so suits a &#8230;<\/p>\n<ul>\n<li>download to local web server, such as Apache\/PHP <a target=\"_blank\" title='MAMP for Apache\/PHP\/MySql on Mac OS X local web server' href='http:\/\/www.mamp.info' rel=\"noopener\">MAMP<\/a> environment &#8230; and once there &#8230;<\/li>\n<li>you can control &#8220;php&#8221; as a command &#8220;verb&#8221; on the command line <font size=1>(by adding MAMP&#8217;s php executable relevant to your version used, to your operating system PATH environment variable)<\/font>, as convenient, to the point that a command line command such as &#8230;<br \/>\n<code><br \/>\nphp convert_wildcard.php x*.jpg -q 76 -negate .jpeg<br \/>\n<\/code><br \/>\n &#8230; reads as a pretty self-explanatory way to achieve a result string such as &#8230;<\/p>\n<blockquote><p>\n<br \/>\nNew image x.jpeg created &#8230;<br \/>\nNew image xcode__fibonacci.jpeg created &#8230;<br \/>\nNew image xcode_fibonacci.jpeg created &#8230;<br \/>\nNew image xcodefibonacci.jpeg created &#8230;<br \/>\nNew image xx.jpeg created &#8230;\n<\/p><\/blockquote>\n<p> &#8230; as we got <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/convert_wildcard_commandline.jpg\" title='convert_wildcard_commandline.jpg' rel=\"noopener\">on our MAMP environment here<\/a>\n<\/li>\n<\/ul>\n<p> &#8230; paradigm set of conditions, quite like <a target=\"_blank\" title='ImageMagick command line' href='http:\/\/www.imagemagick.org\/script\/command-line-tools.php' rel=\"noopener\">ImageMagick<\/a> and its command line (&#8220;convert&#8221; for macOS and Linux and &#8220;magick.exe&#8221; for Windows) image conversion functionality.<\/p>\n<p>The PHP changes were 95% a single block of new code, featuring a &#8220;first time for us&#8221; filling in of $_POST[] array &#8220;linkages&#8221; to &#8220;surfing the net&#8221; code in the new &#8220;command line&#8221; <font size=1>isset($argc) == true<\/font> <i>mode of use<\/i> scenario blocks of code, near the top &#8230;<\/p>\n<p>&lt;?php<br \/>\n<code><br \/>\n$beginswitch=false;<br \/>\n$nextquality=false;<br \/>\n$argnext=false;<br \/>\n$results=\"\";<br \/>\n<br \/>\nif (isset($argc)) { \/\/ command line mode of use eg. php convert_wildcard.php x*.jpg -q 76 -negate .jpeg<br \/>\n  $results=\"\\n\";<br \/>\n  for ($ii=1; $ii&lt;$argc; $ii++) {<br \/>\n   if (trim($argv[$ii]) != '') {<br \/>\n    if ($nextquality) {<br \/>\n      $nextquality=false;<br \/>\n      $_POST['quality']=str_replace('%','',$argv[$ii]);<br \/>\n    } else if (strpos($argv[$ii], '-quality') !== false || strpos($argv[$ii], '-QUALITY') !== false) {<br \/>\n      $beginswitch=true;<br \/>\n      if (strpos($argv[$ii],'=') !== false) {<br \/>\n        $_POST['quality']=str_replace('%','',explode('=', $argv[$ii])[1]);<br \/>\n      } else if (strlen($argv[$ii]) &gt; 8) {<br \/>\n        $_POST['quality']=str_replace('%','',substr($argv[$ii], 8));<br \/>\n      } else {<br \/>\n        $nextquality=true;<br \/>\n      }<br \/>\n    } else if (strpos($argv[$ii], '-q') !== false || strpos($argv[$ii], '-Q') !== false) {<br \/>\n      $beginswitch=true;<br \/>\n      if (strpos($argv[$ii],'=') !== false) {<br \/>\n        $_POST['quality']=str_replace('%','',explode('=', $argv[$ii])[1]);<br \/>\n      } else if (strlen($argv[$ii]) &gt; 2) {<br \/>\n        $_POST['quality']=str_replace('%','',substr($argv[$ii], 2));<br \/>\n      } else {<br \/>\n        $nextquality=true;<br \/>\n      }<br \/>\n    } else if (substr($argv[$ii],0,1) == '-') {<br \/>\n      $beginswitch=true;<br \/>\n      if (strpos($argv[$ii],'=') !== false) {<br \/>\n        $_POST[substr(strtolower(explode('=',$argv[$ii])[0]),1)]='';<br \/>\n        if (sizeof(explode(',',explode('=',$argv[$ii])[1])) == 3) {<br \/>\n          $_POST['args']=explode('=',$argv[$ii])[1];<br \/>\n        } else {<br \/>\n          $_POST['arg1']=explode('=',$argv[$ii])[1];<br \/>\n        }<br \/>\n      } else {<br \/>\n        $_POST[substr(strtolower(explode('=',$argv[$ii])[0]),1)]='';<br \/>\n        $argnext=true;<br \/>\n      }<br \/>\n    } else if (!isset($_POST['ispec'])) {<br \/>\n      $_POST['ispec']=$argv[$ii];<br \/>\n    } else if (!$beginswitch) {<br \/>\n      $_POST['ispec'].=\",\" . $argv[$ii];<br \/>\n    } else if (substr($argv[$ii],0,1) == '.' || strlen($argv[$ii]) == 3) {<br \/>\n      $argnext=false;<br \/>\n      $_POST['outext']=str_replace(\"..\", \".\", \".\" . $argv[$ii]);<br \/>\n    } else if ($argnext) {<br \/>\n      $argnext=false;<br \/>\n      if (sizeof(explode(',',$argv[$ii])) == 3) {<br \/>\n        $_POST['args']=$argv[$ii];<br \/>\n      } else {<br \/>\n        $_POST['arg1']=$argv[$ii];<br \/>\n      }<br \/>\n    }<br \/>\n   }<br \/>\n  }<br \/>\n}<br \/>\n<\/code><br \/>\n?&gt;<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=\"_blank\" href='\/\/www.rjmprogramming.com.au\/ITblog\/image-conversions-via-php-gd-command-line-tutorial\/' rel=\"noopener\">Image Conversions via PHP GD Command Line Tutorial<\/a>.<\/p-->\n<hr>\n<p id='icphpgdft'>Previous relevant <a target=\"_blank\" title='Image Conversions via PHP GD Filters Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/image-conversions-via-php-gd-filters-tutorial\/' rel=\"noopener\">Image Conversions via PHP GD Filters Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/convert_wildcard.php\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Image Conversions via PHP GD Filters Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/convert_wildcard_filtering.jpg\" title=\"Image Conversions via PHP GD Filters Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Image Conversions via PHP GD Filters Tutorial<\/p><\/div>\n<p>Once in the (PHP) <a target=\"_blank\" title='PHP GD' href='https:\/\/www.php.net\/manual\/en\/function.gd-info.php' rel=\"noopener\">GD<\/a><font size=1>-land<\/font> of yesterday&#8217;s <a title='Image Conversions via PHP GD Primer Tutorial' href='#icphpgdpt'>Image Conversions via PHP GD Primer Tutorial<\/a>, you&#8217;d be mad not to facilitate some image filtering which GD is so good at.  And so, we have included an optional usage dropdown as per &#8230;<\/p>\n<p><select size=\"20\" data-id=\"sfilter\" data-onchange=\"zoomsame(this);\"><option value=\"\">Image Filter &#8230;<\/option><option value=\" \">Image Filter Ask Arguments &#8230;<\/option><!--option style=display:none; id=redoopt value=redo>Undo Last ...<\/option><option value=flip>Flip<\/option><option value=flipvertical>Flip Vertical<\/option><option value=fliphorizontal>Flip Horizontal<\/option><option value=rotation>Rotation<\/option--><option value=\"emboss\">Emboss<\/option><option value=\"negate\">Negate<\/option><option value=\"edge\">Edge<\/option><option value=\"negedge\">Negedge<\/option><option value=\"grayscale\">Grayscale<\/option><option value=\"gaussianblur\">Gaussian Blur<\/option><option value=\"selectiveblur\">Selective Blur<\/option><option value=\"sharpen\">Sharpen<\/option><option value=\"boxblur\">Boxblur<\/option><option value=\"colourize\">Colourize<\/option><option value=\"pixellate\">Pixellate<\/option><option value=\"smooth\">Smooth<\/option><option value=\"contrast\">Contrast<\/option><option value=\"brightness\">Brightness<\/option><option value=\"sketchy\">Sketchy<\/option><option value=\"colourizered\">Colourize Red<\/option><option value=\"colourizegreen\">Colourize Green<\/option><option value=\"colourizeblue\">Colourize Blue<\/option><\/select><\/p>\n<p> &#8230; into the mix.  We add this select element &#8220;dropdown&#8221; within the HTML form method=POST action=&#8221;Here&#8217;s looking at you kid&#8221; arrangement.  Initially it gets assigned just an ID attribute, with no NAME attribute, which is an ideal arrangement when functionality is optional.  And so, if the user chooses a real &#8220;filter&#8221; here it gets assigned an appropriate NAME attribute <font color=blue>as per<\/font> the PHP&#8217;s Javascript dropdown onchange event logic &#8230;<\/p>\n<p>&lt;?php echo &#8221;<br \/>\n<code><br \/>\nfunction zoomsame(tvo) {<br \/>\n  var tv=tvo.value;<br \/>\n  var pa=null;<br \/>\n  if (tv.trim() == '' && ('' + tv.length) != '0') { aska=true; }<br \/>\n  if (tv.trim() != '') {<br \/>\n    <font color=blue>tvo.name=tv.trim();<\/font><br \/>\n    if (aska && askastr.indexOf(';' + tv.trim().toLowerCase() + ';') != -1) {<br \/>\n     pa=prompt('Optionally enter argument(s) for ' + tv.trim(), askastr.split(';' + tv.trim().toLowerCase() + ';')[1].split(';')[0]);<br \/>\n     if (pa != null) {<br \/>\n      if (pa.trim() == '') { pa=null; }<br \/>\n     }<br \/>\n    }<br \/>\n    if (pa != null) {<br \/>\n      if (('' + pa.split(',').length) == '3') {<br \/>\n        document.getElementById('rotation').name='args';<br \/>\n        document.getElementById('rotation').value=pa;<br \/>\n      } else {<br \/>\n        document.getElementById('rotation').name='arg1';<br \/>\n        document.getElementById('rotation').value=pa;<br \/>\n      }<br \/>\n    } else {<br \/>\n      document.getElementById('rotation').name='rotation';<br \/>\n      document.getElementById('rotation').value='' + document.getElementById('trot').value;<br \/>\n    }<br \/>\n    if (tv.trim().toLowerCase() == 'redo') {<br \/>\n    redo();<br \/>\n    }     \/\/alert(11);<br \/>\n    \/\/}<br \/>\n  }<br \/>\n}<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;<\/p>\n<p> &#8230; turning a &#8220;display useful only&#8221; HTML dropdown element into one whose value is transferred with <font size=1>self-<\/font>navigation to interest the PHP &#8220;recall&#8221; logic &#8230;<\/p>\n<p>&lt;?php<br \/>\n<code><br \/>\n function ourimagecreatefromfile($zfilename) {<br \/>\n    global $div_img, $ext;<br \/>\n      \/\/file_put_contents(\"qwe.qweaa\", $zfilename);<br \/>\n    if (isset($_GET['emboss']) || isset($_POST['emboss'])) {<br \/>\n      \/\/file_put_contents(\"qwe.qwe\", str_replace(' ','+',urldecode($_GET['emboss'])) . str_replace(' ','+',urldecode($_POST['emboss'])) . $zfilename);<br \/>\n      \/\/file_put_contents(\"qwe.qwex\", $_SERVER['HTTP_REFERER']);<br \/>\n      $jm_php = imagecreatefromstring(ourfile_get_contents(str_replace(' ','+',urldecode($_GET['emboss'])) . str_replace(' ','+',urldecode($_POST['emboss'])) . $zfilename));<br \/>\n      $emboss = getpostmaybe('arg1',array([-2, -1, 0], [-1, 1, 1], [0, 1, 2]));<br \/>\n      \/\/file_put_contents(\"qwe.qwexx\", $_SERVER['HTTP_REFERER']);<br \/>\n     \/\/imageconvolution($jm_php, $emboss, 1, 0);<br \/>\n      imagefilter($jm_php, IMG_FILTER_EMBOSS);<br \/>\n      return $jm_php; \/\/$new_name = 'anewimage0.jpg';<br \/>\n      $nj=0;<br \/>\n      while (file_exists('anewimage' . $nj . '.jpg')) {<br \/>\n        $nj++;<br \/>\n        $new_name = 'anewimage' . $nj . '.jpg';<br \/>\n      }<br \/>\n      imagejpeg($jm_php, $new_name);<br \/>\n      $qpzm='data:image\/jpeg;base64,' . base64_encode(ourfile_get_contents($new_name));<br \/>\n      imagedestroy($jm_php);<br \/>\n      unlink($new_name);<br \/>\n      \/\/file_put_contents(\"qwe.qwez\", $_SERVER['HTTP_REFERER']);<br \/>\n      if (strpos($_SERVER['HTTP_REFERER'], \"\/pdfimageplustext.php\") !== false) {<br \/>\n      \/\/file_put_contents(\"qwe.qwey\", \"&lt;!doctype html&gt;&lt;html&gt;&lt;body onload=\\\" if (parent.document.getElementById('slideshow')) {   parent.document.getElementById('slideshow').value=parent.undobackup('\" . datauriit($qpzm) . \"'); parent.forcescale(); }   \\\"&gt;&lt;\/body&gt;&lt;\/html&gt;\");<br \/>\n       echo \"&lt;!doctype html&gt;&lt;html&gt;&lt;body onload=\\\" if (parent.document.getElementById('slideshow')) {   parent.document.getElementById('slideshow').value=parent.undobackup('\" . datauriit($qpzm) . \"'); parent.forcescale(); }   \\\"&gt;&lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n       exit;<br \/>\n      }<br \/>\n      return $qpzm;<br \/>\n    } else if (isset($_GET['edge']) || isset($_POST['edge'])) {<br \/>\n      $jm_php = imagecreatefromstring(ourfile_get_contents(str_replace(' ','+',urldecode($_GET['edge'])) . str_replace(' ','+',urldecode($_POST['edge'])) . $zfilename));<br \/>\n      $edge_detect = getpostmaybe('arg1',array([-1, -1, -1], [-1, 8, -1], [-1, -1, -1]));<br \/>\n      imageconvolution($jm_php, $edge_detect, 1, 0);<br \/>\n      imageconvolution($jm_php, $edge_detect, 1, 255);<br \/>\n      return $jm_php; \/\/$new_name = 'anewimage0.jpg';<br \/>\n      $nj=0;<br \/>\n      while (file_exists('anewimage' . $nj . '.jpg')) {<br \/>\n        $nj++;<br \/>\n        $new_name = 'anewimage' . $nj . '.jpg';<br \/>\n      }<br \/>\n      imagejpeg($jm_php, $new_name);<br \/>\n      $qpzm='data:image\/jpeg;base64,' . base64_encode(ourfile_get_contents($new_name));<br \/>\n      imagedestroy($jm_php);<br \/>\n      unlink($new_name);<br \/>\n      if (strpos($_SERVER['HTTP_REFERER'], \"\/pdfimageplustext.php\") !== false) {<br \/>\n       echo \"&lt;!doctype html&gt;&lt;html&gt;&lt;body onload=\\\" if (parent.document.getElementById('slideshow')) {   parent.document.getElementById('slideshow').value=parent.undobackup('\" . datauriit($qpzm) . \"'); parent.forcescale(); }   \\\"&gt;&lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n       exit;<br \/>\n      }<br \/>\n      return $qpzm;<br \/>\n    } else if (isset($_GET['negedge']) || isset($_POST['negedge'])) {<br \/>\n      $jm_php = imagecreatefromstring(ourfile_get_contents(str_replace(' ','+',urldecode($_GET['negedge'])) . str_replace(' ','+',urldecode($_POST['negedge'])) . $zfilename));<br \/>\n      $edge_detect = getpostmaybe('arg1',array([-1, -1, -1], [-1, 8, -1], [-1, -1, -1]));<br \/>\n      imageconvolution($jm_php, $edge_detect, 1, 0);<br \/>\n      \/\/imageconvolution($jm_php, $edge_detect, 1, 255);<br \/>\n      return $jm_php; \/\/$new_name = 'anewimage0.jpg';<br \/>\n      $nj=0;<br \/>\n      while (file_exists('anewimage' . $nj . '.jpg')) {<br \/>\n        $nj++;<br \/>\n        $new_name = 'anewimage' . $nj . '.jpg';<br \/>\n      }<br \/>\n      imagejpeg($jm_php, $new_name);<br \/>\n      $qpzm='data:image\/jpeg;base64,' . base64_encode(ourfile_get_contents($new_name));<br \/>\n      imagedestroy($jm_php);<br \/>\n      unlink($new_name);<br \/>\n      if (strpos($_SERVER['HTTP_REFERER'], \"\/pdfimageplustext.php\") !== false) {<br \/>\n       echo \"&lt;!doctype html&gt;&lt;html&gt;&lt;body onload=\\\" if (parent.document.getElementById('slideshow')) {   parent.document.getElementById('slideshow').value=parent.undobackup('\" . datauriit($qpzm) . \"'); parent.forcescale(); }   \\\"&gt;&lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n       exit;<br \/>\n      }<br \/>\n      return $qpzm;<br \/>\n    } else if (isset($_GET['sharpen']) || isset($_POST['sharpen'])) {<br \/>\n      $jm_php = imagecreatefromstring(ourfile_get_contents(str_replace(' ','+',urldecode($_GET['sharpen'])) . str_replace(' ','+',urldecode($_POST['sharpen'])) . $zfilename));<br \/>\n      $sharpen = getpostmaybe('arg1',array([0, -1, 0], [-1, 5, -1], [0, -1, 0]));<br \/>\n      imageconvolution($jm_php, $sharpen, 1, 0);<br \/>\n      return $jm_php; \/\/$new_name = 'anewimage0.jpg';<br \/>\n      $nj=0;<br \/>\n      while (file_exists('anewimage' . $nj . '.jpg')) {<br \/>\n        $nj++;<br \/>\n        $new_name = 'anewimage' . $nj . '.jpg';<br \/>\n      }<br \/>\n      imagejpeg($jm_php, $new_name);<br \/>\n      $qpzm='data:image\/jpeg;base64,' . base64_encode(ourfile_get_contents($new_name));<br \/>\n      imagedestroy($jm_php);<br \/>\n      unlink($new_name);<br \/>\n      if (strpos($_SERVER['HTTP_REFERER'], \"\/pdfimageplustext.php\") !== false) {<br \/>\n       echo \"&lt;!doctype html&gt;&lt;html&gt;&lt;body onload=\\\" if (parent.document.getElementById('slideshow')) {   parent.document.getElementById('slideshow').value=parent.undobackup('\" . datauriit($qpzm) . \"'); parent.forcescale(); }   \\\"&gt;&lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n       exit;<br \/>\n      }<br \/>\n      return $qpzm;<br \/>\n    } else if (isset($_GET['boxblur']) || isset($_POST['boxblur'])) {<br \/>\n      $jm_php = imagecreatefromstring(ourfile_get_contents(str_replace(' ','+',urldecode($_GET['boxblur'])) . str_replace(' ','+',urldecode($_POST['boxblur'])) . $zfilename));<br \/>\n      $box_blur = getpostmaybe('arg1',array([1, 1, 1], [1, 1, 1], [1, 1, 1]));<br \/>\n      imageconvolution($jm_php, $box_blur, 9, 0);<br \/>\n      return $jm_php; \/\/$new_name = 'anewimage0.jpg';<br \/>\n      $nj=0;<br \/>\n      while (file_exists('anewimage' . $nj . '.jpg')) {<br \/>\n        $nj++;<br \/>\n        $new_name = 'anewimage' . $nj . '.jpg';<br \/>\n      }<br \/>\n      imagejpeg($jm_php, $new_name);<br \/>\n      $qpzm='data:image\/jpeg;base64,' . base64_encode(ourfile_get_contents($new_name));<br \/>\n      imagedestroy($jm_php);<br \/>\n      unlink($new_name);<br \/>\n      if (strpos($_SERVER['HTTP_REFERER'], \"\/pdfimageplustext.php\") !== false) {<br \/>\n       echo \"&lt;!doctype html&gt;&lt;html&gt;&lt;body onload=\\\" if (parent.document.getElementById('slideshow')) {   parent.document.getElementById('slideshow').value=parent.undobackup('\" . datauriit($qpzm) . \"'); parent.forcescale(); }   \\\"&gt;&lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n       exit;<br \/>\n      }<br \/>\n      return $qpzm;<br \/>\n    } else if (isset($_GET['grayscale']) || isset($_POST['grayscale'])) {<br \/>\n      $jm_php = imagecreatefromstring(ourfile_get_contents(str_replace(' ','+',urldecode($_GET['grayscale'])) . str_replace(' ','+',urldecode($_POST['grayscale'])) . $zfilename));<br \/>\n      imagefilter($jm_php, IMG_FILTER_GRAYSCALE);<br \/>\n      return $jm_php; \/\/$new_name = 'anewimage0.jpg';<br \/>\n      $nj=0;<br \/>\n      while (file_exists('anewimage' . $nj . '.jpg')) {<br \/>\n        $nj++;<br \/>\n        $new_name = 'anewimage' . $nj . '.jpg';<br \/>\n      }<br \/>\n      imagejpeg($jm_php, $new_name);<br \/>\n      $qpzm='data:image\/jpeg;base64,' . base64_encode(ourfile_get_contents($new_name));<br \/>\n      imagedestroy($jm_php);<br \/>\n      unlink($new_name);<br \/>\n      if (strpos($_SERVER['HTTP_REFERER'], \"\/pdfimageplustext.php\") !== false) {<br \/>\n       echo \"&lt;!doctype html&gt;&lt;html&gt;&lt;body onload=\\\" if (parent.document.getElementById('slideshow')) {   parent.document.getElementById('slideshow').value=parent.undobackup('\" . datauriit($qpzm) . \"'); parent.forcescale(); }   \\\"&gt;&lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n       exit;<br \/>\n      }<br \/>\n      return $qpzm;<br \/>\n    } else if (isset($_GET['gaussianianblur']) || isset($_POST['gaussianblur'])) {<br \/>\n      $jm_php = imagecreatefromstring(ourfile_get_contents(str_replace(' ','+',urldecode($_GET['gaussianblur'])) . str_replace(' ','+',urldecode($_POST['gaussianblur'])) . $zfilename));<br \/>\n      imagefilter($jm_php, IMG_FILTER_GAUSSIAN_BLUR);<br \/>\n      return $jm_php; \/\/$new_name = 'anewimage0.jpg';<br \/>\n      $nj=0;<br \/>\n      while (file_exists('anewimage' . $nj . '.jpg')) {<br \/>\n        $nj++;<br \/>\n        $new_name = 'anewimage' . $nj . '.jpg';<br \/>\n      }<br \/>\n      imagejpeg($jm_php, $new_name);<br \/>\n      $qpzm='data:image\/jpeg;base64,' . base64_encode(ourfile_get_contents($new_name));<br \/>\n      imagedestroy($jm_php);<br \/>\n      unlink($new_name);<br \/>\n      if (strpos($_SERVER['HTTP_REFERER'], \"\/pdfimageplustext.php\") !== false) {<br \/>\n       echo \"&lt;!doctype html&gt;&lt;html&gt;&lt;body onload=\\\" if (parent.document.getElementById('slideshow')) {   parent.document.getElementById('slideshow').value=parent.undobackup('\" . datauriit($qpzm) . \"'); parent.forcescale(); }   \\\"&gt;&lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n       exit;<br \/>\n      }<br \/>\n      return $qpzm;<br \/>\n    } else if (isset($_GET['selectiveblur']) || isset($_POST['selectiveblur'])) {<br \/>\n<br \/>\n      $jm_php = imagecreatefromstring(ourfile_get_contents(str_replace(' ','+',urldecode($_GET['selectiveblur'])) . str_replace(' ','+',urldecode($_POST['selectiveblur'])) . $zfilename));<br \/>\n      imagefilter($jm_php, IMG_FILTER_SELECTIVE_BLUR);<br \/>\n      return $jm_php; \/\/$new_name = 'anewimage0.jpg';<br \/>\n      $nj=0;<br \/>\n      while (file_exists('anewimage' . $nj . '.jpg')) {<br \/>\n        $nj++;<br \/>\n        $new_name = 'anewimage' . $nj . '.jpg';<br \/>\n      }<br \/>\n      imagejpeg($jm_php, $new_name);<br \/>\n      $qpzm='data:image\/jpeg;base64,' . base64_encode(ourfile_get_contents($new_name));<br \/>\n      imagedestroy($jm_php);<br \/>\n      unlink($new_name);<br \/>\n      if (strpos($_SERVER['HTTP_REFERER'], \"\/pdfimageplustext.php\") !== false) {<br \/>\n       echo \"&lt;!doctype html&gt;&lt;html&gt;&lt;body onload=\\\" if (parent.document.getElementById('slideshow')) {   parent.document.getElementById('slideshow').value=parent.undobackup('\" . datauriit($qpzm) . \"'); parent.forcescale(); }   \\\"&gt;&lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n       exit;<br \/>\n      }<br \/>\n      return $qpzm;<br \/>\n<br \/>\n    } else if (isset($_GET['negate']) || isset($_POST['negate'])) {<br \/>\n      $jm_php = imagecreatefromstring(ourfile_get_contents(str_replace(' ','+',urldecode($_GET['negate'])) . str_replace(' ','+',urldecode($_POST['negate'])) . $zfilename));<br \/>\n      imagefilter($jm_php, IMG_FILTER_NEGATE);<br \/>\n      return $jm_php; \/\/$new_name = 'anewimage0.jpg';<br \/>\n      $nj=0;<br \/>\n      while (file_exists('anewimage' . $nj . '.jpg')) {<br \/>\n        $nj++;<br \/>\n        $new_name = 'anewimage' . $nj . '.jpg';<br \/>\n      }<br \/>\n      imagejpeg($jm_php, $new_name);<br \/>\n      $qpzm='data:image\/jpeg;base64,' . base64_encode(ourfile_get_contents($new_name));<br \/>\n      imagedestroy($jm_php);<br \/>\n      unlink($new_name);<br \/>\n      if (strpos($_SERVER['HTTP_REFERER'], \"\/pdfimageplustext.php\") !== false) {<br \/>\n       echo \"&lt;!doctype html&gt;&lt;html&gt;&lt;body onload=\\\" if (parent.document.getElementById('slideshow')) {   parent.document.getElementById('slideshow').value=parent.undobackup('\" . datauriit($qpzm) . \"'); parent.forcescale(); }   \\\"&gt;&lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n       exit;<br \/>\n      }<br \/>\n      return $qpzm;<br \/>\n    } else if (isset($_GET['colourizered']) || isset($_POST['colourizered']) || isset($_GET['colorizered']) || isset($_POST['colorizered'])) {<br \/>\n      $jm_php = imagecreatefromstring(ourfile_get_contents(str_replace(' ','+',urldecode($_GET['colourizered'])) . str_replace(' ','+',urldecode($_POST['colourizered'])) . $zfilename));<br \/>\n      imagefilter($jm_php, IMG_FILTER_COLORIZE, getpostmaybe('arg1',rand(0,255)), 0, 0); \/\/, 100);<br \/>\n      return $jm_php; \/\/$new_name = 'anewimage0.jpg';<br \/>\n      $nj=0;<br \/>\n      while (file_exists('anewimage' . $nj . '.jpg')) {<br \/>\n        $nj++;<br \/>\n        $new_name = 'anewimage' . $nj . '.jpg';<br \/>\n      }<br \/>\n      imagejpeg($jm_php, $new_name);<br \/>\n      $qpzm='data:image\/jpeg;base64,' . base64_encode(ourfile_get_contents($new_name));<br \/>\n      imagedestroy($jm_php);<br \/>\n      unlink($new_name);<br \/>\n      if (strpos($_SERVER['HTTP_REFERER'], \"\/pdfimageplustext.php\") !== false) {<br \/>\n       echo \"&lt;!doctype html&gt;&lt;html&gt;&lt;body onload=\\\" if (parent.document.getElementById('slideshow')) {   parent.document.getElementById('slideshow').value=parent.undobackup('\" . datauriit($qpzm) . \"'); parent.forcescale(); }   \\\"&gt;&lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n       exit;<br \/>\n      }<br \/>\n      return $qpzm;<br \/>\n    } else if (isset($_GET['colourizegreen']) || isset($_POST['colourizegreen']) || isset($_GET['colorizegreen']) || isset($_POST['colorizegreen'])) {<br \/>\n      $jm_php = imagecreatefromstring(ourfile_get_contents(str_replace(' ','+',urldecode($_GET['colourizegreen'])) . str_replace(' ','+',urldecode($_POST['colourizegreen'])) . $zfilename));<br \/>\n      imagefilter($jm_php, IMG_FILTER_COLORIZE, 0, getpostmaybe('arg1',rand(0,255)), 0); \/\/, 100);<br \/>\n      return $jm_php; \/\/$new_name = 'anewimage0.jpg';<br \/>\n      $nj=0;<br \/>\n      while (file_exists('anewimage' . $nj . '.jpg')) {<br \/>\n        $nj++;<br \/>\n        $new_name = 'anewimage' . $nj . '.jpg';<br \/>\n      }<br \/>\n      imagejpeg($jm_php, $new_name);<br \/>\n      $qpzm='data:image\/jpeg;base64,' . base64_encode(ourfile_get_contents($new_name));<br \/>\n      imagedestroy($jm_php);<br \/>\n      unlink($new_name);<br \/>\n      if (strpos($_SERVER['HTTP_REFERER'], \"\/pdfimageplustext.php\") !== false) {<br \/>\n       echo \"&lt;!doctype html&gt;&lt;html&gt;&lt;body onload=\\\" if (parent.document.getElementById('slideshow')) {   parent.document.getElementById('slideshow').value=parent.undobackup('\" . datauriit($qpzm) . \"'); parent.forcescale(); }   \\\"&gt;&lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n       exit;<br \/>\n      }<br \/>\n      return $qpzm;<br \/>\n    } else if (isset($_GET['colourize']) || isset($_POST['colourize']) || isset($_GET['colorize']) || isset($_POST['colorize'])) {<br \/>\n      $jm_php = imagecreatefromstring(ourfile_get_contents(str_replace(' ','+',urldecode($_GET['colourize'])) . str_replace(' ','+',urldecode($_POST['colourize'])) . $zfilename));<br \/>\n      imagefilter($jm_php, IMG_FILTER_COLORIZE, getpostmaybe('arg1',rand(0, 255)), getpostmaybe('arg2',rand(0, 255)), getpostmaybe('arg3',rand(0, 255))); \/\/, 100);<br \/>\n      return $jm_php; \/\/$new_name = 'anewimage0.jpg';<br \/>\n      $nj=0;<br \/>\n      while (file_exists('anewimage' . $nj . '.jpg')) {<br \/>\n        $nj++;<br \/>\n        $new_name = 'anewimage' . $nj . '.jpg';<br \/>\n      }<br \/>\n      imagejpeg($jm_php, $new_name);<br \/>\n      $qpzm='data:image\/jpeg;base64,' . base64_encode(ourfile_get_contents($new_name));<br \/>\n      imagedestroy($jm_php);<br \/>\n      unlink($new_name);<br \/>\n      if (strpos($_SERVER['HTTP_REFERER'], \"\/pdfimageplustext.php\") !== false) {<br \/>\n       echo \"&lt;!doctype html&gt;&lt;html&gt;&lt;body onload=\\\" if (parent.document.getElementById('slideshow')) {   parent.document.getElementById('slideshow').value=parent.undobackup('\" . datauriit($qpzm) . \"'); parent.forcescale(); }   \\\"&gt;&lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n       exit;<br \/>\n      }<br \/>\n      return $qpzm;<br \/>\n    } else if (isset($_GET['colourizeblue']) || isset($_POST['colourizeblue']) || isset($_GET['colorizeblue']) || isset($_POST['colorizeblue'])) {<br \/>\n      $jm_php = imagecreatefromstring(ourfile_get_contents(str_replace(' ','+',urldecode($_GET['colourizeblue'])) . str_replace(' ','+',urldecode($_POST['colourizeblue'])) . $zfilename));<br \/>\n      imagefilter($jm_php, IMG_FILTER_COLORIZE, 0, 0, getpostmaybe('arg1',rand(0,255))); \/\/, 100);<br \/>\n      return $jm_php; \/\/$new_name = 'anewimage0.jpg';<br \/>\n      $nj=0;<br \/>\n      while (file_exists('anewimage' . $nj . '.jpg')) {<br \/>\n        $nj++;<br \/>\n        $new_name = 'anewimage' . $nj . '.jpg';<br \/>\n      }<br \/>\n      imagejpeg($jm_php, $new_name);<br \/>\n      $qpzm='data:image\/jpeg;base64,' . base64_encode(ourfile_get_contents($new_name));<br \/>\n      imagedestroy($jm_php);<br \/>\n      unlink($new_name);<br \/>\n      if (strpos($_SERVER['HTTP_REFERER'], \"\/pdfimageplustext.php\") !== false) {<br \/>\n       echo \"&lt;!doctype html&gt;&lt;html&gt;&lt;body onload=\\\" if (parent.document.getElementById('slideshow')) {   parent.document.getElementById('slideshow').value=parent.undobackup('\" . datauriit($qpzm) . \"'); parent.forcescale(); }   \\\"&gt;&lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n       exit;<br \/>\n      }<br \/>\n      return $qpzm;<br \/>\n    } else if (isset($_GET['pixellate']) || isset($_POST['pixellate']) || isset($_GET['pixelate']) || isset($_POST['pixelate']))  {<br \/>\n      $jm_php = imagecreatefromstring(ourfile_get_contents(str_replace(' ','+',urldecode($_GET['pixellate'])) . str_replace(' ','+',urldecode($_POST['pixellate'])) . $zfilename));<br \/>\n      imagefilter($jm_php, IMG_FILTER_PIXELATE, getpostmaybe('arg1',rand(1, 9))); \/\/ was 3<br \/>\n      return $jm_php; \/\/$new_name = 'anewimage0.jpg';<br \/>\n      $nj=0;<br \/>\n      while (file_exists('anewimage' . $nj . '.jpg')) {<br \/>\n        $nj++;<br \/>\n        $new_name = 'anewimage' . $nj . '.jpg';<br \/>\n      }<br \/>\n      imagejpeg($jm_php, $new_name);<br \/>\n      $qpzm='data:image\/jpeg;base64,' . base64_encode(ourfile_get_contents($new_name));<br \/>\n      imagedestroy($jm_php);<br \/>\n      unlink($new_name);<br \/>\n      if (strpos($_SERVER['HTTP_REFERER'], \"\/pdfimageplustext.php\") !== false) {<br \/>\n       echo \"&lt;!doctype html&gt;&lt;html&gt;&lt;body onload=\\\" if (parent.document.getElementById('slideshow')) {   parent.document.getElementById('slideshow').value=parent.undobackup('\" . datauriit($qpzm) . \"'); parent.forcescale(); }   \\\"&gt;&lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n       exit;<br \/>\n      }<br \/>\n      return $qpzm;<br \/>\n    } else if (isset($_GET['smooth']) || isset($_POST['smooth'])) {<br \/>\n      $jm_php = imagecreatefromstring(ourfile_get_contents(str_replace(' ','+',urldecode($_GET['smooth'])) . str_replace(' ','+',urldecode($_POST['smooth'])) . $zfilename));<br \/>\n      imagefilter($jm_php, IMG_FILTER_SMOOTH, getpostmaybe('arg1',rand(5, 35)));  \/\/ was -1924.124<br \/>\n      return $jm_php; \/\/$new_name = 'anewimage0.jpg';<br \/>\n      $nj=0;<br \/>\n      while (file_exists('anewimage' . $nj . '.jpg')) {<br \/>\n        $nj++;<br \/>\n        $new_name = 'anewimage' . $nj . '.jpg';<br \/>\n      }<br \/>\n      imagejpeg($jm_php, $new_name);<br \/>\n      $qpzm='data:image\/jpeg;base64,' . base64_encode(ourfile_get_contents($new_name));<br \/>\n      imagedestroy($jm_php);<br \/>\n      unlink($new_name);<br \/>\n      if (strpos($_SERVER['HTTP_REFERER'], \"\/pdfimageplustext.php\") !== false) {<br \/>\n       echo \"&lt;!doctype html&gt;&lt;html&gt;&lt;body onload=\\\" if (parent.document.getElementById('slideshow')) {   parent.document.getElementById('slideshow').value=parent.undobackup('\" . datauriit($qpzm) . \"'); parent.forcescale(); }   \\\"&gt;&lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n       exit;<br \/>\n      }<br \/>\n      return $qpzm;<br \/>\n    } else if (isset($_GET['contrast']) || isset($_POST['contrast'])) {<br \/>\n      $jm_php = imagecreatefromstring(ourfile_get_contents(str_replace(' ','+',urldecode($_GET['contrast'])) . str_replace(' ','+',urldecode($_POST['contrast'])) . $zfilename));<br \/>\n      imagefilter($jm_php, IMG_FILTER_CONTRAST, getpostmaybe('arg1',rand(-100, 100))); \/\/ was -90<br \/>\n      return $jm_php; \/\/$new_name = 'anewimage0.jpg';<br \/>\n      $nj=0;<br \/>\n      while (file_exists('anewimage' . $nj . '.jpg')) {<br \/>\n        $nj++;<br \/>\n        $new_name = 'anewimage' . $nj . '.jpg';<br \/>\n      }<br \/>\n      imagejpeg($jm_php, $new_name);<br \/>\n      $qpzm='data:image\/jpeg;base64,' . base64_encode(ourfile_get_contents($new_name));<br \/>\n      imagedestroy($jm_php);<br \/>\n      unlink($new_name);<br \/>\n      if (strpos($_SERVER['HTTP_REFERER'], \"\/pdfimageplustext.php\") !== false) {<br \/>\n       echo \"&lt;!doctype html&gt;&lt;html&gt;&lt;body onload=\\\" if (parent.document.getElementById('slideshow')) {   parent.document.getElementById('slideshow').value=parent.undobackup('\" . datauriit($qpzm) . \"'); parent.forcescale(); }   \\\"&gt;&lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n       exit;<br \/>\n      }<br \/>\n      return $qpzm;<br \/>\n    } else if (isset($_GET['brightness']) || isset($_POST['brightness'])) {<br \/>\n      $jm_php = imagecreatefromstring(ourfile_get_contents(str_replace(' ','+',urldecode($_GET['brightness'])) . str_replace(' ','+',urldecode($_POST['brightness'])) . $zfilename));<br \/>\n      imagefilter($jm_php, IMG_FILTER_BRIGHTNESS, getpostmaybe('arg1',rand(-255, 255))); \/\/ was 98<br \/>\n      return $jm_php; \/\/$new_name = 'anewimage0.jpg';<br \/>\n      $nj=0;<br \/>\n      while (file_exists('anewimage' . $nj . '.jpg')) {<br \/>\n        $nj++;<br \/>\n        $new_name = 'anewimage' . $nj . '.jpg';<br \/>\n      }<br \/>\n      imagejpeg($jm_php, $new_name);<br \/>\n      $qpzm='data:image\/jpeg;base64,' . base64_encode(ourfile_get_contents($new_name));<br \/>\n      imagedestroy($jm_php);<br \/>\n      unlink($new_name);<br \/>\n      if (strpos($_SERVER['HTTP_REFERER'], \"\/pdfimageplustext.php\") !== false) {<br \/>\n       echo \"&lt;!doctype html&gt;&lt;html&gt;&lt;body onload=\\\" if (parent.document.getElementById('slideshow')) {   parent.document.getElementById('slideshow').value=parent.undobackup('\" . datauriit($qpzm) . \"'); parent.forcescale(); }   \\\"&gt;&lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n       exit;<br \/>\n      }<br \/>\n      return $qpzm;<br \/>\n    } else if (isset($_GET['sketchy']) || isset($_POST['sketchy']) || isset($_GET['mean_removal']) || isset($_POST['mean_removal']) || isset($_GET['mean-removal']) || isset($_POST['mean-removal']))  {<br \/>\n      $jm_php = imagecreatefromstring(ourfile_get_contents(str_replace(' ','+',urldecode($_GET['sketchy'])) . str_replace(' ','+',urldecode($_POST['sketchy'])) . $zfilename));<br \/>\n      imagefilter($jm_php, IMG_FILTER_MEAN_REMOVAL);<br \/>\n      return $jm_php; \/\/$new_name = 'anewimage0.jpg';<br \/>\n      $nj=0;<br \/>\n      while (file_exists('anewimage' . $nj . '.jpg')) {<br \/>\n        $nj++;<br \/>\n        $new_name = 'anewimage' . $nj . '.jpg';<br \/>\n      }<br \/>\n      imagejpeg($jm_php, $new_name);<br \/>\n      $qpzm='data:image\/jpeg;base64,' . base64_encode(ourfile_get_contents($new_name));<br \/>\n      imagedestroy($jm_php);<br \/>\n      unlink($new_name);<br \/>\n      if (strpos($_SERVER['HTTP_REFERER'], \"\/pdfimageplustext.php\") !== false) {<br \/>\n       echo \"&lt;!doctype html&gt;&lt;html&gt;&lt;body onload=\\\" if (parent.document.getElementById('slideshow')) {   parent.document.getElementById('slideshow').value=parent.undobackup('\" . datauriit($qpzm) . \"'); parent.forcescale(); }   \\\"&gt;&lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n       exit;<br \/>\n      }<br \/>\n      return $qpzm;<br \/>\n    } else if (isset($_GET['flipvertical']) || isset($_POST['flipvertical'])) {<br \/>\n      $jm_php = imagecreatefromstring(ourfile_get_contents(str_replace(' ','+',urldecode($_GET['flipvertical'])) . str_replace(' ','+',urldecode($_POST['flipvertical'])) . $zfilename));<br \/>\n      $jm_php=ourImageFlip($jm_php, '1'); \/\/imageflip($jm_php, IMG_FLIP_VERTICAL);<br \/>\n      return $jm_php; \/\/$new_name = 'anewimage0.jpg';<br \/>\n      $nj=0;<br \/>\n      while (file_exists('anewimage' . $nj . '.jpg')) {<br \/>\n        $nj++;<br \/>\n        $new_name = 'anewimage' . $nj . '.jpg';<br \/>\n      }<br \/>\n      imagejpeg($jm_php, $new_name);<br \/>\n      $qpzm='data:image\/jpeg;base64,' . base64_encode(ourfile_get_contents($new_name));<br \/>\n      imagedestroy($jm_php);<br \/>\n      unlink($new_name);<br \/>\n      if (strpos($_SERVER['HTTP_REFERER'], \"\/pdfimageplustext.php\") !== false) {<br \/>\n       echo \"&lt;!doctype html&gt;&lt;html&gt;&lt;body onload=\\\" if (parent.document.getElementById('slideshow')) {   parent.document.getElementById('slideshow').value=parent.undobackup('\" . datauriit($qpzm) . \"'); parent.forcescale(); }   \\\"&gt;&lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n       exit;<br \/>\n      }<br \/>\n      return $qpzm;<br \/>\n    } else if (isset($_GET['fliphorizontal']) || isset($_POST['fliphorizontal'])) {<br \/>\n      $jm_php = imagecreatefromstring(ourfile_get_contents(str_replace(' ','+',urldecode($_GET['fliphorizontal'])) . str_replace(' ','+',urldecode($_POST['fliphorizontal'])) . $zfilename));<br \/>\n      $jm_php=ourImageFlip($jm_php, '2'); \/\/imageflip($jm_php, IMG_FLIP_HORIZONTAL);<br \/>\n      return $jm_php; \/\/$new_name = 'anewimage0.jpg';<br \/>\n      $nj=0;<br \/>\n      while (file_exists('anewimage' . $nj . '.jpg')) {<br \/>\n        $nj++;<br \/>\n        $new_name = 'anewimage' . $nj . '.jpg';<br \/>\n      }<br \/>\n      imagejpeg($jm_php, $new_name);<br \/>\n      $qpzm='data:image\/jpeg;base64,' . base64_encode(ourfile_get_contents($new_name));<br \/>\n      imagedestroy($jm_php);<br \/>\n      unlink($new_name);<br \/>\n      if (strpos($_SERVER['HTTP_REFERER'], \"\/pdfimageplustext.php\") !== false) {<br \/>\n       echo \"&lt;!doctype html&gt;&lt;html&gt;&lt;body onload=\\\" if (parent.document.getElementById('slideshow')) {   parent.document.getElementById('slideshow').value=parent.undobackup('\" . datauriit($qpzm) . \"'); parent.forcescale(); }   \\\"&gt;&lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n       exit;<br \/>\n      }<br \/>\n      return $qpzm;<br \/>\n    } else if (isset($_GET['flip']) || isset($_POST['flip'])) {<br \/>\n      $jm_php = imagecreatefromstring(ourfile_get_contents(str_replace(' ','+',urldecode($_GET['flip'])) . str_replace(' ','+',urldecode($_POST['flip'])) . $zfilename));<br \/>\n      $jm_php=ourImageFlip($jm_php, '3'); \/\/imageflip($jm_php, IMG_FLIP_BOTH);<br \/>\n      return $jm_php; \/\/$new_name = 'anewimage0.jpg';<br \/>\n      $nj=0;<br \/>\n      while (file_exists('anewimage' . $nj . '.jpg')) {<br \/>\n        $nj++;<br \/>\n        $new_name = 'anewimage' . $nj . '.jpg';<br \/>\n      }<br \/>\n      imagejpeg($jm_php, $new_name);<br \/>\n      $qpzm='data:image\/jpeg;base64,' . base64_encode(ourfile_get_contents($new_name));<br \/>\n      imagedestroy($jm_php);<br \/>\n      unlink($new_name);<br \/>\n      if (strpos($_SERVER['HTTP_REFERER'], \"\/pdfimageplustext.php\") !== false) {<br \/>\n       echo \"&lt;!doctype html&gt;&lt;html&gt;&lt;body onload=\\\" if (parent.document.getElementById('slideshow')) {   parent.document.getElementById('slideshow').value=parent.undobackup('\" . datauriit($qpzm) . \"'); parent.forcescale(); }   \\\"&gt;&lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n       exit;<br \/>\n      }<br \/>\n      return $qpzm;<br \/>\n    } else if (isset($_GET['rotation']) || isset($_POST['rotation'])) {<br \/>\n      \/\/file_put_contents(\"qwe.qwe1\", $zfilename);<br \/>\n      $jm_php = imagecreatefromstring(ourfile_get_contents(str_replace(' ','+',urldecode($_GET['flip'])) . str_replace(' ','+',urldecode($_POST['flip'])) . $zfilename));<br \/>\n      \/\/file_put_contents(\"qwe.qwe2\", $zfilename);<br \/>\n      if (isset($_GET['rotation'])) {<br \/>\n      $iim_php=imagerotate($jm_php, floatval(trim(str_replace('+',' ',urldecode($_GET['rotation'])))), 0);<br \/>\n      } else if (isset($_POST['rotation'])) {<br \/>\n      \/\/file_put_contents(\"qwe.qwe3\", '' . (trim(str_replace('+',' ',urldecode($_POST['rotation'])))));<br \/>\n      $iim_php=imagerotate($jm_php, floatval(trim(str_replace('+',' ',urldecode($_POST['rotation'])))), 0);<br \/>\n      \/\/file_put_contents(\"qwe.qwe4\", '' . floatval(trim(str_replace('+',' ',urldecode($_POST['rotation'])))));<br \/>\n      } else {<br \/>\n      $iim_php=imagerotate($jm_php, 0.0, 0);<br \/>\n      }<br \/>\n      \/\/file_put_contents(\"qwe.qwe5\", $zfilename);<br \/>\n      return $jm_php; \/\/$new_name = 'anewimage0.jpg';<br \/>\n      $nj=0;<br \/>\n      while (file_exists('anewimage' . $nj . '.jpg')) {<br \/>\n        $nj++;<br \/>\n        $new_name = 'anewimage' . $nj . '.jpg';<br \/>\n      }<br \/>\n      \/\/file_put_contents(\"qwe.qwe6\", $zfilename);<br \/>\n      imagejpeg($iim_php, $new_name);<br \/>\n      \/\/file_put_contents(\"qwe.qwe7\", $zfilename);<br \/>\n      $qpzm='data:image\/jpeg;base64,' . base64_encode(ourfile_get_contents($new_name));<br \/>\n      \/\/file_put_contents(\"qwe.qwe8\", $zfilename);<br \/>\n      imagedestroy($jm_php);<br \/>\n      imagedestroy($iim_php);<br \/>\n      \/\/file_put_contents(\"qwe.qwe9\", $zfilename);<br \/>\n      unlink($new_name);<br \/>\n      if (strpos($_SERVER['HTTP_REFERER'], \"\/pdfimageplustext.php\") !== false) {<br \/>\n       echo \"&lt;!doctype html&gt;&lt;html&gt;&lt;body onload=\\\" if (parent.document.getElementById('slideshow')) {   parent.document.getElementById('slideshow').value=parent.undobackup('\" . datauriit($qpzm) . \"'); parent.forcescale(); }   \\\"&gt;&lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n       exit;<br \/>\n      }<br \/>\n      return $qpzm;<br \/>\n    }<br \/>\n    return imagecreatefromstring(file_get_contents($zfilename)); \/\/ 'data:image\/' . substr($ext,1) . \";base64,\" . base64_encode(ourfile_get_contents($zfilename));<br \/>\n }<br \/>\n<\/code><br \/>\n?&gt;<\/p>\n<p> &#8230; PHP code that may be familiar looking to readers of our recent <a target=\"_blank\" title='PDF Image and Text Nodes Windows Files Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/pdf-image-and-text-nodes-windows-files-tutorial' rel=\"noopener\">PDF Image and Text Nodes Windows Files Tutorial<\/a> thread of blog postings.   Feel free to try <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/convert_wildcard.php-GETME\" title='convert_wildcard.php' rel=\"noopener\">the changed<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/convert_wildcard.php-GETME\" title='convert_wildcard.php' rel=\"noopener\">convert_wildcard.php<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/convert_wildcard.php\" title='convert_wildcard.php' rel=\"noopener\">PHP web application<\/a> you can also <a href='#ific'>try below<\/a>.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=\"_blank\" href='\/\/www.rjmprogramming.com.au\/ITblog\/image-conversions-via-php-gd-filters-tutorial\/' rel=\"noopener\">Image Conversions via PHP GD Filters Tutorial<\/a>.<\/p-->\n<hr>\n<p id='icphpgdpt'>Previous relevant <a target=\"_blank\" title='Image Conversions via PHP GD Primer Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/image-conversions-via-php-gd-primer-tutorial\/' rel=\"noopener\">Image Conversions via PHP GD Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/convert_wildcard.php\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Image Conversions via PHP GD Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/convert_wildcard.jpg\" title=\"Image Conversions via PHP GD Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Image Conversions via PHP GD Primer Tutorial<\/p><\/div>\n<p>Regular readers at this place will know about our admiration for <a target=\"_blank\" title='ImageMagick command line' href='http:\/\/www.imagemagick.org\/script\/command-line-tools.php' rel=\"noopener\">ImageMagick<\/a> and its command line (&#8220;convert&#8221; for macOS and Linux and &#8220;magick.exe&#8221; for Windows) image conversion functionality.  Even so, ImageMagick is not capable of &#8230;<\/p>\n<p><code><br \/>\nconvert filespec*.*g* *.jpeg<br \/>\n<\/code><\/p>\n<p> &#8230; type of image conversion, in bulk, kind of processing <font size=1>(which <a target=\"_blank\" href='http:\/\/www.gimp.org' title='Gimp, or GIMP' rel=\"noopener\">Gimp<\/a> offered with its sadly departed Bimp conversion software in the past)<\/font>.  But tailored PHP use of the <a target=\"_blank\" title='PHP GD' href='https:\/\/www.php.net\/manual\/en\/function.gd-info.php' rel=\"noopener\">GD<\/a> (image manipulation) library, helped out by <font size=1>(good ol&#8217;)<\/font> PHP <a target=\"_blank\" title='PHP glob method information' href='http:\/\/php.net\/manual\/en\/function.glob.php' rel=\"noopener\">glob<\/a>, is!<\/p>\n<p>And so, we&#8217;ve written a &#8220;proof of concept&#8221; converter that you can run at the RJM Programming domain, but we&#8217;d recommend for use with an Apache\/PHP local web server like <a target=\"_blank\" title='MAMP for Apache\/PHP\/MySql on Mac OS X local web server' href='http:\/\/www.mamp.info' rel=\"noopener\">MAMP<\/a> is!  (Two in one blog posting is a record &#8230; is!)<\/p>\n<p>Get into MAMP, and you might want to download <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/convert_wildcard.php_GETME\" title='convert_wildcard.php' rel=\"noopener\">convert_wildcard.php<\/a> PHP source code to MAMP&#8217;s Document Root folder.  Else, <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/convert_wildcard.php\" title=\"Click picture\" rel=\"noopener\">try it here<\/a> or below &#8230;<\/p>\n<p><iframe id=ific src=\"http:\/\/www.rjmprogramming.com.au\/convert_wildcard.php\" style=\"width:100%;height:800px;\"><\/iframe><\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d57187' onclick='var dv=document.getElementById(\"d57187\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/download\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d57187' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d57195' onclick='var dv=document.getElementById(\"d57195\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/filter\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d57195' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d57214' onclick='var dv=document.getElementById(\"d57214\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/command-line\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d57214' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d57229' onclick='var dv=document.getElementById(\"d57229\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/curl\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d57229' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d57239' onclick='var dv=document.getElementById(\"d57239\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/tick\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d57239' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d57264' onclick='var dv=document.getElementById(\"d57264\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/transparency\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d57264' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d67191' onclick='var dv=document.getElementById(\"d67191\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/url\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d67191' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d67210' onclick='var dv=document.getElementById(\"d67210\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/browse\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d67210' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>As well as the recent Image Conversions via PHP GD URL Tutorial&#8216;s input data modes of use &#8230; relative URLs (to the RJM Programming domain) &#8230; and we see why we may have left this like this &#8230; we wanted &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/image-conversions-via-php-gd-browsing-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,14,37],"tags":[2915,2824,52,85,1835,112,4117,4115,144,2684,1993,3531,4119,229,3533,233,234,2683,263,2650,274,1857,284,1654,327,1750,360,367,384,385,418,419,2671,429,431,432,433,452,1550,491,1615,2440,590,3554,1658,599,652,677,1807,714,744,2281,1830,3861,4060,2092,3220,830,3527,1631,3049,894,896,932,2721,4116,2738,997,3274,1040,1043,1045,1053,1063,1893,1105,1866,1138,3883,1231,1238,4118,1302,1319,2542,1345,1865,3302],"class_list":["post-67210","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-tutorials","tag-_post","tag-absolute","tag-absolute-url","tag-apache","tag-arguments","tag-attribute","tag-backward-compatibility","tag-basename","tag-bimp","tag-brightness","tag-browse","tag-browsing","tag-cartoon","tag-colourize","tag-comma","tag-command","tag-command-line","tag-contrast","tag-conversion","tag-convert","tag-crontab","tag-crop","tag-curl","tag-data-uri","tag-did-you-know","tag-document-root","tag-download","tag-dropdown","tag-emboss","tag-emoji","tag-file","tag-file-api","tag-file-specification","tag-file_get_contents","tag-filter","tag-filtering","tag-filters","tag-form","tag-gd","tag-gimp","tag-glob","tag-grayscale","tag-image","tag-image-url","tag-imagemagick","tag-img","tag-javascript","tag-korn-shell","tag-link","tag-local-web-server","tag-mamp","tag-merge","tag-method","tag-mode","tag-modes-of-use","tag-multiple","tag-navigate","tag-navigation","tag-negate","tag-onchange","tag-open","tag-overlay","tag-paintbrush","tag-php","tag-pixellate","tag-preg_replace","tag-procedure","tag-programming","tag-recall","tag-regex","tag-regular-expression","tag-relative-url","tag-replace","tag-reveal","tag-schedule","tag-script","tag-select","tag-shell","tag-switch","tag-switches","tag-table","tag-tick","tag-transparency","tag-tutorial","tag-type-ahead-buffer","tag-url","tag-verb","tag-wildcard"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/67210"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=67210"}],"version-history":[{"count":6,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/67210\/revisions"}],"predecessor-version":[{"id":67217,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/67210\/revisions\/67217"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=67210"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=67210"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=67210"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}