{"id":70076,"date":"2025-10-08T03:01:00","date_gmt":"2025-10-07T17:01:00","guid":{"rendered":"https:\/\/www.rjmprogramming.com.au\/ITblog\/?p=70076"},"modified":"2025-10-08T07:00:45","modified_gmt":"2025-10-07T21:00:45","slug":"imagemagick-command-line-php-interfacer-intranet-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/imagemagick-command-line-php-interfacer-intranet-tutorial\/","title":{"rendered":"ImageMagick Command Line PHP Interfacer Intranet Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/speech_bubble_overlays.php\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"ImageMagick Command Line PHP Interfacer Intranet Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/speech_bubble_overlays_lws.gif\" title=\"ImageMagick Command Line PHP Interfacer Intranet Tutorial\"  style=\"float:left;\"  \/><\/a><p class=\"wp-caption-text\">ImageMagick Command Line PHP Interfacer Intranet Tutorial<\/p><\/div>\n<p>We did get a solution regarding <font color=purple>yesterday<\/font>&#8216;s <a title='ImageMagick Command Line PHP Interfacer Primer Tutorial' href='#imclphpipt'>ImageMagick Command Line PHP Interfacer Primer Tutorial<\/a> &#8230;<\/p>\n<blockquote><p>\n<font color=blue>Try to open localhost<\/font>, <font color=purple>allow switches be user definable<\/font>, remember different successful ones, local file browsing, try other command line approaches, try OOP <a target=\"_blank\" title='ImageMagick command line' href='http:\/\/www.imagemagick.org\/script\/command-line-tools.php' rel=\"noopener\">ImageMagick<\/a> approach\n<\/p><\/blockquote>\n<p> &#8230; as today&#8217;s <font color=blue>single aim, as it panned out,<\/font> but &#8230;<\/p>\n<ul>\n<li>it took all working day &#8230;<\/li>\n<li>we had to open our thinking to &#8230; &#8220;scrapping for it&#8221;<\/li>\n<\/ul>\n<p> &#8230; with issues you think you might be able to get around regarding  <a target=\"_blank\" title='CORS information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/Cross-origin_resource_sharing' rel=\"noopener\">CORS<\/a>, but cannot, these days, with your modern browsers &#8230; and probably a good thing too!<\/p>\n<p>It&#8217;s just that the asking of a &#8230;<\/li>\n<ul>\n<li>public website webpage &#8230; sharing data with &#8230;<\/li>\n<li>an associated &#8230; what we think of as &#8220;intranet feeling&#8221; &#8230; local web server webpage<\/li>\n<\/ul>\n<p> &#8230; as a communication system to have the same stringent standards as for a <i>public website webpage and a different domain website webpage scenario<\/i> seems &#8220;a bit rich&#8221;, and we&#8217;re constantly trying to see a way through, past CORS, via JSONP <font size=1>(local web server external Javascript &#8220;hotlinking&#8221;)<\/font> perhaps, via Ajax perhaps, via what we like to think of as &#8220;client pre-emptive iframe&#8221; techniques perhaps, via error counting techniques perhaps, via local web server image hotlinking perhaps, all amounting to no success, until we upped the ante of &#8220;scrapping for it&#8221; measures, using local web server external Javascript <font size=1>(guaranteed via enforced PHP writes external Javascript)<\/font> &#8220;iframe hotlinking&#8221; combined with codelines like &#8230;<\/p>\n<p>&lt;?php echo &#8221;<br \/>\n<code><br \/>\n           location.href=(document.URL + '&showlocal=' + encodeURIComponent(sofarport)).replace('.php&','.php?');<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;<\/p>\n<p> &#8230; effectively reloading webpages to achieve this one <font color=blue>Try to open localhost<\/font> aim.  Who knows, we&#8217;ve left the coding for all those other attempts in, and you may be interested, but if we&#8217;d &#8220;scrapped&#8221; earlier, perhaps we could have moved on quicker, displaying or not our new button &#8230;<\/p>\n<p>&lt;?php echo &#8221;<br \/>\n<code><br \/>\n&lt;button style=display:\" . (strpos($_SERVER['SERVER_NAME'], 'localhost') !== false ? 'none' : $ib) . \"; id=locbutone title=\\\"Can click for local web server Speech Bubble ImageMagick interfacing?\\\" onclick=tosb();&gt; ... Local Web Server &amp;#x1F5A5;&amp;#xFE0F;&lt;\/button&gt;<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;<\/p>\n<p> &#8230; depending on whether on a local web server in amongst Apache (eg. <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>) local web server ports 8888 or 7888 or 8890 or 80 or no port in it&#8217;s Document Root folder, you have installed <font size=1>(ie. &#8220;downloaded into place&#8221; or &#8220;plonked&#8221;)<\/font> a speech_bubble_overlays.php and ImageMagick <font size=1>(we&#8217;re assuming, but not programmatically checking about)<\/font> that can improve on the RJM Programming public website  speech_bubble_overlays.php and ImageMagick combination regarding features such as <font size=1>ImageMagick &#8220;convert&#8221; command line switch &#8211;<\/font><i>color-threshold<\/i> command line usage for a <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/speech_bubble_overlays.php--GETME\" rel=\"noopener\">third draft<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/speech_bubble_overlays.php--GETME\" rel=\"noopener\">speech_bubble_overlays.php<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/speech_bubble_overlays.php\" rel=\"noopener\">ImageMagick command line interfacer<\/a> web application.<\/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\/imagemagick-command-line-php-interfacer-intranet-tutorial\/' rel=\"noopener\">ImageMagick Command Line PHP Interfacer Intranet Tutorial<\/a>.<\/p-->\n<hr>\n<p id='imclphpipt'>Previous relevant <a target=\"_blank\" title='ImageMagick Command Line PHP Interfacer Primer Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/imagemagick-command-line-php-interfacer-primer-tutorial\/' rel=\"noopener\">ImageMagick Command Line PHP Interfacer 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\/speech_bubble_overlays.php\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"ImageMagick Command Line PHP Interfacer Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/speech_bubble_overlays_switches.png\" title=\"ImageMagick Command Line PHP Interfacer Primer Tutorial\"  style=\"float:left;\"  \/><\/a><p class=\"wp-caption-text\">ImageMagick Command Line PHP Interfacer Primer Tutorial<\/p><\/div>\n<p>Out of the efforts of yesterday&#8217;s <a target=\"_blank\" href='https:\/\/www.rjmprogramming.com.au\/ITblog\/preview-speech-bubble-overlay-youtube-api-caller-making-of-tutorial\/' title='Preview Speech Bubble Overlay YouTube API Caller Making of Tutorial' rel=\"noopener\">Preview Speech Bubble Overlay YouTube API Caller Making of Tutorial<\/a>, we&#8217;ve decided a &#8220;Making of&#8221; scenario should go further, in a generic way, though our labelling will remain specific for now, building on &#8230;<\/p>\n<ul>\n<li>it&#8217;s <i>Preview Default Coloured ImageMagick Speech Bubble Extraction and Background Image Overlay<\/i> example usage &#8230; onto &#8230;<\/li>\n<li>thoughts that this can become a better and more generic <a target=\"_blank\" title='ImageMagick software suite' href='https:\/\/www.imagemagick.org\/' rel=\"noopener\">ImageMagick<\/a> interfacing PHP tool<\/li>\n<\/ul>\n<p>And what caused this maturation in thinking?  As soon as you code for any complexity of command line switch logic, you find yourselves thinking &#8230;<\/p>\n<ul>\n<li>hand over control to the user<\/li>\n<li>textarea usage<\/li>\n<\/ul>\n<p> &#8230; and then from there <i>all hell breaks loose<\/i> really, and thoughts head towards &#8230;<\/p>\n<blockquote><p>\nLet&#8217;s be a user and it&#8217;s easier to test between platforms to see what&#8217;s possible interfacing to ImageMagick when we can feed the switches into a textarea, and the input files become that separated piece of user input, as well.\n<\/p><\/blockquote>\n<p>Patently, this project is not trivial, and all sorts of things are up for grabs, our starting list, starting today, looking like &#8230;<\/p>\n<blockquote><p>\nTry to open localhost, allow switches be user definable, remember different successful ones, local file browsing, try other command line approaches, try OOP ImageMagick approach\n<\/p><\/blockquote>\n<p>So far the project looks like &#8230;<\/p>\n<ol>\n<li>ImageMagick interfacing<\/li>\n<li>Base image<\/li>\n<li>Overlaying image<\/li>\n<li>PHP <a target=\"_blank\" title='PHP shell_exec() method information' href='http:\/\/php.net\/manual\/en\/function.shell-exec.php' rel=\"noopener\">shell_exec<\/a> ImageMagick command line calls <font size=1>(so far)<\/font><\/li>\n<\/ol>\n<p> &#8230; for a <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/speech_bubble_overlays.php-GETME\" rel=\"noopener\">second draft<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/speech_bubble_overlays.php-GETME\" rel=\"noopener\">speech_bubble_overlays.php<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/speech_bubble_overlays.php\" rel=\"noopener\">ImageMagick command line interfacer<\/a> web application.<\/p>\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='#d70067' onclick='var dv=document.getElementById(\"d70067\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/switch\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d70067' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\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='#d70076' onclick='var dv=document.getElementById(\"d70076\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/intranet\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d70076' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>We did get a solution regarding yesterday&#8216;s ImageMagick Command Line PHP Interfacer Primer Tutorial &#8230; Try to open localhost, allow switches be user definable, remember different successful ones, local file browsing, try other command line approaches, try OOP ImageMagick approach &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/imagemagick-command-line-php-interfacer-intranet-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":[2,12,14,29,37],"tags":[69,85,3349,233,234,2650,1995,1750,5296,5295,400,418,2537,3441,587,590,4442,1658,609,5294,1577,5297,3695,624,714,4085,3337,744,1922,870,2238,932,1772,997,3942,3883,1231,1262,2005,1319,1891,3575],"class_list":["post-70076","post","type-post","status-publish","format-standard","hentry","category-ajax","category-elearning","category-event-driven-programming","category-operating-system","category-tutorials","tag-ajax","tag-apache","tag-client-pre-emptive-iframe","tag-command","tag-command-line","tag-convert","tag-cors","tag-document-root","tag-error-file","tag-errors","tag-event","tag-file","tag-generic","tag-genericity","tag-iframe","tag-image","tag-image-file","tag-imagemagick","tag-input","tag-input-file","tag-interface","tag-interfacer","tag-interfacing","tag-intranet","tag-local-web-server","tag-log-file","tag-making-of","tag-mamp","tag-onerror","tag-onload","tag-output","tag-php","tag-port","tag-programming","tag-shell_exec","tag-switch","tag-switches","tag-textarea","tag-tool","tag-tutorial","tag-user","tag-user-input"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/70076"}],"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=70076"}],"version-history":[{"count":19,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/70076\/revisions"}],"predecessor-version":[{"id":70099,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/70076\/revisions\/70099"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=70076"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=70076"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=70076"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}