{"id":57917,"date":"2023-01-18T03:01:28","date_gmt":"2023-01-17T17:01:28","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=57917"},"modified":"2023-01-15T17:38:21","modified_gmt":"2023-01-15T07:38:21","slug":"inhouse-slideshow-backup-tidy-up-crontab-curl-php-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/inhouse-slideshow-backup-tidy-up-crontab-curl-php-tutorial\/","title":{"rendered":"Inhouse Slideshow Backup Tidy Up Crontab Curl PHP Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/slideshow_zero.jpg\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Inhouse Slideshow Backup Tidy Up Crontab Curl PHP Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/slideshow_zero.jpg\" title=\"Inhouse Slideshow Backup Tidy Up Crontab Curl PHP Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">Inhouse Slideshow Backup Tidy Up Crontab Curl PHP Tutorial<\/p><\/div>\n<p><a target=_blank title='crontab information from computerhope ... thanks' href='http:\/\/www.computerhope.com\/jargon\/c\/cron.htm'>Crontab<\/a> is that great scheduling tool that we make use of, a lot, on our RJM Programming Linux CentOS web server.  But it&#8217;s not only &#8230;<\/p>\n<ul>\n<li>the timing &#8230; of a procedure that is so good about crontab &#8230; it is, also, for us, it&#8217;s teaming with &#8230;<\/li>\n<li><a target=_blank title='Linux or unix curl information from computerhope' href='http:\/\/www.computerhope.com\/unix\/curl.htm'>curl<\/a><\/li>\n<\/ul>\n<p> &#8230; that means we can back up a &#8220;peer based&#8221; solution such as talked about with <a title='Inhouse Slideshow Backup Tidy Up Report Viewing Tutorial' href='#isbturvt'>Inhouse Slideshow Backup Tidy Up Report Viewing Tutorial<\/a> (ie. done as a user is surfing the net with some PHP of ours) methodology should it fail.  We think we have an occasionally failing one as far as the tidy up of zipped up inhouse slideshows goes.  It could be to do with a search engine crawling operation, we have not found out for sure, but we&#8217;ve decided to write our own &#8230;<\/p>\n<ul>\n<li>PHP &#8230; via &#8230;<\/li>\n<li>crontab<\/li>\n<li>curl<\/li>\n<\/ul>\n<p> &#8230; based <i>independent<\/i> tidying up procedure we&#8217;ll run once an hour via crontab record &#8230;<\/p>\n<p><code><br \/>\n*\/53 * * * curl ht<font color=black>tp<\/font>:\/\/www.rjmprogramming.com.au\/slideshow_zero.php<br \/>\n<\/code><\/p>\n<p> &#8230; arrangement.  We realize the contents of this PHP procedure may bore some, but interest a few, and so here is what it amounted to &#8230;<\/p>\n<p>&lt;?php<br \/>\n<code><br \/>\n\/\/ slideshow_zero.php<br \/>\n\/\/ Zip and Unzip Tidy Up<br \/>\n\/\/ RJM Programming<br \/>\n\/\/ Decemeber, 2022<br \/>\nset_time_limit(3600);<br \/>\n<br \/>\nif (file_exists(\"slideshow_zero.txt\")) {<br \/>\n  unlink(\"slideshow_zero.txt\");<br \/>\n}<br \/>\n<br \/>\nif (file_exists(\"slideshow_zero.kkk\")) {<br \/>\n  unlink(\"slideshow_zero.kkk\");<br \/>\n}<br \/>\n<br \/>\nexec(\"find \" . dirname(__FILE__) . DIRECTORY_SEPARATOR . \" -name 'slideshow_0.zip' 2&gt; \/dev\/null &gt; \" . dirname(__FILE__) . DIRECTORY_SEPARATOR . \"slideshow_zero.txt\");<br \/>\n<br \/>\n$lines=file(dirname(__FILE__) . DIRECTORY_SEPARATOR . \"slideshow_zero.txt\");<br \/>\n<br \/>\n$htmlis=\"&lt;html&gt;&lt;body&gt;&lt;textarea&gt;<br \/>\n&lt;\/textarea&gt;&lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n<br \/>\nfor ($i=0; $i&lt;sizeof($lines); $i++) {<br \/>\n  $lines[$i]=explode(\"\\n\", $lines[$i])[0];<br \/>\n  if (file_exists(str_replace(\"slideshow_0.zip\", \"index.php\", $lines[$i]))) {<br \/>\n    if (('' . filesize(str_replace(\"slideshow_0.zip\", \"index.php\", $lines[$i]))) == '38794') {<br \/>\n      if (file_exists(\"slideshow_zero.txx\")) {<br \/>\n        unlink(\"slideshow_zero.txx\");<br \/>\n      }<br \/>\n      exec(\"unzip -l \" . $lines[$i] . \" | grep '.jpg'  | sed '\/^ \/s\/\/\/g' | sed '\/^ \/s\/\/\/g' | sed '\/^ \/s\/\/\/g' | sed '\/^ \/s\/\/\/g' | sed '\/^ \/s\/\/\/g' |   sed '\/  \/s\/\/ \/g' | sed '\/  \/s\/\/ \/g' | sed '\/  \/s\/\/ \/g' | sed '\/  \/s\/\/ \/g' | cut -f4 -d' ' | grep '-' &gt; \" . dirname(__FILE__) . DIRECTORY_SEPARATOR . \"slideshow_zero.txx\");<br \/>\n      if (file_exists(\"slideshow_zero.txx\")) {<br \/>\n        $sublines=file(dirname(__FILE__) . DIRECTORY_SEPARATOR . \"slideshow_zero.txx\");<br \/>\n        for ($j=0; $j&lt;sizeof($sublines); $j++) {<br \/>\n         $sublines[$j]=explode(\" \", explode(\"\\n\", $sublines[$j])[0])[0];<br \/>\n         $fis=explode(\"slideshow_0.zip\", $lines[$i])[0] . $sublines[$j];<br \/>\n          if (file_exists($fis)) {<br \/>\n            $md=filemtime($fis);<br \/>\n            if ($md) {<br \/>\n              if ((time() - $md) &gt; 1200) {<br \/>\n                if (file_exists(\"slideshow_zero.kkk\")) {<br \/>\n                 exec(\"rm -f \" . $fis); \/\/file_put_contents(\"slideshow_zero.kkk\", file_get_contents(\"slideshow_zero.kkk\") . \"rm -f \" . $fis . \"\\n\");<br \/>\n                } else {<br \/>\n                 exec(\"rm -f \" . $fis); \/\/file_put_contents(\"slideshow_zero.kkk\", \"rm -f \" . $fis . \"\\n\");<br \/>\n                }<br \/>\n             }<br \/>\n            }<br \/>\n         }<br \/>\n        }<br \/>\n      }<br \/>\n    } else if (1 == 3) {<br \/>\n                if (file_exists(\"slideshow_zero.kkk\")) {<br \/>\n                 file_put_contents(\"slideshow_zero.kkk\", file_get_contents(\"slideshow_zero.kkk\") . \"# \" . ('' . filesize(str_replace(\"slideshow_0.zip\", \"index.php\", $lines[$i]))) . \" is not 38794 \" . str_replace(\"slideshow_0.zip\", \"index.php\", $lines[$i]) . \"\\n\");<br \/>\n                } else {<br \/>\n                 file_put_contents(\"slideshow_zero.kkk\", \"# \" . ('' . filesize(str_replace(\"slideshow_0.zip\", \"index.php\", $lines[$i]))) . \" is not 38794 \" . str_replace(\"slideshow_0.zip\", \"index.php\", $lines[$i]) . \"\\n\");<br \/>\n                }<br \/>\n    }<br \/>\n  }<br \/>\n}<br \/>\n<br \/>\nif (file_exists(\"slideshow_zero.txx\")) {<br \/>\n  unlink(\"slideshow_zero.txx\");<br \/>\n}<br \/>\n<br \/>\nif (file_exists(\"slideshow_zero.txt\")) {<br \/>\n  unlink(\"slideshow_zero.txt\");<br \/>\n}<br \/>\n<br \/>\nif (file_exists(\"slideshow_zero.kkk\")) {<br \/>\n  unlink(\"slideshow_zero.kkk\");<br \/>\n}<br \/>\n<br \/>\n\/\/echo $htmlis;<br \/>\nexit;<br \/>\n<\/code><br \/>\n?&gt;<\/p>\n<p> &#8230; as that &#8220;ahhhhhhhh, what a relief&#8221; reliever of tension running the RJM Programming website.  The subtext is, our inode limits are a concern!<\/p>\n<p>We think another lesson here is that PHP can be a good alternative to scripting languages such as Korn Shell to create &#8220;operational&#8221; procedures, especially when you consider that curl means it can be like writing your &#8220;surfing the net&#8221; type of PHP (<a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/slideshow_zero.php_GETME\" title=\"slideshow_zero.php\">slideshow_zero.php<\/a>) work.<\/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\/inhouse-slideshow-backup-tidy-up-crontab-curl-php-tutorial\/'>Inhouse Slideshow Backup Tidy Up Crontab Curl PHP Tutorial<\/a>.<\/p-->\n<hr>\n<p id='isbturvt'>Previous relevant <a target=_blank title='Inhouse Slideshow Backup Tidy Up Report Viewing Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/inhouse-slideshow-backup-tidy-up-report-viewing-tutorial\/'>Inhouse Slideshow Backup Tidy Up Report Viewing Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/slideshow_cleanup_report.jpg\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Inhouse Slideshow Backup Tidy Up Report Viewing Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/slideshow_cleanup_report.jpg\" title=\"Inhouse Slideshow Backup Tidy Up Report Viewing Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">Inhouse Slideshow Backup Tidy Up Report Viewing Tutorial<\/p><\/div>\n<p>The thing about yesterday&#8217;s <a title='Inhouse Slideshow Backup Tidy Up Report Tutorial' href='#isbturt'>Inhouse Slideshow Backup Tidy Up Report Tutorial<\/a> is that &#8230;<\/p>\n<ul>\n<li>it creates useful report content &#8230; but &#8230;<\/li>\n<li>it is information we do not want everyone to be able to see <font size=1>(easily, shall we say)<\/font> &#8230; and in the sense that &#8230;<\/li>\n<li>the report is stored away from RJM Programming&#8217;s &#8220;public_html&#8221; folder (ie. its Apache\/PHP\/MySql &#8220;Document Root&#8221;) is good &#8230; but even with today&#8217;s work &#8230;<\/li>\n<li>hidden from everybody who does not have access to the RJM Programming&#8217;s web server &#8230; but &#8230;<\/li>\n<li><i>the administrator of the RJM Programming&#8217;s web server<\/i> <font size=1>(yoo hoo!)<\/font> wants a mechanism to view the report that does not involve some &#8220;arcane procedure&#8221; each time to view it<\/li>\n<\/ul>\n<p> &#8230; and so we decided that because &#8230;<\/p>\n<p><code><br \/>\n<i>the administrator of the RJM Programming's web server<\/i> = <i>the administrator of this blog<\/i><br \/>\n<\/code><\/p>\n<p> &#8230; we&#8217;d like to organize a system that latches onto that &#8220;security footing&#8221; and only show a &#8220;broom emoji button&#8221; (&#129529; &amp;#129529;) way to access the report when <i>the administrator of this blog<\/i> is logged in.  We can do this by amending our Twenty Ten theme&#8217;s <font size=1>good ol&#8217;<\/font> header.php <font color=blue>as per<\/font> (where the &#8220;function mlater&#8221; you may recall from the days of <a target=_blank title='WordPress Blog Email Post Collaboration Ajax Image Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/wordpress-blog-email-post-collaboration-ajax-image-tutorial\/'>WordPress Blog Email Post Collaboration Ajax Image Tutorial<\/a>) &#8230;<\/p>\n<p>&lt;?php<br \/>\n<code><br \/>\n<font color=blue>$fns=\"36\";<br \/>\n<br \/>\nfunction doisr() {<br \/>\nglobal $fns;<br \/>\n$inmb=\"\";<br \/>\nif (('' . get_current_user_id()) != '0' && ('' . get_current_user_id()) == '1') {<br \/>\n  if (file_exists('\/tmp\/slideshow_cleanup.txt')) {<br \/>\n    $fns=\"24\";<br \/>\n    $inmb=\"&lt;a style=font-size:24px; title='Inhouse Slideshow Tidy Up Report' onclick=\\\"var iswo=window.open('','_blank','top=100,left=100,height=600,width=730'); iswo.document.write('&lt;html&gt;&lt;head&gt;&lt;title&gt;Inhouse Slideshow Tidy Up Report&lt;\/title&gt;&lt;\/head&gt;&lt;body&gt;&lt;pre&gt;\" . str_replace(\"\\n\",\"&lt;br&gt;\",file_get_contents('\/tmp\/slideshow_cleanup.txt')) . \"&lt;\/pre&gt;&lt;\/body&gt;&lt;\/html&gt;'); \\\"&gt;&amp;#129529;&lt;\/a&gt;&nbsp;\";<br \/>\n  }<br \/>\n}<br \/>\nreturn str_replace(\"'\",\"' + String.fromCharCode(39) + '\",$inmb);<br \/>\n}<\/font><br \/>\n<\/code><br \/>\n?&gt;<\/p>\n<p> &#8230; PHP affects some (PHP writes) Javascript below &#8230;<\/p>\n<p>&lt;?php<br \/>\n<code><br \/>\n function mlater() {<br \/>\n   if (1 == 1 || navigator.userAgent.match(\/Android|BlackBerry|iPhone|iPod|Opera Mini|IEMobile\/i)) {<br \/>\n   if (dbihis == '') { dbihis=document.body.innerHTML; }<br \/>\n   var xstih=document.getElementById('site-title').innerHTML;<br \/>\n   if (xstih.indexOf(\"up\" + \"top\") == -1) {<br \/>\n     document.getElementById('site-title').innerHTML+=<font color=blue>'&lt;?php echo doisr(); ?&gt;' + <\/font>'&lt;a id=\"avs\" style=\"text-decoration:none;font-size:<font color=blue>&lt;?php global $fns; echo $fns; ?&gt;<\/font>px;\" href=# onmouseover=\"getVisualSynopsis(event);\" onmouseout=\"yehbut();\"  ontouchstart=\"getVisualSynopsis(event);\" ontouchend=\"yehbut();\"  onclick=\" uptop(); \" title=\"... you can wait for the long hover functionality about Visual Synopsis (Slideshows)\"&gt;&amp;#127910;&lt;\/a&gt;&nbsp;&lt;a style=\"cursor:pointer;text-decoration:none;font-size:<font color=blue>&lt;?php global $fns; echo $fns; ?&gt;<\/font>px;\" onclick=\"diffphpfix(this);\" title=\"Code Difference Functional Links\"&gt;&amp;#128214;&lt;\/a&gt;&nbsp;&lt;a style=\"cursor:pointer;text-decoration:none;font-size:36px;\" onclick=\"popselid();\" title=\"Filter Content via Div ID\"&gt;&amp;#10135;&lt;\/a&gt;&nbsp;&lt;a style=\"cursor:pointer;text-decoration:none;visibility:hidden;font-size:<font color=blue>&lt;?php global $fns; echo $fns; ?&gt;<\/font>px;\" title=\"Blog post contents reduced to summary\" id=\"eds\" onclick=\"pre_details_summary();\"&gt;&amp;#10134;&lt;\/a&gt;' + printscreen(0);<br \/>\n     if (document.URL.indexOf(\"visualsynopsis=\") != -1) document.getElementById('avs').click();<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\/inhouse-slideshow-backup-tidy-up-report-viewing-tutorial\/'>Inhouse Slideshow Backup Tidy Up Report Viewing Tutorial<\/a>.<\/p-->\n<hr>\n<p id='isbturt'>Previous relevant <a target=_blank title='Inhouse Slideshow Backup Tidy Up Report Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/inhouse-slideshow-backup-tidy-up-report-tutorial\/'>Inhouse Slideshow Backup Tidy Up Report Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/slideshow_cleanupreport.jpg\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Inhouse Slideshow Backup Tidy Up Report Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/slideshow_cleanupreport.jpg\" title=\"Inhouse Slideshow Backup Tidy Up Report Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">Inhouse Slideshow Backup Tidy Up Report Tutorial<\/p><\/div>\n<p>Yesterday&#8217;s <a title='Inhouse Slideshow Backup Tidy Up Tutorial' href='#isbtut'>Inhouse Slideshow Backup Tidy Up Tutorial<\/a> presented a &#8230;<\/p>\n<ul>\n<li>non-automated<\/li>\n<li>user instigated<\/li>\n<li>snapshot<\/li>\n<\/ul>\n<p> &#8230; Inhouse Slideshow &#8220;tidying up&#8221; PHP web application.  This web application is like a &#8230;<\/p>\n<ul>\n<li>procedure &#8230; that a &#8230;<\/i>\n<li>system operator<\/li>\n<\/ul>\n<p> &#8230; might be interested in using.  But not many &#8220;system operators&#8221; would continue putting up with such a modus operandi.  We can improve by &#8230;<\/p>\n<ul>\n<li>allowing any of &#8230;\n<ol>\n<li>surfing the net<\/li>\n<li>curl<\/li>\n<li>command line<\/li>\n<\/ol>\n<p> &#8230; modes of use &#8230; allowing &#8230;<\/li>\n<li>crontab scheduling via &#8230;<br \/>\n<code><br \/>\n*\/49 * * * * ksh -c \"curl HTTP:\/\/www.rjmprogramming.com.au\/slideshow_cleanup.php?all=all\"<br \/>\n<\/code><br \/>\n &#8230; to allow for a &#8230;\n<\/li>\n<li>scheduled report available &#8230; and make sure we &#8230;<\/li>\n<li>disallow overlapping execution runs<\/li>\n<\/ul>\n<p> &#8230; with <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/slideshow_cleanup.php-GETME\">our changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/slideshow_cleanup.php-GETME\">slideshow_cleanup.php<\/a> &#8220;Inhouse Slideshow&#8221; unzipped image &#8220;tidy<font size=1>er<\/font> up<font size=1>perer<\/font>&#8220;.<\/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\/inhouse-slideshow-backup-tidy-up-report-tutorial\/'>Inhouse Slideshow Backup Tidy Up Report Tutorial<\/a>.<\/p-->\n<hr>\n<p id='isbtut'>Previous relevant <a target=_blank title='Inhouse Slideshow Backup Tidy Up Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/inhouse-slideshow-backup-tidy-up-tutorial\/'>Inhouse Slideshow Backup Tidy Up Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/slideshow_cleanup.jpg\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Inhouse Slideshow Backup Tidy Up Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/slideshow_cleanup.jpg\" title=\"Inhouse Slideshow Backup Tidy Up Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">Inhouse Slideshow Backup Tidy Up Tutorial<\/p><\/div>\n<p>There are two aspects to diskspace maintainence up at the web server for RJM Programming.<\/p>\n<table>\n<tr>\n<td>\n<ul>\n<li><a target=_blank title='Linux df command information from computerhope' href='https:\/\/www.computerhope.com\/unix\/udf.htm'>df<\/a> -k \/<\/li>\n<li>df -i \/<\/li>\n<\/ul>\n<\/td>\n<td>\n<!--ul style='list-style:none !important'>\n\n\n<li style='list-style:none !important'--><span>#&nbsp;diskspace<\/span><!--\/li--><br \/>\n<!--li style='list-style:none !important'--><span>#&nbsp;inode count<\/span><!--\/li--><br \/>\n<!--\/ul-->\n<\/td>\n<\/tr>\n<\/table>\n<p> &#8230; and it is often that inode count we are concerned about, and looking out for ways to reduce the number of files we create on the web server.<\/p>\n<p>The Inhouse Slideshow ways of <a title='Inhouse Slideshow Mobile Google Crawl Tutorial' href='#ismgct'>Inhouse Slideshow Mobile Google Crawl Tutorial<\/a> &#8230;<\/p>\n<ul>\n<li>use zip files to &#8220;scrunch up&#8221; a series of image files into the one zip file &#8230; for the vast majority of time &#8230; but when asked to, by a user &#8230;<\/li>\n<li>unzip the image files when required by a user wanting to see them &#8230; and then &#8230;<\/li>\n<li><i>tidy up<\/i>, after some delay in time<\/li>\n<\/ul>\n<p> &#8230; but we want to design a PHP way to independently <i>tidy up<\/i> as a backup mechanism.  And we say, with PHP code, that if such files have been on the web server longer than ten minutes, this PHP callable <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/slideshow_cleanup.php_GETME\">slideshow_cleanup.php<\/a> code &#8230;<\/p>\n<p>&lt;?php<br \/>\n<code><br \/>\n\/\/ slideshow_cleanup.php<br \/>\n\/\/ RJM Programming<br \/>\n\/\/ May, 2022<br \/>\n<br \/>\n  $cdis=dirname(__FILE__) . DIRECTORY_SEPARATOR;<br \/>\n  <a target=_blank title='PHP exec() method information' href='http:\/\/php.net\/manual\/en\/function.exec.php'>exec<\/a>(\"cd \" . $cdis . \"; find . -name 'slideshow_0.zip' 2&gt; \/dev\/null &gt; \/tmp\/slideshow_cleanup.txt\");<br \/>\n<br \/> <br \/>\n  $lines = file('\/tmp\/slideshow_cleanup.txt');<br \/>\n  date_default_timezone_set('Australia\/Perth');<br \/>\n<br \/>\n  foreach ($lines as $line_num =&gt; $line) {<br \/>\n    $ji=0;<br \/>\n    if (substr($line,0,1) == '.') { $ji=2; }<br \/>\n    $thisdir=explode('slideshow_0.zip', $line)[0];<br \/>\n    $uzc=<a target=_blank title='PHP shell_exec() method information' href='http:\/\/php.net\/manual\/en\/function.shell-exec.php'>shell_exec<\/a>(\"unzip -l \" . $cdis . substr($line, $ji));<br \/>\n    foreach (<a target=_blank title='PHP glob method information' href='http:\/\/php.net\/manual\/en\/function.glob.php'>glob<\/a>($thisdir . '*-[0-9]*of.[jJpPgG][pPnNiI]*') as $zipmember) {<br \/>\n      $ij=0;<br \/>\n      if (substr($zipmember,0,1) == '.') { $ij=2; }<br \/>\n      $thisfile=$cdis . substr($zipmember, $ij);<br \/>\n      if (strpos($uzc, (' ' . explode(DIRECTORY_SEPARATOR,   substr($zipmember, $ij))[-1 + sizeof(explode(DIRECTORY_SEPARATOR,   substr($zipmember, $ij)))])    ) !== false) {<br \/>\n        if ((time() - filectime($thisfile)) &gt; 600) {   \/\/ more than 10 minutes old<br \/>\n          unlink($thisfile); \/\/echo \"analyze \" . $thisfile . \" \" . (time() - <a target=_blank title='PHP filectime method information' href='https:\/\/www.php.net\/manual\/en\/function.filectime.php'>filectime<\/a>($thisfile)) . ' seconds ago ' . \"\\n\";<br \/>\n        }<br \/>\n      }<br \/>\n    }<br \/>\n    foreach (glob($thisdir . '*-[0-9]{[0-9]*}.[jJpPgG][pPnNiI]*') as $zipmember) {<br \/>\n      $ij=0;<br \/>\n      if (substr($zipmember,0,1) == '.') { $ij=2; }<br \/>\n      $thisfile=$cdis . substr($zipmember, $ij);<br \/>\n      if (strpos($uzc, (' ' . explode(DIRECTORY_SEPARATOR,   substr($zipmember, $ij))[-1 + sizeof(explode(DIRECTORY_SEPARATOR,   substr($zipmember, $ij)))])    ) !== false) {<br \/>\n        if ((time() - filectime($thisfile)) &gt; 600) {<br \/>\n          unlink($thisfile); \/\/echo \"Analyze \" . $thisfile . \" \" . (time() - filectime($thisfile)) . ' seconds ago ' . \"\\n\";<br \/>\n        }<br \/>\n      }<br \/>\n    }<br \/>\n  }<br \/>\n<br \/>\n<\/code><br \/>\n?&gt;<\/p>\n<p> &#8230; should do its th<strike>a<\/strike>ing!<\/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\/inhouse-slideshow-backup-tidy-up-tutorial\/'>Inhouse Slideshow Backup Tidy Up Tutorial<\/a>.<\/p-->\n<hr>\n<p id='ismgct'>Previous relevant <a target=_blank title='Inhouse Slideshow Mobile Google Crawl Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/inhouse-slideshow-mobile-google-crawl-tutorial\/'>Inhouse Slideshow Mobile Google Crawl Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/CHash\/XML\/inhouse_slideshow_mobile_width.jpg\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Inhouse Slideshow Mobile Google Crawl Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/CHash\/XML\/inhouse_slideshow_mobile_width.jpg\" title=\"Inhouse Slideshow Mobile Google Crawl Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">Inhouse Slideshow Mobile Google Crawl Tutorial<\/p><\/div>\n<p>The recent <a title='Inhouse Slideshow Mobile Tutorial' href='#ismt'>Inhouse Slideshow Mobile Tutorial<\/a> did not satisfy all the &#8220;mobile usability&#8221; tests performed by the &#8220;Google Crawl&#8221; algorithm, failing on &#8220;Content wider than screen&#8221;, and you can read some background to this with <a target=_blank href='https:\/\/www.rjmprogramming.com.au\/ITblog\/google-crawl-viewport-geographicals-tutorial' title='Google Crawl Viewport Geographicals Tutorial'>Google Crawl Viewport Geographicals Tutorial<\/a>.  And so we try some refinements here today, with an idea to control on mobile platforms the max-width CSS property of the document.body of a Inhouse Slideshow webpage, which made up the URLs failing this test at the <a target=_blank title='Google Search Console' href='https:\/\/search.google.com\/search-console'>Google Search Console<\/a>.<\/p>\n<p>We were reading <a target=_blank title='Useful link' href='https:\/\/stackoverflow.com\/questions\/36253760\/how-to-limit-max-width-and-height-to-screen-size-in-css'>this great and useful link<\/a>, thanks, and decided to see whether this stopping of scrolling in X on mobile platform versions of the Inhouse Slideshow webpages gels better with <a target=_blank title='Google Search Console' href='https:\/\/search.google.com\/search-console'>Google Search Console<\/a> &#8220;Google Crawl&#8221; Mobility Usability algorithms.<\/p>\n<p>Yet again, deployment of these changes is similar to that last time, and the times before that, as per &#8230;<\/p>\n<blockquote cite='https:\/\/www.rjmprogramming.com.au\/ITblog\/inhouse-slideshow-design-exif-order-tutorial\/'>\n<p>Unit testing completed, the deployment, again, matches those ideas of the recent <a target=_blank title='PDF Slideshow and Form Creation Helper Slideshow Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/pdf-slideshow-and-form-creation-helper-slideshow-tutorial\/'>PDF Slideshow and Form Creation Helper Slideshow Tutorial<\/a> &#8230; in that &#8230;<\/p>\n<p><\/p>\n<ul>\n<li><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=HTTP:\/\/www.rjmprogramming.com.au\/CHash\/XML\/index.php------GETME\" title=\"index.php\">the changed<\/a> <a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/CHash\/XML\/index.php------GETME\" title=\"index.php\">index.php<\/a> new &#8220;inhouse slideshow&#8221; presentation supervisor (exemplified by this <a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/CHash\/XML\/index.php\" title=\"Click picture\">live run<\/a> link) reading of a slideshow_0.zip zip file &#8230; was done in &#8230;<\/li>\n<li><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=HTTP:\/\/www.rjmprogramming.com.au\/CHash\/XML\/job.ksh-----GETME\" title=\"job.ksh\">virtually an unchanged<\/a> <a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/CHash\/XML\/job.ksh-----GETME\" title=\"job.ksh\">job.ksh<\/a> (Korn shell) arrangement<\/li>\n<\/ul>\n<\/blockquote>\n<p>Here are <b>changes<\/b> we&#8217;ll be testing up at Google &#8230;<\/p>\n<p><code><br \/>\n&lt;head&gt;<br \/>\n&lt;script type='text\/javascript'&gt;<br \/>\n\/\/ Other Javascript code here ...<br \/>\n\/\/<br \/>\n\/\/<br \/>\n\/\/ Of relevance today <b>bold<\/b> below ...<br \/>\n<br \/>\n <b>function blater() {<br \/>\n var tdsare=document.getElementsByTagName('td');<br \/>\n var rectg=tdsare[2].getBoundingClientRect(); \/\/document.getElementById('i0').getBoundingClientRect();<br \/>\n tdsare[2].style.borderRight='2px solid white';<br \/>\n document.body.style.backgroundImage=\"URL('\" + document.getElementById('i0').src + \"')\";<br \/>\n var rl=eval('' + rectg.left);<br \/>\n rl+=eval('' + rectg.width);<br \/>\n rl+=10;<br \/>\n document.body.style.backgroundPosition=\" \" + rl + \"px \" + Math.floor(rectg.top) + \"px\";<br \/>\n document.body.style.backgroundRepeat=\"no-repeat\";<br \/>\n document.body.style.backgroundClip=\"content-box\";<br \/>\n }<\/b><br \/>\n<br \/> <br \/>\n function zoom_maybe() {<br \/>\n if (navigator.userAgent.match(\/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile\/i)) {<br \/>\n <b>\/\/<\/b>document.getElementById('rfs').innerHTML='&lt;style&gt; html { zoom: .5;  } &lt;\/style&gt;';<br \/>\n <b>document.getElementById('rfs').innerHTML='&lt;style&gt; html { zoom: 0.4;  body { max-width: 100%; max-height: 80vh; }  table { max-width: &lt;?php if (strpos($_SERVER['QUERY_STRING'],'exif=') !== false) {  echo \"100\"; } else { echo \"95\";  }  ?&gt;%; max-height: 80vh; margin: auto; overflow-x: hidden; }  &lt;\/style&gt;';<\/b><br \/>\n }<br \/>\n }<br \/>\n<br \/> <br \/>\n function nwpdf(iithis) {<br \/>\n if (('' + iithis.src).length &gt; 0) {<br \/>\n if (navigator.userAgent.match(\/iPhone|iPad|iPod\/i)) {<br \/>\n window.open(iithis.src,'_blank');<br \/>\n }<br \/>\n }<br \/>\n }<br \/>\n<br \/> <br \/>\n <b>function mytw() {<br \/>\n if (navigator.userAgent.match(\/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile\/i)) {<br \/>\n    document.body.style.width='' + (window.orientation == 0 ? Math.floor(eval(2.5 * window.screen.width)) : window.screen.height) + 'px';<br \/>\n    document.getElementById('myt').style.width='100%'; \/\/'' + (window.orientation == 0 ? window.screen.width : window.screen.height) + 'px';<br \/>\n }<br \/>\n }<\/b><br \/>\n<br \/> <br \/>\n window.setInterval(function(){havealook(1)},2000);<br \/>\n &lt;\/script&gt;<br \/>\n &lt;style&gt;<br \/>\n  td { vertical-align:top; }<br \/>\n  <b>@media only screen and (max-width: 800px) {<br \/>\n  body { max-width: 100%; max-height: 80vh; }  table { max-width: &lt;?php if (strpos($_SERVER['QUERY_STRING'],'exif=') !== false) {  echo \"100\"; } else { echo \"95\";  }  ?&gt;%; max-height: 80vh; margin: auto; overflow-x: hidden; }<br \/>\n  }<\/b><br \/>\n&lt;\/style&gt;<br \/>\n &lt;\/head&gt;<br \/>\n &lt;body onload=\" <b>mytw();<\/b> zoom_maybe(); if (document.URL.indexOf('pdf=') != -1) { document.getElementById('selmode').value='PDF Slideshow'; if (document.getElementById('tdfirst')) { document.getElementById('s0').style.width=document.getElementById('tdfirst').style.width; document.getElementById('s0').style.height=document.getElementById('tdfirst').style.height; } }  if (document.URL.indexOf('exif=') != -1) { document.getElementById('selmode').value='Exif Slideshow'; if (document.getElementById('tdfirst')) { document.getElementById('s0').style.width=document.getElementById('tdfirst').style.width; document.getElementById('s0').style.height=document.getElementById('tdfirst').style.height; } } document.title=document.title + ' ' + lastone; ol(); \"&gt;<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\/inhouse-slideshow-mobile-google-crawl-tutorial\/'>Inhouse Slideshow Mobile Google Crawl Tutorial<\/a>.<\/p-->\n<hr>\n<p id='ismt'>Previous relevant <a target=_blank title='Inhouse Slideshow Mobile Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/inhouse-slideshow-mobile-tutorial\/'>Inhouse Slideshow Mobile Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/CHash\/XML\/inhouse_slideshow_mobile.jpg\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Inhouse Slideshow Mobile Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/CHash\/XML\/inhouse_slideshow_mobile.jpg\" title=\"Inhouse Slideshow Mobile Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">Inhouse Slideshow Mobile Tutorial<\/p><\/div>\n<p>The recent <a title='PDF Slideshow and Form Creation Helper Slideshow Tutorial' href='#pdfsfchst'>PDF Slideshow and Form Creation Helper Slideshow Tutorial<\/a> changes were made on a MacBook Pro laptop.   Did it show that we have put off until today, to look at that functionality with mobile platforms?!<\/p>\n<p>In a &#8220;going off to the right table row of cells&#8221; arrangement like this, what are some considerations that improve the user experience (of our inhouse slideshows) for mobile platform users?<\/p>\n<ul>\n<li>turn the &#8220;@&#8221; link into an &#8220;emoji button&#8221; as per &#10145; ( &amp;#10145; )<\/li>\n<li>for both mobile and non-mobile, we&#8217;ve decided &#8230;\n<ol>\n<li>UTF-8 meta &#8230;<br \/>\n&lt;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;text\/html; charset=utf-8&#8243;&gt;\n<\/li>\n<li>\n<code><br \/>\n&lt;style&gt;<br \/>\n  td { vertical-align:top; }<br \/>\n&lt;\/style&gt;<br \/>\n<\/code>\n<\/li>\n<li>change the h4 element to be h2 to help with legibility<\/li>\n<\/ol>\n<li>for mobile, we&#8217;ve decided &#8230;\n<ol>\n<li>viewport &#8230;<br \/>\n&lt;meta name=&#8221;viewport&#8221; content=&#8221;width=device-width, initial-scale=0.4, minimum-scale=0.1, maximum-scale=8, user-scalable=yes&#8221;&gt;\n<\/li>\n<li>\n<code><br \/>\n&lt;style&gt;<br \/>\n html { zoom: .5;  }<br \/>\n&lt;\/style&gt;<br \/>\n<\/code>\n<\/li>\n<li>iOS (ie. iPad and iPhone) PDF iframe elements have known scrolling issues, which we decided to bypass by opening these PDF creations in a new webpage window<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<p>Deployment of these changes is similar to that last time, and the times before that, as per &#8230;<\/p>\n<blockquote cite='https:\/\/www.rjmprogramming.com.au\/ITblog\/inhouse-slideshow-design-exif-order-tutorial\/'>\n<p>Unit testing completed, the deployment, again, matches those ideas of the recent <a target=_blank title='PDF Slideshow and Form Creation Helper Slideshow Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/pdf-slideshow-and-form-creation-helper-slideshow-tutorial\/'>PDF Slideshow and Form Creation Helper Slideshow Tutorial<\/a> &#8230; in that &#8230;<\/p>\n<p><\/p>\n<ul>\n<li><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=HTTP:\/\/www.rjmprogramming.com.au\/CHash\/XML\/index.php-----GETME\" title=\"index.php\">the changed<\/a> <a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/CHash\/XML\/index.php-----GETME\" title=\"index.php\">index.php<\/a> new &#8220;inhouse slideshow&#8221; presentation supervisor (exemplified by this <a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/CHash\/XML\/index.php\" title=\"Click picture\">live run<\/a> link) reading of a slideshow_0.zip zip file &#8230; was done in &#8230;<\/li>\n<li><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=HTTP:\/\/www.rjmprogramming.com.au\/CHash\/XML\/job.ksh----GETME\" title=\"job.ksh\">virtually an unchanged<\/a> <a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/CHash\/XML\/job.ksh----GETME\" title=\"job.ksh\">job.ksh<\/a> (Korn shell) arrangement<\/li>\n<\/ul>\n<\/blockquote>\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\/inhouse-slideshow-mobile-tutorial\/'>Inhouse Slideshow Mobile Tutorial<\/a>.<\/p-->\n<hr>\n<p id='pdfsfchst'>Previous relevant <a target=_blank title='PDF Slideshow and Form Creation Helper Slideshow Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/pdf-slideshow-and-form-creation-helper-slideshow-tutorial\/'>PDF Slideshow and Form Creation Helper Slideshow Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/form_creator.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"PDF Slideshow and Form Creation Helper Slideshow Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/form_creator_slideshow.jpg\" title=\"PDF Slideshow and Form Creation Helper Slideshow Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">PDF Slideshow and Form Creation Helper Slideshow Tutorial<\/p><\/div>\n<p>The first &#8220;integration cab&#8221; off the rank for yesterday&#8217;s <a title='PDF Slideshow and Form Creation Helper Primer Tutorial' href='#pdfsfchpt'>PDF Slideshow and Form Creation Helper Primer Tutorial<\/a> underlying usefulness is with our Inhouse Slideshow arrangements last talked about at <a target=_blank href='https:\/\/www.rjmprogramming.com.au\/ITblog\/inhouse-slideshow-design-exif-order-tutorial\/' title='Inhouse Slideshow Design Exif Order Tutorial'>Inhouse Slideshow Design Exif Order Tutorial<\/a>.  That generic PHP code now has three display dropdown options of &#8230;<\/p>\n<ul>\n<li>Slideshow<\/li>\n<li>Exif Slideshow &#8230; and the new, as of today&#8217;s work &#8230;<\/li>\n<li>PDF Slideshow<\/li>\n<\/ul>\n<p> &#8230; that little bit different in that a PDF Slideshow occupies just the one table cell (rather than the many horizontal cells of the other display modes) and the resultant embedded PDF data vertically scrolls when multiple image slides are involved.<\/p>\n<p>This new option also adds onto this &#8220;Inhouse Slideshow&#8221; functionality the chance to download and keep a PDF representation of that slideshow to your local system.  Perhaps this makes this be of interest to you?!<\/p>\n<p><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/form_creator.php-GETME\" title=\"form_creator.php\">The changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/form_creator.php-GETME\" title=\"form_creator.php\">form_creator.php<\/a>&#8216;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/form_creator.php\" title=\"Click picture\">live run<\/a> is what gets integrated into the &#8220;Inhouse Slideshow&#8221; &#8220;sisterhood&#8221;.   We say &#8220;sisterhood&#8221; because this &#8220;Inhouse Slideshow&#8221; is designed as a single PHP codefile &#8220;hived off&#8221; to a lot of other web server folders as their default &#8220;index.php&#8221; web browser default webpage in a &#8220;peer to peer&#8221; feeling arrangement.  Such an arrangement asks a bit of the deployment arrangements, and we&#8217;ve talked about this before (with underlying links pointing to today&#8217;s work, should you be interested) &#8230;<\/p>\n<blockquote cite='https:\/\/www.rjmprogramming.com.au\/ITblog\/inhouse-slideshow-design-exif-order-tutorial\/'>\n<p>Unit testing completed, the deployment, again, matches those ideas of the recent <a title='Inhouse Slideshow Design Exif Zip Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/inhouse-slideshow-design-exif-zip-tutorial\/'>Inhouse Slideshow Design Exif Zip Tutorial<\/a> &#8230; in that &#8230;<\/p>\n<p><\/p>\n<ul>\n<li><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=HTTP:\/\/www.rjmprogramming.com.au\/CHash\/XML\/index.php----GETME\" title=\"index.php\">the changed<\/a> <a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/CHash\/XML\/index.php----GETME\" title=\"index.php\">index.php<\/a> new &#8220;inhouse slideshow&#8221; presentation supervisor (exemplified by this <a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/CHash\/XML\/index.php\" title=\"Click picture\">live run<\/a> link) reading of a slideshow_0.zip zip file &#8230; was done in &#8230;<\/li>\n<li><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=HTTP:\/\/www.rjmprogramming.com.au\/CHash\/XML\/job.ksh---GETME\" title=\"job.ksh\">virtually an unchanged<\/a> <a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/CHash\/XML\/job.ksh---GETME\" title=\"job.ksh\">job.ksh<\/a> (Korn shell) arrangement<\/li>\n<\/ul>\n<\/blockquote>\n<p>But when we say &#8220;Unit testing completed&#8221; above, we need to fill you in on a <a target=_blank title='Fpdf PHP class' href='HTTP:\/\/www.fpdf.org\/'>Fpdf<\/a> issue we came across during unit testing of our changes.  We were getting a &#8230;<\/p>\n<p><code><br \/>\nFPDF Error: Not a JPEG file<br \/>\n<\/code><\/p>\n<p> &#8230; Fpdf error message choosing the new &#8220;PDF Slideshow&#8221; option on some, but not all, &#8220;Inhouse Slideshow&#8221; address bar URLs.  And so the online research began as per &#8230;<\/p>\n<ul>\n<li><a target=_blank title='https:\/\/www.google.com\/search?q=FPDF+error%3A+Not+a+JPEG+file&#038;rlz=1C5CHFA_enAU832AU832&#038;oq=FPDF+error%3A+Not+a+JPEG+file&#038;aqs=chrome..69i57.622j0j4&#038;sourceid=chrome&#038;ie=UTF-8' href='https:\/\/www.google.com\/search?q=FPDF+error%3A+Not+a+JPEG+file&#038;rlz=1C5CHFA_enAU832AU832&#038;oq=FPDF+error%3A+Not+a+JPEG+file&#038;aqs=chrome..69i57.622j0j4&#038;sourceid=chrome&#038;ie=UTF-8'>FPDF error: Not a JPEG file &#8211; Google Search<\/a> &#8230; got us to reading &#8230;<\/li>\n<li><a target=_blank title='https:\/\/www.prestashop.com\/forums\/topic\/161687-fpdf-error-not-a-jpeg-file-mysiteimglogojpg\/' href='https:\/\/www.prestashop.com\/forums\/topic\/161687-fpdf-error-not-a-jpeg-file-mysiteimglogojpg\/'>FPDF error: Not a JPEG file: \/mysite\/img\/logo.jpg &#8211; Configuring and using PrestaShop &#8211; PrestaShop Forums<\/a><\/li>\n<li><a target=_blank title='https:\/\/stackoverflow.com\/questions\/41568423\/fpdf-error-not-a-jpeg-file-http-10-11-201-9381-webdocc-uploaded-tes3-jpg' href='https:\/\/stackoverflow.com\/questions\/41568423\/fpdf-error-not-a-jpeg-file-http-10-11-201-9381-webdocc-uploaded-tes3-jpg'>php &#8211; FPDF error: Not a JPEG file: http:\/\/10.11.201.93:81\/webdocc\/uploaded\/tes3.jpg &#8211; Stack Overflow<\/a><\/li>\n<\/ul>\n<p> &#8230; almost getting us there to a solution (and as far as the last link goes &#8220;that was before we posted the suggestion below&#8221;).  Then we took one of the error messages at its word &#8230;<\/p>\n<p><code><br \/>\nFPDF error: Not a JPEG file: ..\/Mac\/Linux_drutil-238of.jpg<br \/>\n<\/code><\/p>\n<p> &#8230; and independently looked into the issue via Linux (or macOS command line) <a target=_blank title='Linux file command information from computerhope' href='http:\/\/www.computerhope.com\/unix\/ufile.htm'>file<\/a> command &#8230;<\/p>\n<p><code><br \/>\n# cd $HOME\/public_html\/Mac<br \/>\n# ls -l Linux_dr*<br \/>\n-rw-r--r-- 1 owner group 724353 Oct 29 08:00 Linux_drutil-238of.jpg<br \/>\n-rw-r--r-- 1 owner group 132707 Oct 29 08:00 Linux_drutil-239of.jpg<br \/>\n-rw-r--r-- 1 owner group 109595 Oct 29 08:00 Linux_drutil-240of.jpg<br \/>\n# file Linux_drutil-238of.jpg<br \/>\nLinux_drutil-238of.jpg: PNG image data, 1280 x 800, 8-bit\/color RGBA, non-interlaced<br \/>\n# file Linux_drutil-239of.jpg<br \/>\nLinux_drutil-239of.jpg: JPEG image data, JFIF standard 1.01<br \/>\n#<br \/>\n<\/code><\/p>\n<p> &#8230; when the penny dropped (about our (macOS) Paintbrush slideshow slide creation habits)!  We quote our entry into &#8220;php &#8211; FPDF error: Not a JPEG file: http:\/\/10.11.201.93:81\/webdocc\/uploaded\/tes3.jpg &#8211; Stack Overflow&#8221; &#8230;<\/p>\n<blockquote cite='https:\/\/stackoverflow.com\/questions\/41568423\/fpdf-error-not-a-jpeg-file-http-10-11-201-9381-webdocc-uploaded-tes3-jpg'><p>\nHave found that constructing slideshows with Paintbrush on a MacBook Pro for years have sometimes been saving what &#8220;file jpeg_filename.jpg&#8221; determines is a PNG, as a JPEG, which is not the end of the world as far as the browsers go rendering this. Within FPDF&#8217;s fpdf.php I fixed my own shortcomings that were resulting in &#8220;FPDF Error: Not a JPEG file&#8221; via the kludgy &#8220;if($a[2]==3) { return $this-&gt;_parsepng($file); }&#8221; additional codeline below &#8230;<br \/>\n<br \/>\nfunction _parsejpg($file)<br \/>\n{<br \/>\n  \/\/ Extract info from a JPEG file<br \/>\n  $a = getimagesize($file);<br \/>\n  if(!$a)<br \/>\n    $this-&gt;Error(&#8216;Missing or incorrect image file: &#8216;.$file);<br \/>\n  if($a[2]==3) { return $this-&gt;_parsepng($file); }<br \/>\n  if($a[2]!=2)<br \/>\n    $this-&gt;Error(&#8216;Not a JPEG file: &#8216;.&#8217; &#8216;.$a[2].&#8217; &#8216;.$file);<br \/>\n  if(!isset($a[&#8216;channels&#8217;]) || $a[&#8216;channels&#8217;]==3)<br \/>\n    $colspace = &#8216;DeviceRGB&#8217;;<br \/>\n  elseif($a[&#8216;channels&#8217;]==4)<br \/>\n    $colspace = &#8216;DeviceCMYK&#8217;;<br \/>\n  else<br \/>\n    $colspace = &#8216;DeviceGray&#8217;;<br \/>\n  $bpc = isset($a[&#8216;bits&#8217;]) ? $a[&#8216;bits&#8217;] : 8;<br \/>\n  $data = file_get_contents($file);<br \/>\n  return array(&#8216;w&#8217;=&gt;$a[0], &#8216;h&#8217;=&gt;$a[1], &#8216;cs&#8217;=&gt;$colspace, &#8216;bpc&#8217;=&gt;$bpc, &#8216;f&#8217;=&gt;&#8217;DCTDecode&#8217;, &#8216;data&#8217;=&gt;$data);<br \/>\n}\n<\/p><\/blockquote>\n<p> &#8230; and this change to Fpdf&#8217;s fpdf.php fixed the issue in our case for a lot of our previously erroneous &#8220;PDF Slideshow&#8221; displays of &#8220;Inhouse Slideshows&#8221;.<\/p>\n<hr>\n<p id='pdfsfchpt'>Previous relevant <a target=_blank title='PDF Slideshow and Form Creation Helper Primer Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/pdf-slideshow-and-form-creation-helper-primer-tutorial\/'>PDF Slideshow and Form Creation Helper 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\/PHP\/form_creator.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"PDF Slideshow and Form Creation Helper Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/form_creator.jpg\" title=\"PDF Slideshow and Form Creation Helper Primer Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">PDF Slideshow and Form Creation Helper Primer Tutorial<\/p><\/div>\n<p>Our recent work involving the great <a target=_blank title='Fpdf PHP class' href='HTTP:\/\/www.fpdf.org\/'>Fpdf<\/a> creator of PDF files when we presented <a target=_blank href='https:\/\/www.rjmprogramming.com.au\/ITblog\/ajax-formdata-object-no-body-php-pdf-tutorial\/' title='Ajax FormData Object No Body PHP PDF Tutorial'>Ajax FormData Object No Body PHP PDF Tutorial<\/a> has got us starting on a new PDF (PHP) web application we are starting out thinking will help with &#8230;<\/p>\n<ul>\n<li>online forms (probably via thinking in terms of <a target=_blank title='Fpdf PHP class' href='HTTP:\/\/www.fpdf.org\/'>Fpdf<\/a> open source programmers like <a target=_blank title='Useful link' href='HTTP:\/\/www.fpdf.org\/en\/script\/script50.php' title='Rick van Buuren and Cl\u00e9ment Lavoillotte Fdf code, thanks'>Rick van Buuren and Cl\u00e9ment Lavoillotte<\/a>&#8216;s excellent HTML table rendering ideas) via HTML table intermediate user interactions &#8230; and &#8230;<\/li>\n<li>slideshows<\/li>\n<\/ul>\n<p> &#8230; but we will not be surprised if the project branches out into other ideas.  We&#8217;ll see over time.<\/p>\n<p>We hope you come along for the trip starting with a bit of a proof of concept <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/form_creator.php_GETME\" title=\"form_creator.php\">form_creator.php<\/a>&#8216;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/form_creator.php\" title=\"Click picture\">live run<\/a> for you to try, where we allow you to enter (and be able to change) some HTML table code (if that&#8217;s what you end up with?!) in a pink HTML textarea element, and that will become PDF should you click the underlying HTML form&#8217;s yellow submit button.<\/p>\n<p>Hope to see you for tomorrow&#8217;s PDF writing developments here.<\/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='#d46998' onclick='var dv=document.getElementById(\"d46998\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/form\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d46998' 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='#d47030' onclick='var dv=document.getElementById(\"d47030\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/integration\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d47030' 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='#d47147' onclick='var dv=document.getElementById(\"d47147\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/mobile\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d47147' 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='#d47206' onclick='var dv=document.getElementById(\"d47206\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/width\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d47206' 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='#d55579' onclick='var dv=document.getElementById(\"d55579\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/diskspace\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d55579' 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='#d55585' onclick='var dv=document.getElementById(\"d55585\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/glob\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d55585' 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='#d55579' onclick='var dv=document.getElementById(\"d55579\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/diskspace\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d55579' 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='#d55591' onclick='var dv=document.getElementById(\"d55591\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/wordpress\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d55591' 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='#d57917' onclick='var dv=document.getElementById(\"d57917\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/crontab\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d57917' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Crontab is that great scheduling tool that we make use of, a lot, on our RJM Programming Linux CentOS web server. But it&#8217;s not only &#8230; the timing &#8230; of a procedure that is so good about crontab &#8230; it &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/inhouse-slideshow-backup-tidy-up-crontab-curl-php-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,29,37],"tags":[195,272,274,284,418,1752,707,4197,3440,914,932,2738,4194,997,4195,1893,3945,4196,1319,1411],"class_list":["post-57917","post","type-post","status-publish","format-standard","hentry","category-elearning","category-operating-system","category-tutorials","tag-centos","tag-cron","tag-crontab","tag-curl","tag-file","tag-inode","tag-linux","tag-maintenance","tag-peer","tag-peer-to-peer","tag-php","tag-procedure","tag-programmin","tag-programming","tag-schediuled","tag-schedule","tag-tidy","tag-tidy-up","tag-tutorial","tag-web-server"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/57917"}],"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=57917"}],"version-history":[{"count":3,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/57917\/revisions"}],"predecessor-version":[{"id":57920,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/57917\/revisions\/57920"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=57917"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=57917"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=57917"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}