Numbers Guessing Game
Your Numbers Game
Get
clueYour
answerYour
ScoreClue? Score 0/0
-
Recent Posts
- PHP Exif Quiz Geographicals Tutorial
- PHP Exif Quiz Tutorial
- PHP Exif Retention off iPhone Images Tutorial
- List to Grid Layout CSS Media Query Tutorial
- List to Grid Layout Primer Tutorial
- Out and About WordPress Blog Content Tweaks Just with iPhone Tutorial
- Command Line History By Date Tutorial
- Overseas Travel Global Roaming Mobile Primer Tutorial
Categories
- Ajax
- Android
- Animation
- Anything You Like
- Code::Blocks
- Coding
- Colour Matching
- Data Integration
- Database
- Delphi
- Eclipse
- eLearning
- ESL
- Event-Driven Programming
- Games
- GIMP
- GUI
- Hardware
- Installers
- iOS
- Land Surveying
- Moodle
- Music Poll
- NetBeans
- Networking
- News
- Not Categorised
- OOP
- Operating System
- Photography
- Projects
- Signage Poll
- Software
- SpectroPhotometer
- Tiki Wiki
- Trips
- Tutorials
- Uncategorized
- Visual Studio
- Xcode
Meta
Tags
Ajax animation background button canvas command line CSS Did you know DOM dropdown email emoji event form game Google Google chart hashtag HTML IFRAME image iOS Javascript MAMP media mobile navigation onclick overlay PHP popup programming select share sharing SMS SVG table text textarea tutorial url video web browser webpageYour Background Image
OnTopList
Tag Archives: bimp
Image Conversions via PHP GD Browsing Tutorial
As well as the recent Image Conversions via PHP GD URL Tutorial‘s input data modes of use … relative URLs (to the RJM Programming domain) … and we see why we may have left this like this … we wanted to allow for image file specifications … something quite involved (but might be contemplated in a reduced functionality sense into the future …) regarding the first of two new URL modus operandi additions to functionality, those being … absolute URL single image file … and … image data URI single image … and today we want to add … local image file browsing via the Javascript environment based File API … and as we got this new input mode functionality option going we widened the processing scope in the changed convert_wildcard.php‘s image conversion PHP web application to … offer video creation functionality when several browsed image files are selected … and/or … offer animated GIF creation functionality when several browsed image files are selected The allowance for multiple selection browsing helped out by the changed client_browsing.htm client side HTML and Javascript inhouse helper helped out here. Previous relevant Image Conversions via PHP GD URL Tutorial is shown below. The PHP inhouse Image Converter web application last talked about at Image Conversions via PHP GD Overlay Reveal Tutorial got a revisit today. It’s been more than two years, and that amount of separation sometimes gives you the chance to “go back to square one” and not be caught in amongst the “labyrinth of thought” as you get too far into complex optional logics you might apply to a web application project. 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 … relative URLs (to the RJM Programming domain) … and we see why we may have left this like this … we wanted to allow for image file specifications … something quite involved (but might be contemplated in a reduced functionality sense into the future …) regarding the first of two new URL modus operandi additions to functionality, those being … absolute URL single image file … and … image data URI single image Of course, should the absolute URL web servers allow such access, this opens up whole new vistas of functionality possibility here. Both new URL modus operandi above … Continue reading →
Posted in eLearning, Event-Driven Programming, Tutorials
|
Tagged $_POST, absolute, absolute URL, Apache, arguments, attribute, backward compatibility, basename, bimp, brightness, browse, browsing, cartoon, colourize, comma, command, command line, contrast, conversion, convert, crontab, crop, curl, data uri, Did you know, Document Root, download, dropdown, emboss, emoji, file, file API, file specification, file_get_contents, filter, filtering, filters, form, GD, GIMP, glob, grayscale, image, image URL, ImageMagick, img, Javascript, korn shell, link, local web server, MAMP, merge, method, mode, modes of use, multiple, navigate, navigation, negate, onchange, open, overlay, PaintBrush, PHP, pixellate, preg_replace, procedure, programming, recall, regex, regular expression, relative URL, replace, reveal, schedule, script, select, shell, switch, switches, table, tick, transparency, tutorial, type ahead buffer, url, verb, wildcard
|
Leave a comment
Image Conversions via PHP GD URL Tutorial
The PHP inhouse Image Converter web application last talked about at Image Conversions via PHP GD Overlay Reveal Tutorial got a revisit today. It’s been more than two years, and that amount of separation sometimes gives you the chance to “go back to square one” and not be caught in amongst the “labyrinth of thought” as you get too far into complex optional logics you might apply to a web application project. 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 … relative URLs (to the RJM Programming domain) … and we see why we may have left this like this … we wanted to allow for image file specifications … something quite involved (but might be contemplated in a reduced functionality sense into the future …) regarding the first of two new URL modus operandi additions to functionality, those being … absolute URL single image file … and … image data URI single image Of course, should the absolute URL web servers allow such access, this opens up whole new vistas of functionality possibility here. Both new URL modus operandi above used an HTML iframe (shown along with an HTML form referenced later, also) … <?php echo ” <iframe style=display:none; id=ifi name=ifi src=./convert_wildcard.php></iframe> <form method=POST action=’/convert_wildcard.php’ target=ifi style=display:none;> <input type=hidden name=absimg id=absimg value=”></input><input id=sabsi type=submit value=Submit style=display:none;></input></form> “; ?> … but in two interestingly different ways … well, you had to be there! absolute URL single image file <?php echo ” function lookforabsolute(ino) { if (ino.value.indexOf(‘data:’) == 0 && ino.value.indexOf(‘image/’) != -1) { document.getElementById(‘absimg’).value=ino.value; document.getElementById(‘sabsi’).click(); } else if (ino.value.indexOf(‘//’) != -1) { ino.title=ino.value; document.getElementById(‘ifi’).src=’./convert_wildcard.php?absimg=’ + encodeURIComponent(‘http://’ + ino.value.split(‘//’)[1]); } } “; ?> … meeting up with receiving PHP logic, skeletally … <?php $gabsimg=”; if (isset($_GET[‘absimg’])) { $gabsimg=$_GET[‘absimg’]; } if (isset($_POST[‘absimg’])) { // Perform necessary $_POST scenario populating of $gabsimg } if ($gabsimg != ”) { //isset($_GET[‘absimg’])) { // Perform necessary image URL processing here adjusting parent.document.getElementById(‘ispec’) in the process } ?> image data URI single image <?php echo ” function lookforabsolute(ino) { if (ino.value.indexOf(‘data:’) == 0 && ino.value.indexOf(‘image/’) != -1) { document.getElementById(‘absimg’).value=ino.value; document.getElementById(‘sabsi’).click(); } else if (ino.value.indexOf(‘//’) != -1) { ino.title=ino.value; document.getElementById(‘ifi’).src=’./convert_wildcard.php?absimg=’ + encodeURIComponent(‘http://’ + ino.value.split(‘//’)[1]); } } “; ?> … meeting up with receiving PHP logic, skeletally … <?php $gabsimg=”; if (isset($_GET[‘absimg’])) { // Perform necessary $_GET scenario … Continue reading →
Posted in eLearning, Event-Driven Programming, Tutorials
|
Tagged $_POST, absolute, absolute URL, Apache, arguments, attribute, backward compatibility, basename, bimp, brightness, cartoon, colourize, comma, command, command line, contrast, conversion, convert, crontab, crop, curl, data uri, Did you know, Document Root, download, dropdown, emboss, emoji, file, file specification, file_get_contents, filter, filtering, filters, form, GD, GIMP, glob, grayscale, image, image URL, ImageMagick, img, Javascript, korn shell, link, local web server, MAMP, merge, method, mode, modes of use, multiple, navigate, navigation, negate, onchange, open, overlay, PaintBrush, PHP, pixellate, preg_replace, procedure, programming, recall, regex, regular expression, relative URL, replace, reveal, schedule, script, select, shell, switch, switches, table, tick, transparency, tutorial, type ahead buffer, url, verb, wildcard
|
Leave a comment
Image Conversions via PHP GD Overlay Reveal Tutorial
Around here, we have two words we like to approach the topic of “web design”, where it meets “practicality”, with … reveal overlay And so, onto yesterday’s Image Conversions via PHP GD Multiple Actions Tutorial‘s progress with our Image Conversions via PHP GD web application we were keen to think that an “overlay” 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 “Merge” option as per … Show me “Merge” Image Conversion “Overlay” Idea below … … we found was most feasible with PNG input image files, with transparency. And then, onto yesterday’s Image Conversions via PHP GD Multiple Actions Tutorial‘s progress with our Image Conversions via PHP GD web application we were keen to think that an “reveal” 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 “Merge” option as per … Show me “Merge” Image Conversion “Reveal” Idea below … … we found was most feasible with … PNG input image file(s) … self made or source from a free source such as Pixabay, thanks … cut up via Gimp‘s … Selection Tools -> Free Select … and … Edit -> Clear … and … File -> Export As… -> .png (set “Save color values from Transparent Pixels” on) open PNG in Paintbrush and File -> Save As… -> JPEG use “Merge” option of Image Conversion via GD web application And then, at least with our MAMP local Apache web server PHP version we can also offer … crop … nominate a colour in images to crop via, and gets a look in with today’s animated GIF tutorial picture transparent … nominate a colour in images to make transparent … additional functionalities in the changed convert_wildcard.php‘s image conversion PHP web application. Previous relevant Image Conversions via PHP GD Multiple Actions Tutorial is shown below. We’ve waited a while preparing for today’s release of “multiple actions” functionality onto yesterday’s Image Conversions via PHP GD Transformations Tutorial. From how we see it we had a choice of two approaches to delivering this new functionality … start using select (ie. dropdown) element multiple … Continue reading →
Posted in eLearning, Event-Driven Programming, GIMP, Operating System, Photography, Tutorials
|
Tagged $_POST, absolute, absolute URL, Apache, arguments, attribute, backward compatibility, basename, bimp, brightness, cartoon, colourize, comma, command, command line, contrast, conversion, convert, crontab, crop, curl, Did you know, Document Root, download, dropdown, emboss, emoji, file, file specification, file_get_contents, filter, filtering, filters, form, GD, GIMP, glob, grayscale, image, image URL, ImageMagick, img, Javascript, korn shell, link, local web server, MAMP, merge, mode, modes of use, multiple, navigate, navigation, negate, onchange, open, overlay, PaintBrush, PHP, pixellate, preg_replace, procedure, programming, recall, regex, regular expression, replace, reveal, schedule, script, select, shell, switch, switches, table, tick, transparency, tutorial, type ahead buffer, url, verb, wildcard
|
Leave a comment
Image Conversions via PHP GD Multiple Actions Tutorial
We’ve waited a while preparing for today’s release of “multiple actions” functionality onto yesterday’s Image Conversions via PHP GD Transformations Tutorial. From how we see it we had a choice of two approaches to delivering this new functionality … start using select (ie. dropdown) element multiple attribute approach … but, especially because we are separating GD “Filters” into one dropdown and “Transformations” into another, we think it would be better to … start prefixing ✔ (✔ tick) emoji to selected action(s) to apply to any images involved in the conversions The ✔ (✔ tick) emoji was enough for us, yet we wanted to indicate to the user the order of actions they’ve entered. To do this we were helped out by Javascript sort methodology used in … <?php echo ” function sortsel(insel) { var sv=insel.value; var optsa=insel.innerHTML.split(‘</option>’); var sopta=optsa.sort(); var newih=”; for (var ioj=0; ioj<sopta.length; ioj++) { newih+=sopta[ioj] + ‘</option>’; } insel.innerHTML=newih; insel.value=sv; } “; ?> … accepting the GD “Filter” dropdown object as a parameter. But how is that going to help when “action” titles will just determine the sort order? Well, the select (ie. dropdown) element here is made up of … <?php echo ” <option value=\”action_desc\”>Action Desc</option> “; ?> … parts where we started defining the first two this way … <?php echo ” <option class=\”opt000\” value=\”\”>Image Filter …</option><option class=\”opt001\” value=\” \”>Image Filter Ask Arguments …</option> “; ?> … and then changed our dropdown onchange event logic supplementing a new “whenmulti” total picture data member that is now maintained … <?php echo ” var nextcls=2; function zoomsame(tvo, tvv) { var tv=tvo.value; var rest=”; var getcls=”; if (tvv != ”) { tv=tvv; } var pa=null; if (tv.trim() == ” && (” + tv.length) != ‘0’) { aska=true; } if (tv.trim() != ”) { if (document.getElementById(‘whenmulti’).value.indexOf(tv + ‘=’) != -1) { rest=tv + ‘=’ + document.getElementById(‘whenmulti’).value.split(tv + ‘=’)[1].split(‘;’)[0]; if (document.getElementById(‘whenmulti’).value.indexOf(rest + ‘;’) != -1) { rest+=’;’; } document.getElementById(‘whenmulti’).value=document.getElementById(‘whenmulti’).value.replace(rest, ”); if (document.getElementById(‘whenmulti’).value != ”) { tvo.name=document.getElementById(‘whenmulti’).value.split(‘=’)[0]; } else { tvo.name=’sfilter’; } tvo.innerHTML=tvo.innerHTML.replace(‘ value=\”‘ + tv + ‘\”>’ + tvo.innerHTML.split(‘ value=\”‘ + tv + ‘\”>’)[1].split(‘ ‘)[0] + ‘ ‘, ‘ value=\”‘ + tv + ‘\”>’); getcls=tvo.innerHTML.split(‘ value=\”‘ + tv + ‘\”>’)[0].split(‘ class=\”‘)[eval(-1 + tvo.innerHTML.split(‘ value=\”‘ + tv + ‘\”>’)[0].split(‘ class=\”‘).length)].split(‘\”‘)[0]; if (getcls != ”) { tvo.innerHTML=tvo.innerHTML.replace(‘ class=\”‘ + getcls + ‘\”‘, ”); } return ”; } if (tvo.outerHTML.indexOf(‘ name=’) == -1) { tvo.name=tv.trim(); } else if ((” + tvo.name) == ‘sfilter’) … Continue reading →
Posted in eLearning, Event-Driven Programming, Operating System, Photography, Tutorials
|
Tagged $_POST, absolute, absolute URL, Apache, arguments, attribute, backward compatibility, basename, bimp, brightness, colourize, comma, command, command line, contrast, conversion, convert, crontab, curl, Did you know, Document Root, download, dropdown, emboss, emoji, file, file specification, file_get_contents, filter, filtering, filters, form, GD, GIMP, glob, grayscale, image, image URL, ImageMagick, img, Javascript, korn shell, link, local web server, MAMP, mode, modes of use, multiple, navigate, navigation, negate, onchange, open, PHP, pixellate, preg_replace, procedure, programming, recall, regex, regular expression, replace, schedule, script, select, shell, switch, switches, table, tick, tutorial, type ahead buffer, url, verb, wildcard
|
Leave a comment
Image Conversions via PHP GD Transformations Tutorial
In today’s work progressing yesterday’s Image Conversions via PHP GD Command Line Tutorial‘s outcomes … we add into the GD “Filtering” thinking, some “Transformations” … Image Transformations …Image Transformation Ask Arguments …FlipFlip VerticalFlip HorizontalRotationScale … thinking and functionality … and then … we cater for a “curl” mode of use … by, up in that top newish block of code “recreating” a non-existant $argv[] and $argc to precede any “command line” code that fills in $_POST[] array to join in with “surfing the web” mode of use … <?php $beginswitch=false; $nextquality=false; $argnext=false; $results=””; $curlstr=””; $iscurl=false; if (!isset($argc) && isset($_GET[‘command’])) { // curl mode of use eg. curl “http://localhost:8888/convert_wildcard.php?command=x*.jpg+-q+76+-negate+.jpeg” $curlstr=”convert_wildcard.php ” . str_replace(‘+’,’ ‘,urldecode($_GET[‘command’])); $argv=explode(” “, $curlstr); $argc=sizeof($argv); if (strpos(strtolower($_SERVER[‘SERVER_NAME’]), ‘rjmprogramming.com.au’) !== false) { $iscurl=true; } } if (isset($argc)) { // command line mode of use eg. php convert_wildcard.php x*.jpg -q 76 -negate .jpeg $results=”\n”; for ($ii=1; $ii 8) { $_POST[‘quality’]=str_replace(‘%’,”,substr($argv[$ii], 8)); } else { $nextquality=true; } } else if (strpos($argv[$ii], ‘-q’) !== false || strpos($argv[$ii], ‘-Q’) !== false) { $beginswitch=true; if (strpos($argv[$ii],’=’) !== false) { $_POST[‘quality’]=str_replace(‘%’,”,explode(‘=’, $argv[$ii])[1]); } else if (strlen($argv[$ii]) > 2) { $_POST[‘quality’]=str_replace(‘%’,”,substr($argv[$ii], 2)); } else { $nextquality=true; } } else if (substr($argv[$ii],0,1) == ‘-‘) { $beginswitch=true; if (strpos($argv[$ii],’=’) !== false) { $_POST[substr(strtolower(explode(‘=’,$argv[$ii])[0]),1)]=”; if (sizeof(explode(‘,’,explode(‘=’,$argv[$ii])[1])) == 3) { $_POST[‘args’]=explode(‘=’,$argv[$ii])[1]; } else { $_POST[‘arg1’]=explode(‘=’,$argv[$ii])[1]; } } else { $_POST[substr(strtolower(explode(‘=’,$argv[$ii])[0]),1)]=”; $argnext=true; } } else if (!isset($_POST[‘ispec’])) { $_POST[‘ispec’]=$argv[$ii]; } else if (!$beginswitch) { $_POST[‘ispec’].=”,” . $argv[$ii]; } else if (substr($argv[$ii],0,1) == ‘.’ || strlen($argv[$ii]) == 3) { $argnext=false; $_POST[‘outext’]=str_replace(“..”, “.”, “.” . $argv[$ii]); } else if ($argnext) { $argnext=false; if (sizeof(explode(‘,’,$argv[$ii])) == 3) { $_POST[‘args’]=$argv[$ii]; } else { $_POST[‘arg1’]=$argv[$ii]; } } } } } ?> … and then rearranged (where first blue section just used to be echo ) the last bit of PHP code … <?php if (isset($argc) && !$iscurl) { echo openthese($results); } else { $htmlis= “<!doctyle html> <html> <head> <title>Image Conversions via PHP GD – RJM Programming – October, 2022</title> … etcetera etcetera etcetera … <select id=extsel style=display:none; id=xxxoutext><option value=”>Enter output relative image file extension [.jpeg]</option><option value=.jpeg>.jpeg</option><option value=.jpg>.jpg</option><option value=.png>.png</option><option value=.gif>.gif</option><option value=.JPEG>.JPEG</option><option value=.JPG>.JPG</option><option value=.PNG>.PNG</option><option value=.GIF>.GIF</option></select> </body> </html>”; if (!$iscurl) { echo $htmlis; } else { $phtmlis=”temphtml.html”; while (file_exists($phtmlis)) { $phtmlis=str_replace(“.htm”, “0.htm”, $phtmlis); } file_put_contents($phtmlis, $htmlis); //exec(“cd ” . dirname(__FILE__) . ” ; open ” . $phtmlis); // . ” ; rm -f ” . $phtmlis); echo “Please issue command …\nopen http://www.rjmprogramming.com.au/” . $phtmlis . ” \n … to … Continue reading →
Posted in eLearning, Event-Driven Programming, Operating System, Photography, Tutorials
|
Tagged $_POST, absolute, absolute URL, Apache, arguments, attribute, backward compatibility, basename, bimp, brightness, colourize, comma, command, command line, contrast, conversion, convert, crontab, curl, Did you know, Document Root, download, dropdown, emboss, file, file specification, file_get_contents, filter, filtering, filters, form, GD, GIMP, glob, grayscale, image, image URL, ImageMagick, img, Javascript, korn shell, link, local web server, MAMP, mode, modes of use, navigate, navigation, negate, onchange, PHP, pixellate, preg_replace, procedure, programming, recall, regex, regular expression, replace, select, shell, switch, switches, table, tutorial, type ahead buffer, url, verb, wildcard
|
Leave a comment
Image Conversions via PHP GD Command Line Tutorial
In the online woooooorrrrrlllllddd (of surfing the net in a web browser) we hope you see “nothing to see here” different to yesterday’s Image Conversions via PHP GD Filters Tutorial‘s exploits with our image conversion PHP web application. And though this is the boring partner in … must not break previous logics … must work for new functionality … adage around here trying to keep “backward compatibility” as you move forward with a project, it is, often, the most important partner. As for today, it is more likely our RJM Programming users of the changed convert_wildcard.php will never access our … new command line mode of use … adding to existant … surfing the net (in a web browser) mode of use … and perhaps into the future a … curl mode of use … but we think this PHP web application really suits a command line mode of use, given that it so suits a … download to local web server, such as Apache/PHP MAMP environment … and once there … you can control “php” as a command “verb” on the command line (by adding MAMP’s php executable relevant to your version used, to your operating system PATH environment variable), as convenient, to the point that a command line command such as … php convert_wildcard.php x*.jpg -q 76 -negate .jpeg … reads as a pretty self-explanatory way to achieve a result string such as … New image x.jpeg created … New image xcode__fibonacci.jpeg created … New image xcode_fibonacci.jpeg created … New image xcodefibonacci.jpeg created … New image xx.jpeg created … … as we got on our MAMP environment here … paradigm set of conditions, quite like ImageMagick and its command line (“convert” for macOS and Linux and “magick.exe” for Windows) image conversion functionality. The PHP changes were 95% a single block of new code, featuring a “first time for us” filling in of $_POST[] array “linkages” to “surfing the net” code in the new “command line” isset($argc) == true mode of use scenario blocks of code, near the top … <?php $beginswitch=false; $nextquality=false; $argnext=false; $results=””; if (isset($argc)) { // command line mode of use eg. php convert_wildcard.php x*.jpg -q 76 -negate .jpeg $results=”\n”; for ($ii=1; $ii<$argc; $ii++) { if (trim($argv[$ii]) != ”) { if ($nextquality) { $nextquality=false; $_POST[‘quality’]=str_replace(‘%’,”,$argv[$ii]); } else if (strpos($argv[$ii], ‘-quality’) !== false || strpos($argv[$ii], ‘-QUALITY’) !== false) { $beginswitch=true; if (strpos($argv[$ii],’=’) !== false) { $_POST[‘quality’]=str_replace(‘%’,”,explode(‘=’, $argv[$ii])[1]); … Continue reading →
Posted in eLearning, Event-Driven Programming, Operating System, Tutorials
|
Tagged $_POST, absolute, absolute URL, Apache, arguments, attribute, backward compatibility, basename, bimp, brightness, colourize, comma, command line, contrast, conversion, convert, Document Root, download, dropdown, emboss, file, file specification, file_get_contents, filter, filtering, filters, form, GD, GIMP, glob, grayscale, image, image URL, ImageMagick, img, Javascript, link, local web server, MAMP, mode, modes of use, navigate, navigation, negate, onchange, PHP, pixellate, preg_replace, programming, recall, regex, regular expression, replace, select, switch, switches, table, tutorial, url, verb, wildcard
|
Leave a comment
Image Absolute URL Conversions via PHP GD Filters Tutorial
So far with the progress regarding yesterday’s Image Conversions via PHP GD Filters Tutorial‘s PHP image conversion web application, it has been … all relative (ie. relative image URL(s) or file specification) … but, today, quietly, we allow for … absolute image URL(s), comma separated as required … that will not succeed with all absolute URL(s), but with those images on web servers that allow the PHP file_get_contents function access to their image data. Please seek permission to use images this way, as required, in the changed, particularly regarding PHP basename usage, as well as a “first time that we can remember” application of PHP preg_replace … <?php return file_get_contents(str_replace(‘https:’,’http:’,preg_replace(‘{^//}’,’http://’,$ourfilename))); ?> … PHP usage we normally tackle via Javascript replace regex usage such as … ourfilename.replace(/^\/\//g, ‘http://’).replace(‘https:’,’http:’) … within convert_wildcard.php PHP web application you can also try below. Previous relevant Image Conversions via PHP GD Filters Tutorial is shown below. Once in the (PHP) GD-land of yesterday’s Image Conversions via PHP GD Primer Tutorial, you’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 … Image Filter …Image Filter Ask Arguments …EmbossNegateEdgeNegedgeGrayscaleGaussian BlurSelective BlurSharpenBoxblurColourizePixellateSmoothContrastBrightnessSketchyColourize RedColourize GreenColourize Blue … into the mix. We add this select element “dropdown” within the HTML form method=POST action=”Here’s looking at you kid” 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 “filter” here it gets assigned an appropriate NAME attribute as per the PHP’s Javascript dropdown onchange event logic … <?php echo ” function zoomsame(tvo) { var tv=tvo.value; var pa=null; if (tv.trim() == ” && (” + tv.length) != ‘0’) { aska=true; } if (tv.trim() != ”) { tvo.name=tv.trim(); if (aska && askastr.indexOf(‘;’ + tv.trim().toLowerCase() + ‘;’) != -1) { pa=prompt(‘Optionally enter argument(s) for ‘ + tv.trim(), askastr.split(‘;’ + tv.trim().toLowerCase() + ‘;’)[1].split(‘;’)[0]); if (pa != null) { if (pa.trim() == ”) { pa=null; } } } if (pa != null) { if ((” + pa.split(‘,’).length) == ‘3’) { document.getElementById(‘rotation’).name=’args’; document.getElementById(‘rotation’).value=pa; } else { document.getElementById(‘rotation’).name=’arg1′; document.getElementById(‘rotation’).value=pa; } } else { document.getElementById(‘rotation’).name=’rotation’; document.getElementById(‘rotation’).value=” + document.getElementById(‘trot’).value; } if (tv.trim().toLowerCase() == ‘redo’) { redo(); } //alert(11); //} } } “; ?> … turning a “display useful only” HTML dropdown element into one whose value is transferred with self-navigation to interest the PHP … Continue reading →
Posted in eLearning, Event-Driven Programming, Tutorials
|
Tagged absolute, absolute URL, Apache, attribute, basename, bimp, brightness, colourize, comma, contrast, conversion, convert, Document Root, download, dropdown, emboss, file, file specification, file_get_contents, filter, filtering, filters, form, GD, GIMP, glob, grayscale, image, image URL, ImageMagick, img, Javascript, link, local web server, MAMP, navigate, navigation, negate, onchange, PHP, pixellate, preg_replace, programming, recall, regex, regular expression, replace, select, table, tutorial, url, wildcard
|
Leave a comment
Image Conversions via PHP GD Filters Tutorial
Once in the (PHP) GD-land of yesterday’s Image Conversions via PHP GD Primer Tutorial, you’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 … Image Filter …Image Filter Ask Arguments …EmbossNegateEdgeNegedgeGrayscaleGaussian BlurSelective BlurSharpenBoxblurColourizePixellateSmoothContrastBrightnessSketchyColourize RedColourize GreenColourize Blue … into the mix. We add this select element “dropdown” within the HTML form method=POST action=”Here’s looking at you kid” 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 “filter” here it gets assigned an appropriate NAME attribute as per the PHP’s Javascript dropdown onchange event logic … <?php echo ” function zoomsame(tvo) { var tv=tvo.value; var pa=null; if (tv.trim() == ” && (” + tv.length) != ‘0’) { aska=true; } if (tv.trim() != ”) { tvo.name=tv.trim(); if (aska && askastr.indexOf(‘;’ + tv.trim().toLowerCase() + ‘;’) != -1) { pa=prompt(‘Optionally enter argument(s) for ‘ + tv.trim(), askastr.split(‘;’ + tv.trim().toLowerCase() + ‘;’)[1].split(‘;’)[0]); if (pa != null) { if (pa.trim() == ”) { pa=null; } } } if (pa != null) { if ((” + pa.split(‘,’).length) == ‘3’) { document.getElementById(‘rotation’).name=’args’; document.getElementById(‘rotation’).value=pa; } else { document.getElementById(‘rotation’).name=’arg1′; document.getElementById(‘rotation’).value=pa; } } else { document.getElementById(‘rotation’).name=’rotation’; document.getElementById(‘rotation’).value=” + document.getElementById(‘trot’).value; } if (tv.trim().toLowerCase() == ‘redo’) { redo(); } //alert(11); //} } } “; ?> … turning a “display useful only” HTML dropdown element into one whose value is transferred with self-navigation to interest the PHP “recall” logic … <?php function ourimagecreatefromfile($zfilename) { global $div_img, $ext; //file_put_contents(“qwe.qweaa”, $zfilename); if (isset($_GET[’emboss’]) || isset($_POST[’emboss’])) { //file_put_contents(“qwe.qwe”, str_replace(‘ ‘,’+’,urldecode($_GET[’emboss’])) . str_replace(‘ ‘,’+’,urldecode($_POST[’emboss’])) . $zfilename); //file_put_contents(“qwe.qwex”, $_SERVER[‘HTTP_REFERER’]); $jm_php = imagecreatefromstring(ourfile_get_contents(str_replace(‘ ‘,’+’,urldecode($_GET[’emboss’])) . str_replace(‘ ‘,’+’,urldecode($_POST[’emboss’])) . $zfilename)); $emboss = getpostmaybe(‘arg1’,array([-2, -1, 0], [-1, 1, 1], [0, 1, 2])); //file_put_contents(“qwe.qwexx”, $_SERVER[‘HTTP_REFERER’]); //imageconvolution($jm_php, $emboss, 1, 0); imagefilter($jm_php, IMG_FILTER_EMBOSS); return $jm_php; //$new_name = ‘anewimage0.jpg’; $nj=0; while (file_exists(‘anewimage’ . $nj . ‘.jpg’)) { $nj++; $new_name = ‘anewimage’ . $nj . ‘.jpg’; } imagejpeg($jm_php, $new_name); $qpzm=’data:image/jpeg;base64,’ . base64_encode(ourfile_get_contents($new_name)); imagedestroy($jm_php); unlink($new_name); //file_put_contents(“qwe.qwez”, $_SERVER[‘HTTP_REFERER’]); if (strpos($_SERVER[‘HTTP_REFERER’], “/pdfimageplustext.php”) !== false) { //file_put_contents(“qwe.qwey”, “<!doctype html><html><body onload=\” if (parent.document.getElementById(‘slideshow’)) { parent.document.getElementById(‘slideshow’).value=parent.undobackup(‘” . datauriit($qpzm) . “‘); parent.forcescale(); } \”></body></html>”); echo “<!doctype html><html><body onload=\” if (parent.document.getElementById(‘slideshow’)) { parent.document.getElementById(‘slideshow’).value=parent.undobackup(‘” . datauriit($qpzm) . “‘); parent.forcescale(); } \”></body></html>”; exit; } return $qpzm; } else if (isset($_GET[‘edge’]) || isset($_POST[‘edge’])) { $jm_php = imagecreatefromstring(ourfile_get_contents(str_replace(‘ ‘,’+’,urldecode($_GET[‘edge’])) . str_replace(‘ ‘,’+’,urldecode($_POST[‘edge’])) . $zfilename)); $edge_detect = getpostmaybe(‘arg1’,array([-1, -1, -1], [-1, 8, -1], … Continue reading →
Posted in eLearning, Event-Driven Programming, Tutorials
|
Tagged Apache, attribute, bimp, brightness, colourize, contrast, conversion, convert, Document Root, download, dropdown, emboss, filter, filtering, filters, form, GD, GIMP, glob, grayscale, image, ImageMagick, img, Javascript, link, local web server, MAMP, navigate, navigation, negate, onchange, PHP, pixellate, programming, recall, select, table, tutorial
|
Leave a comment


Thanks. Since then, a Shower Songs project at https://www.rjmprogramming.com.au/HTMLCSS/shower_songs.html is an improvement regarding "Radio Play" on mobile platforms.