/dev/null | head -1 > " . dirname(__FILE__) . "/" . "find_images_via_size.err"); if (file_exists(dirname(__FILE__) . "/" . "find_images_via_size.err")) { $pb=file_get_contents(dirname(__FILE__) . "/" . "find_images_via_size.err"); if ($pb == "") { $pb="//www.rjmprogramming.com.au/PHP/animegif/tutorial_to_animated_gif.php"; } else { $pb=str_replace("/./","/","http://" . $_SERVER['SERVER_NAME'] . "" . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "" . str_replace("find_images_via_size.php","",explode("#",explode("?",$_SERVER['REQUEST_URI'])[0])[0]) . $pb); } } } if (file_exists("read_exif_off_image_rotate.php")) { $exif="./read_exif_off_image_rotate.php"; $exif=str_replace("/./","/","http://" . $_SERVER['SERVER_NAME'] . "" . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "" . str_replace("find_images_via_size.php","",explode("#",explode("?",$_SERVER['REQUEST_URI'])[0])[0]) . $exif); } else { if (file_exists(dirname(__FILE__) . "/" . "find_images_via_size.err")) { unlink(dirname(__FILE__) . "/" . "find_images_via_size.err"); } exec("find . -name 'read_exif_off_image_rotate.php' 2>/dev/null | head -1 > " . dirname(__FILE__) . "/" . "find_images_via_size.err"); if (file_exists(dirname(__FILE__) . "/" . "find_images_via_size.err")) { $exif=file_get_contents(dirname(__FILE__) . "/" . "find_images_via_size.err"); if ($pb == "") { $exif="//www.rjmprogramming.com.au/PHP/read_exif_off_image_rotate.php"; } else { $exif=str_replace("/./","/","http://" . $_SERVER['SERVER_NAME'] . "" . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "" . str_replace("find_images_via_size.php","",explode("#",explode("?",$_SERVER['REQUEST_URI'])[0])[0]) . $exif); } } } } } } $headscr=" var ihelper=''; var fhelper=''; var agifs=[]; var bgifs=[]; var agifsuff=''; var leftpos=-1, widthv=-1; var gscrollTop=0, gscrollLeft=0; function adjustperhaps(ov) { var vhs=[], pcs=[], rect; if (('' + ov.id + ' ').toLowerCase().substring(0,1) == 'h') { rect=document.body.getBoundingClientRect(); vhs=('' + ov.value + ' ').toLowerCase().split('v'); pcs=('' + ov.value + ' ').toLowerCase().split('%'); if (pcs.length > 1) { ov.value='' + Math.round(eval(eval(('' + rect.height)) * eval(('' + pcs[0])) / 100.0)); } else if (vhs.length > 1) { ov.value='' + Math.round(eval(eval(('' + rect.height)) * eval(('' + vhs[0])) / 100.0)); } } else { rect=document.body.getBoundingClientRect(); pcs=('' + ov.value + ' ').toLowerCase().split('%'); if (pcs.length > 1) { ov.value='' + Math.round(eval(eval(('' + rect.width)) * eval(('' + pcs[0])) / 100.0)); } } } function scrollxy(idocument) { //var idocument=document.getElementById('ijigsaw'); idocument=document.body; var retval='0,0'; if (gscrollTop != 0 || gscrollLeft != 0) { return (gscrollLeft + ',' + gscrollTop); } else if (idocument.offsetTop) { //document.title=(idocument.offsetLeft + ',' + idocument.offsetTop); return (idocument.offsetLeft + ',' + idocument.offsetTop); } else if (idocument.scrollTop) { //document.title=(idocument.scrollLeft + ',' + idocument.scrollTop); return (idocument.scrollLeft + ',' + idocument.scrollTop); } else if (idocument.scrollingElement) { if (idocument.scrollingElement.scrollTop) { //document.title=(idocument.scrollingElement.scrollLeft + ',' + idocument.scrollingElement.scrollTop); return (idocument.scrollingElement.scrollLeft + ',' + idocument.scrollingElement.scrollTop); } if (idocument.documentElement.scrollTop) { //document.title=(idocument.documentElement.scrollLeft + ',' + idocument.documentElement.scrollTop); return (idocument.documentElement.scrollLeft + ',' + idocument.documentElement.scrollTop); } } //document.title=retval; return retval; } function toh(ins) { if (ins.toLowerCase().indexOf('//') == 0) { return 'http:' + ins; } else if (ins.toLowerCase().indexOf('http') == 0) { return ins; } else { return document.URL.split('#')[0].split('?')[0].replace('find_images_via_size.php', ins).replace('/./','/'); } } function gothere(insel) { if (insel.value != '') { var thisurl='', lookfor='', rects, overrect; var hrefs=document.getElementById(insel.id.replace('sel','')).innerHTML.split(' href='); if (hrefs.length > 1) { if (leftpos < 0) { overrect=document.body.getBoundingClientRect(); if (document.getElementById('mydetails')) { document.getElementById('mydetails').setAttribute('open',true); } rects=document.getElementById('rhth').getBoundingClientRect(); leftpos=Math.floor(8 + eval(eval(('' + rects.left).replace('px','')) + eval(('' + rects.width).replace('px','')))); widthv=eval(('' + overrect.width).replace('px','')); widthv-=leftpos; } rects=insel.getBoundingClientRect(); thisurl=hrefs[1].substring(1).split(hrefs[1].substring(0,1))[0]; lookfor=thisurl; //alert(lookfor + ' via ' + hrefs[1]); if (thisurl.indexOf('/../') != -1) { lookfor='/' + thisurl.split('/../')[eval(-1 + thisurl.split('/../').length)]; } //alert(lookfor); lookfor=lookfor.replace(/\/\.\//g,'/'); //alert(lookfor); while (lookfor.substring(0,1) == '.') { lookfor=lookfor.substring(1); } //alert(lookfor); if (insel.value.toLowerCase().indexOf('exif') != -1) { document.getElementById('rightif').src='" . $exif . "?image=' + encodeURIComponent(toh(thisurl)); //document.getElementById('rightif').src='./find_images_via_size.php/?image=' + encodeURIComponent(thisurl); //alert(11); document.getElementById('rightif').style.position='absolute'; //alert(111); document.getElementById('rightif').style.width='' + widthv + 'px'; document.getElementById('rightif').style.height='100vh'; document.getElementById('rightif').style.left='' + leftpos + 'px'; //alert(leftpos); document.getElementById('rightif').style.top='' + Math.floor(-120 + eval(eval(('' + rects.top).replace('px','')) + eval(scrollxy(insel).split(',')[1].replace('px','')))) + 'px'; //alert(document.getElementById('rightif').style.top); document.getElementById('rightif').style.display='block'; //alert(document.getElementById('rightif').outerHTML); } else if (insel.value.toLowerCase().indexOf('blog') != -1) { //alert(lookfor); document.getElementById('rightif').src='//www.rjmprogramming.com.au/ITblog/?s=' + encodeURIComponent(lookfor); //document.getElementById('rightif').src='./find_images_via_size.php/?s=' + encodeURIComponent(lookfor); document.getElementById('rightif').style.position='absolute'; document.getElementById('rightif').style.width='' + widthv + 'px'; document.getElementById('rightif').style.height='100vh'; document.getElementById('rightif').style.left='' + leftpos + 'px'; document.getElementById('rightif').style.top='' + Math.floor(-120 + eval(eval(('' + rects.top).replace('px','')) + eval(scrollxy(insel).split(',')[1].replace('px','')))) + 'px'; document.getElementById('rightif').style.display='block'; } else if (insel.value.toLowerCase().indexOf('gif') != -1) { document.getElementById(insel.id.replace('selt','wt')).click(); } } insel.value=''; } } function setsel() { document.getElementById('gifsel').value=''; gifpress(document.getElementById('gifsel')); } function gifpress(oselgif) { if (oselgif.value != '') { var overrect; if (leftpos < 0) { overrect=document.body.getBoundingClientRect(); if (document.getElementById('mydetails')) { document.getElementById('mydetails').setAttribute('open',true); } rects=document.getElementById('rhth').getBoundingClientRect(); leftpos=Math.floor(8 + eval(eval(('' + rects.left).replace('px','')) + eval(('' + rects.width).replace('px','')))); widthv=eval(('' + overrect.width).replace('px','')); widthv-=leftpos; } document.getElementById('rightif').style.position='absolute'; document.getElementById('rightif').style.top='300px'; document.getElementById('rightif').style.left='' + leftpos + 'px'; document.getElementById('rightif').style.width='' + widthv + 'px'; document.getElementById('rightif').style.height='100vh'; document.getElementById('rightif').style.display='block'; for (var ki=0; ki'; } else { aurl=document.getElementById('t' + another).innerHTML.split(' href=')[1].substring(1).split(document.getElementById('t' + another).innerHTML.split(' href=')[1].substring(0,1))[0]; //alert(another + ': ' + agifsuff + '; ' + aurl); if (aurl.toLowerCase().indexOf('//') == 0) { document.getElementById('slideshow' + agifsuff).value='http:' + aurl; } else if (aurl.toLowerCase().indexOf('http') == 0) { document.getElementById('slideshow' + agifsuff).value=aurl; } else if (aurl.toLowerCase().indexOf('./') == 0) { //document.getElementById('slideshow' + agifsuff).value='.' + aurl; //(document.URL.split('find_images_via_size.')[0] + aurl.substring(2)).replace('https:','http:'); document.getElementById('slideshow' + agifsuff).value=(document.URL.split('find_images_via_size.')[0] + aurl.substring(2)).replace('https:','http:'); } else if (aurl.toLowerCase().indexOf('../') == 0) { //document.getElementById('slideshow' + agifsuff).value='../' + aurl; //(document.URL.split('find_images_via_size.')[0] + aurl.substring(2)).replace('https:','http:'); document.getElementById('slideshow' + agifsuff).value=(document.URL.split('find_images_via_size.')[0] + aurl.substring(2)).replace('https:','http:'); } else { document.getElementById('slideshow' + agifsuff).value=(document.URL.split('find_images_via_size.')[0] + aurl).replace('/PHP/../','/').replace('https:','http:'); } agifs.push(\"document.getElementById('slideshow\" + agifsuff + \"').value='\" + document.getElementById('slideshow' + agifsuff).value + \"';\"); bgifs.push(\"document.getElementById('wt\" + another + \"').style.backgroundColor='white';\"); bgifs.push(\"document.getElementById('t\" + another + \"').style.backgroundColor='white';\"); agifsuff='' + eval(1 + eval('' + agifsuff)); document.getElementById('readyfor' + agifsuff).innerHTML=ihelper.replace(/slideshow/g, 'slideshow' + agifsuff) + '
'; } } function xit() { var tds=document.getElementsByTagName('td'); for (var itd=0; itd\"; } } }
"; $isIE=false; $detpref=""; $detsuff=""; if (!isset($argc)) { $arr_browsers = ["MSIE", "Edge"]; // thanks to https://artisansweb.net/detect-browser-php-javascript/ $agent = $_SERVER['HTTP_USER_AGENT']; foreach ($arr_browsers as $browser) { if (strpos($agent, $browser) !== false) { $detpref=""; $detsuff=""; $isIE=true; break; } } } else { $detpref=""; $detsuff=""; } $wo="=="; $wv="500"; $ho="=="; $hv="500"; $p="."; $f="*.*g*"; $ws=""; $hs=""; $fs=""; function valit($inname, $indef) { global $scriptis, $detpref, $detsuff, $formis, $onl, $tablep, $tables, $postbody, $reverse, $filedelim, $pb, $wo, $wv, $ho, $hv, $p, $f, $ws, $hs, $fs, $argc, $argv; $cmd="php \"" . dirname(__FILE__) . $filedelim . "find_images_via_size.php\""; if (!isset($argc)) { if (isset($_GET[$inname])) { $tablep="
"; $tables="
"; //$postbody=""; $onl=" onload=xit();"; if ($formis == "" && $detpref == strtoupper($detpref) && $detpref != "") { $detpref=strtolower($detpref); $detsuff=strtolower($detsuff); $formis=str_replace("", "Image Find Parameters",$detpref); if ($scriptis == "") { $scriptis="
" . strtolower($detsuff); } } else { $detpref=""; $detsuff=""; } if ($inname == "wo" || $inname == "ho" || $inname == "wsort" || $inname == "hsort" || $inname == "fsort") { if ($scriptis == "") { $scriptis=" " . strtolower($detsuff); } $scriptis=str_replace(" or <= or >= or != ")); if ($aline == "") { $cmd.=" -weq "; } else { $cmd.=str_replace("="," -weq ", str_replace(">"," -wgt ", str_replace("<"," -wlt ", str_replace(">="," -wge ", str_replace("<="," -wle ", str_replace("!="," -wne ", $aline)))))); } $aline = str_replace("\n","",readline("Enter width value [" . $wv . "] ")); if ($aline == "") { $cmd.=" " . $wv . " "; } else { $cmd.=" " . $aline . " "; } $aline = str_replace("\n","",readline("Enter height operator as [" . str_replace("==","=",$ho) . "] or < or > or <= or >= or != ")); if ($aline == "") { $cmd.=" -heq "; } else { $cmd.=str_replace("="," -heq ", str_replace(">"," -hgt ", str_replace("<"," -hlt ", str_replace(">="," -hge ", str_replace("<="," -hle ", str_replace("!="," -hne ", $aline)))))); } $aline = str_replace("\n","",readline("Enter height value [" . $hv . "] ")); if ($aline == "") { $cmd.=" " . $hv . " "; } else { $cmd.=" " . $aline . " "; } $cmd=str_replace(" "," ",$cmd); //echo $cmd; //exit; passthru($cmd); exit; } else if ($inname == '') { $lasthw="w"; for ($i=1; $i"," -wgt ", str_replace("<"," -wlt ", str_replace(">="," -wge ", str_replace("<="," -wle ", str_replace("!="," -wne ", $wo)))))); } else if ($inname == 'wv') { return $wv; } else if ($inname == 'wsort') { return $ws; } else if ($inname == 'ho') { return $ho; //str_replace("="," -weq ", str_replace(">"," -wgt ", str_replace("<"," -wlt ", str_replace(">="," -wge ", str_replace("<="," -wle ", str_replace("!="," -wne ", $wo)))))); } else if ($inname == 'hv') { return $hv; } else if ($inname == 'hsort') { return $hs; } else if ($inname == 'fsort') { return $fs; } else if ($inname == 'filespec') { return $f; } else if ($inname == 'path') { return $p; } return $indef; } if (isset($argc)) { if ($argc < 2) { valit('wo', ''); exit; } else { valit('',''); } } function huhit($ct) { $bits=explode("\n", $ct); $retct=""; for ($ir=0; $ir 1) { $subsub=explode("href=", $subbits[1]); $retct.=",'" . $ir . "');\tclass=widthtd\tid=wt". $ir . ">" . $subbits[0] . ""; $formis.="
" . $tablep . "" . $datais . "
Relative PathFilespec Width OperatorWidth Height OperatorHeight
" . $tables . "

 
"; $formis.=$scriptis; $htmlis="". $headscr ."Find Images Via Size - RJM Programming - October, 2019

Find Images Via Size RJM Programming - October, 2019

" . $formis . "

" . $postbody . ""; $lastsed=""; if (PHP_OS=='WINNT' || PHP_OS=='WIN32' || PHP_OS=='Windows') { $lastsed=" | sed 's/\\(\\ \\)\\(\\.[^\\<]*\\)/\\ \\\\\\<\\/img\\>\\2\\<\\/a\\>/g' "; } else { $lastsed=" | sed 's/\\(\\ \\)\\(\\.[^\\<]*\\)/\\ \\\\\\<\\/img\\>\\2\\<\\/a\\>/g' "; } // | sed '/\\\\ \\\\.[^\\\\<]*/s//\\\\1/g' // | sed '/\\\\(\\\\ \\\\)\\\\(\\\\.[^\\\\<]*\\\\)/s// \\\\2\\\\<\\\\/a\\\\>/g' // ksh -c "echo '123 x 567 ./x.x' | sed '/\\(\\ \\)\\(\\.[^\\<]*\\)/s// \\2\\<\\/a\\>/g' " // JPEG image is 1280w * 800h, 3 color components, 8 bits per sample JPEG process: Baseline // googlewifi.png: PNG image data, 2880 x 1800, 8-bit/color RGBA, non-interlaced if (isset($_GET['filespec'])) { //$cf="find " . (str_replace("+"," ",$_GET['path'])) . " -name '" . str_replace("+"," ",$_GET['filespec']) . "' -exec file {} \; | grep ' image data' | sed 's/JFIF standard 1.01, aspect ratio, //g' | sed 's/\(." . explode(".",str_replace("+"," ",$_GET['filespec']))[1] . "\): .* \([0-9]* x [0-9]*\).*/\\2 \\1/' | awk 'int($1) " . str_replace("+"," ",$_GET['wo']) . " " . str_replace("+"," ",$_GET['wv']) . " && int($3) " . str_replace("+"," ",$_GET['ho']) . " " . str_replace("+"," ",$_GET['hv']) . " {print}' | sed 's/\\(\\ \\)\\(\\.[^\\<]*\\)/\\ \\\\2\\<\\/a\\>/g'"; //echo 'cd ' . dirname(__FILE__) . '; ' . $cf . ''; $appbit=""; $grepv=""; $cf3=""; if (str_replace("+"," ",urldecode($_GET['fsort'])) != "" || str_replace("+"," ",urldecode($_GET['wsort'])) != "" || str_replace("+"," ",urldecode($_GET['hsort'])) != "" || PHP_OS=='WINNT' || PHP_OS=='WIN32' || PHP_OS=='Windows') { $huh=""; $littlehuh=""; foreach (glob(str_replace("+"," ",urldecode($_GET['path'])) . $filedelim . str_replace("+"," ",urldecode($_GET['filespec']))) as $filename) { try { list($width, $height, $type, $attr) = getimagesize($filename); if ($width != "" && $height != "") { // 3200 x 460 ./Htdocs/ITblog/wp-content/themes/twentythirteen/images/headers/star.png $yes=false; eval("\$yes=(" . $width . " " . str_replace("+"," ",urldecode($_GET['wo'])) . " " . str_replace("+"," ",urldecode($_GET['wv'])) . " && " . $height . " " . str_replace("+"," ",urldecode($_GET['ho'])) . " " . str_replace("+"," ",urldecode($_GET['hv'])) . ");"); if ($yes) { if (str_replace("+"," ",urldecode($_GET['fsort'])) != "" || str_replace("+"," ",urldecode($_GET['wsort'])) != "" || str_replace("+"," ",urldecode($_GET['hsort'])) != "" || PHP_OS=='WINNT' || PHP_OS=='WIN32' || PHP_OS=='Windows') { if (str_replace("+"," ",urldecode($_GET['fsort'])) != "") { if (strpos(str_replace("+"," ",urldecode($_GET['fsort'])), "-r") !== false) { $reverse=true; } $huh.=$width . ' x ' . $height . " " . "" . $filename . "\n"; $littlehuh.="" . $filename . "~~" . $width . ' x ' . $height . " " . "" . $filename . "\n"; } else if (str_replace("+"," ",urldecode($_GET['hsort'])) != "") { if (strpos(str_replace("+"," ",urldecode($_GET['hsort'])), "-r") !== false) { $reverse=true; } $huh.=$width . ' x ' . $height . " " . "" . $filename . "\n"; $littlehuh.=str_pad($height,20,"0",STR_PAD_LEFT) . "~~" . $width . ' x ' . $height . " " . "" . $filename . "\n"; } else if (str_replace("+"," ",urldecode($_GET['wsort'])) != "") { if (strpos(str_replace("+"," ",urldecode($_GET['wsort'])), "-r") !== false) { $reverse=true; } $huh.=$width . ' x ' . $height . " " . "" . $filename . "\n"; $littlehuh.=str_pad($width,20,"0",STR_PAD_LEFT) . "~~" . $width . ' x ' . $height . " " . "" . $filename . "\n"; } else { $huh.=$width . ' x ' . $height . " " . "" . $filename . "\n"; $littlehuh=$huh; } } else { $huh.=$width . ' x ' . $height . " " . "" . $filename . "\n"; $littlehuh=$huh; } } } } catch (Exception $ewe) { } } if ($huh != $littlehuh) { file_put_contents(dirname(__FILE__) . $filedelim . "find_images_via_size.ttt", $littlehuh); $lines=file(dirname(__FILE__) . $filedelim . "find_images_via_size.ttt"); if ($reverse) { rsort($lines); //, SORT_STRING); } else { sort($lines); //, SORT_STRING); } $huh=""; foreach ($lines as $key => $val) { $huh.=str_replace("\n","",explode("~~", $val)[1]) . "\n"; } file_put_contents(dirname(__FILE__) . $filedelim . "find_images_via_size.txt", $huh); } else { file_put_contents(dirname(__FILE__) . $filedelim . "find_images_via_size.txt", $huh); } //echo $huh; //exit; //$cf="find " . (str_replace("+"," ",$_GET['path'])) . " -name '" . str_replace("+"," ",$_GET['filespec']) . "' -exec file {} \; | sed '/\ precision\ [0-9]*\, /s//`/g' | grep ' image data' | sed 's/\(JFIF [^\`]*\)`\([0-9]*\)x\([0-9]*\)/\\2 x \\3/g' | sed 's/\(." . "[^\ ]*" . "\): .* \([0-9]* x [0-9]*\).*/\\2 \\1/' | awk 'int($1) " . str_replace("+"," ",$_GET['wo']) . " " . valit('wv',str_replace("+"," ",$_GET['wv'])) . " && int($3) " . str_replace("+"," ",$_GET['ho']) . " " . valit('hv',str_replace("+"," ",$_GET['hv'])) . " {print}' " . $sortbit . $lastsed . " > " . dirname(__FILE__) . substr("\\",0,1) . "find_images_via_size.txt 2> " . dirname(__FILE__) . substr("\\",0,1) . "find_images_via_size.err"; //exec('cd ' . dirname(__FILE__) . '; ' . $cf . ''); //find ' . (str_replace("+"," ",$_GET['path'])) . " -name '" . str_replace("+"," ",$_GET['filespec']) . "' -exec file {} \\; | grep ' image data' | sed 's/\\(." . explode(".",str_replace("+"," ",$_GET['filespec']))[1] . "\\): .* \\([0-9]* x [0-9]*\\).*/\\2 \\1/' | awk 'int($1) " . str_replace("+"," ",$_GET['wo']) . " " . str_replace("+"," ",$_GET['wv']) . " && int($3) " . str_replace("+"," ",$_GET['ho']) . " " . str_replace("+"," ",$_GET['hv']) . " {print}' | sed 's/\\(\\ \\)\\(\\.[^\\<]*\\)/\\ \\\\2\\<\\/a\\>/g' > " . dirname(__FILE__) . substr("\\",0,1) . "find_images_via_size.txt 2> " . dirname(__FILE__) . substr("\\",0,1) . "find_images_via_size.err"); } else { // | sed '/\\\\ \\\\.[^\\\\<]*/s/\\\\1/g' $cf=""; if (file_exists(dirname(__FILE__) . "/" . "find_images_via_size.ttt")) { unlink(dirname(__FILE__) . "/" . "find_images_via_size.ttt"); } if (file_exists("/usr/bin/rdjpgcom")) { $cf3='cat ' . dirname(__FILE__) . "/" . "find_images_via_size.ttt " . $sortbit . $lastsed . " > " . dirname(__FILE__) . "/" . "find_images_via_size.txt"; $appbit=">"; $grepv=" | grep -v 'JPEG image' "; $cf="find " . (str_replace("+"," ",urldecode($_GET['path']))) . " -name '" . str_replace("+"," ",$_GET['filespec']) . "' -exec echo {}: \; -exec /usr/bin/rdjpgcom -verbose {} \; | egrep -i 'JPEG image|.jp' | tr \"\\n\" \" \" | sed 's/w\ [*]\ / x /g' | sed 's/h[\,]/,/g' | sed 's/image\ is\ /image data, /g' | grep ' image data' | sed 's/\(.[^\ ]*\): .* \([0-9]* x [0-9]*\).*/\\2 \\1/' | awk 'int($1) " . str_replace("+"," ",urldecode($_GET['wo'])) . " " . valit('wv',str_replace("+"," ",$_GET['wv'])) . " && int($3) " . str_replace("+"," ",$_GET['ho']) . " " . valit('hv',str_replace("+"," ",$_GET['hv'])) . " {print}' | tee " . dirname(__FILE__) . "/" . "find_images_via_size.ttt " . $sortbit . $lastsed . " > " . dirname(__FILE__) . "/" . "find_images_via_size.txt 2> " . dirname(__FILE__) . "/" . "find_images_via_size.err"; } else if (file_exists("/usr/local/bin/rdjpgcom")) { $cf3='cat ' . dirname(__FILE__) . "/" . "find_images_via_size.ttt " . $sortbit . $lastsed . " > " . dirname(__FILE__) . "/" . "find_images_via_size.txt"; $appbit=">"; $grepv=" | grep -v 'JPEG image' "; $cf="find " . (str_replace("+"," ",urldecode($_GET['path']))) . " -name '" . str_replace("+"," ",urldecode($_GET['filespec'])) . "' -exec echo {}: \; -exec /usr/local/bin/rdjpgcom -verbose {} \; | egrep -i 'JPEG image|.jp' | tr \"\\n\" \" \" | sed 's/w\ [*]\ / x /g' | sed 's/h[\,]/,/g' | sed 's/image\ is\ /image data, /g' | grep ' image data' | sed 's/\(.[^\ ]*\): .* \([0-9]* x [0-9]*\).*/\\2 \\1/' | awk 'int($1) " . str_replace("+"," ",urldecode($_GET['wo'])) . " " . valit('wv',str_replace("+"," ",$_GET['wv'])) . " && int($3) " . str_replace("+"," ",urldecode($_GET['ho'])) . " " . valit('hv',str_replace("+"," ",$_GET['hv'])) . " {print}' | tee " . dirname(__FILE__) . "/" . "find_images_via_size.ttt " . $sortbit . $lastsed . " > " . dirname(__FILE__) . "/" . "find_images_via_size.txt 2> " . dirname(__FILE__) . "/" . "find_images_via_size.err"; } $cf2="find " . (str_replace("+"," ",urldecode($_GET['path']))) . " -name '" . str_replace("+"," ",urldecode($_GET['filespec'])) . "' -exec file {} \; " . $grepv . " | sed '/\ precision\ [0-9]*\, /s//`/g' | grep ' image data' | sed 's/\(JFIF [^\`]*\)`\([0-9]*\)x\([0-9]*\)/\\2 x \\3/g' | sed 's/\(.[^\ ]*\): .* \([0-9]* x [0-9]*\).*/\\2 \\1/' | awk 'int($1) " . str_replace("+"," ",urldecode($_GET['wo'])) . " " . valit('wv',str_replace("+"," ",$_GET['wv'])) . " && int($3) " . str_replace("+"," ",urldecode($_GET['ho'])) . " " . valit('hv',str_replace("+"," ",$_GET['hv'])) . " {print}' | tee -a " . dirname(__FILE__) . "/" . "find_images_via_size.ttt " . $sortbit . $lastsed . " >" . $appbit . " " . dirname(__FILE__) . "/" . "find_images_via_size.txt 2>" . $appbit . " " . dirname(__FILE__) . "/" . "find_images_via_size.err"; //echo 'cd ' . dirname(__FILE__) . '; ' . str_replace("<","<",str_replace(">",">",$cf)) . '; ' . str_replace("<","<",str_replace(">",">",$cf2)) . ''; //exit; if ($cf != "") { exec('cd ' . dirname(__FILE__) . '; ' . $cf .''); //find ' . (str_replace("+"," ",$_GET['path'])) . " -name '" . str_replace("+"," ",$_GET['filespec']) . "' -exec file {} \\; | grep ' image data' | sed 's/JFIF standard 1.01, aspect ratio, //g' | sed 's/\\(." . explode(".",str_replace("+"," ",$_GET['filespec']))[1] . "\\): .* \\([0-9]* x [0-9]*\\).*/\\2 \\1/' | awk 'int($1) " . str_replace("+"," ",$_GET['wo']) . " " . str_replace("+"," ",$_GET['wv']) . " && int($3) " . str_replace("+"," ",$_GET['ho']) . " " . str_replace("+"," ",$_GET['hv']) . " {print}' | sed 's/\\(\\ \\)\\(\\.[^\\<]*\\)/\\ \\\\2\\<\\/a\\>/g' > " . dirname(__FILE__) . "/" . "find_images_via_size.txt 2> " . dirname(__FILE__) . "/" . "find_images_via_size.err"); if (!file_exists(dirname(__FILE__) . "/" . "find_images_via_size.ttt")) { $cf3=""; $appbit=""; $grepv=""; } } //passthru("cat find_images_via_size.txt"); //exit; exec('cd ' . dirname(__FILE__) . '; ' . $cf2 .''); //find ' . (str_replace("+"," ",$_GET['path'])) . " -name '" . str_replace("+"," ",$_GET['filespec']) . "' -exec file {} \\; | grep ' image data' | sed 's/JFIF standard 1.01, aspect ratio, //g' | sed 's/\\(." . explode(".",str_replace("+"," ",$_GET['filespec']))[1] . "\\): .* \\([0-9]* x [0-9]*\\).*/\\2 \\1/' | awk 'int($1) " . str_replace("+"," ",$_GET['wo']) . " " . str_replace("+"," ",$_GET['wv']) . " && int($3) " . str_replace("+"," ",$_GET['ho']) . " " . str_replace("+"," ",$_GET['hv']) . " {print}' | sed 's/\\(\\ \\)\\(\\.[^\\<]*\\)/\\ \\\\2\\<\\/a\\>/g' > " . dirname(__FILE__) . "/" . "find_images_via_size.txt 2> " . dirname(__FILE__) . "/" . "find_images_via_size.err"); if ($sortbit != "" && $lastsed != "" && $appbit != "" && $cf3 != "") { exec('cd ' . dirname(__FILE__) . '; ' . $cf3 . ''); } } // //passthru("find " . str_replace("+"," ",$_GET['path']) . " -name '" . str_replace("+"," ",$_GET['filespec']) . "' -exec file {} \; | sed 's/\(." . explode(".",str_replace("+"," ",$_GET['filespec']))[1] . "\): .* \([0-9]* x [0-9]*\).*/\2 \1/' | awk 'int($1) " . str_replace("+"," ",$_GET['wo']) . " " . str_replace("+"," ",$_GET['wv']) . " && int($3) " . str_replace("+"," ",$_GET['ho']) . " " . str_replace("+"," ",$_GET['hv']) . " {print}'"); if (isset($argc)) { echo file_get_contents("find_images_via_size.txt"); } else { echo explode("

", $htmlis)[0] . str_replace("\t"," ","
Width Height (px)Image
",str_replace("\n","
") . "

" . explode("

", $htmlis)[1]; } // //echo file_get_contents("find_images_via_size.txt"); } else if (isset($argc)) { $appbit=""; $grepv=""; $cf3=""; $reverse=false; //echo "there"; //exit; if (7 == 7) { $huh=""; $littlehuh=""; foreach (glob(valit('path','') . $filedelim . valit('filespec','')) as $filename) { try { list($width, $height, $type, $attr) = getimagesize($filename); if ($width != "" && $height != "") { // 3200 x 460
./Htdocs/ITblog/wp-content/themes/twentythirteen/images/headers/star.png $yes=false; eval("\$yes=(" . $width . " " . valit('wo','') . " " . valit('wv','') . " && " . $height . " " . valit('ho','') . " " . valit('hv','') . ");"); //echo "\$yes=(" . $width . " " . valit('wo','') . " " . valit('wv','') . " && " . $height . " " . valit('ho','') . " " . valit('hv','') . ");"; if ($yes) { //echo "yes"; //exit; if (7 == 7) { if (valit('fsort','') != "") { if (strpos(valit('fsort',''), "-r") !== false) { $reverse=true; } $huh.=$width . ' x ' . $height . " " . $filename . "\n"; //. "" . $filename . "\n"; $littlehuh.=$filename."~~" . $width . ' x ' . $height . " " . "" . $filename . "\n"; } else if (valit('hsort','') != "") { if (strpos(valit('hsort',''), "-r") !== false) { $reverse=true; } $huh.=$width . ' x ' . $height . " " . $filename; //"" . $filename . "\n"; $littlehuh.=str_pad($height,20,"0",STR_PAD_LEFT) . "~~" . $width . ' x ' . $height . " " . $filename . "\n"; //"" . $filename . "\n"; } else if (valit('wsort','') != "") { if (strpos(valit('wsort',''), "-r") !== false) { $reverse=true; } $huh.=$width . ' x ' . $height . " " . $filename . "\n"; //"" . $filename . "\n"; $littlehuh.=str_pad($width,20,"0",STR_PAD_LEFT) . "~~" . $width . ' x ' . $height . " " . $filename . "\n"; //"" . $filename . "\n"; } else { $huh.=$width . ' x ' . $height . " " . $filename . "\n"; //"" . $filename . "\n"; $littlehuh=$huh; } } else { $huh.=$width . ' x ' . $height . " " . $filename . "\n"; //"" . $filename . "\n"; $littlehuh=$huh; } } } } catch (Exception $ewe) { } } if ($huh != $littlehuh) { file_put_contents(dirname(__FILE__) . $filedelim . "find_images_via_size.ttt", $littlehuh); $lines=file(dirname(__FILE__) . $filedelim . "find_images_via_size.ttt"); if ($reverse) { rsort($lines); //, SORT_STRING); } else { sort($lines); //, SORT_STRING); } $huh=""; foreach ($lines as $key => $val) { $huh.=str_replace("\n","",explode("~~", $val)[1]) . "\n"; } file_put_contents(dirname(__FILE__) . $filedelim . "find_images_via_size.txt", $huh); } else { file_put_contents(dirname(__FILE__) . $filedelim . "find_images_via_size.txt", $huh); } //echo $huh; //exit; //$cf="find " . (str_replace("+"," ",$_GET['path'])) . " -name '" . str_replace("+"," ",$_GET['filespec']) . "' -exec file {} \; | sed '/\ precision\ [0-9]*\, /s//`/g' | grep ' image data' | sed 's/\(JFIF [^\`]*\)`\([0-9]*\)x\([0-9]*\)/\\2 x \\3/g' | sed 's/\(." . "[^\ ]*" . "\): .* \([0-9]* x [0-9]*\).*/\\2 \\1/' | awk 'int($1) " . str_replace("+"," ",$_GET['wo']) . " " . valit('wv',str_replace("+"," ",$_GET['wv'])) . " && int($3) " . str_replace("+"," ",$_GET['ho']) . " " . valit('hv',str_replace("+"," ",$_GET['hv'])) . " {print}' " . $sortbit . $lastsed . " > " . dirname(__FILE__) . substr("\\",0,1) . "find_images_via_size.txt 2> " . dirname(__FILE__) . substr("\\",0,1) . "find_images_via_size.err"; //exec('cd ' . dirname(__FILE__) . '; ' . $cf . ''); //find ' . (str_replace("+"," ",$_GET['path'])) . " -name '" . str_replace("+"," ",$_GET['filespec']) . "' -exec file {} \\; | grep ' image data' | sed 's/\\(." . explode(".",str_replace("+"," ",$_GET['filespec']))[1] . "\\): .* \\([0-9]* x [0-9]*\\).*/\\2 \\1/' | awk 'int($1) " . str_replace("+"," ",$_GET['wo']) . " " . str_replace("+"," ",$_GET['wv']) . " && int($3) " . str_replace("+"," ",$_GET['ho']) . " " . str_replace("+"," ",$_GET['hv']) . " {print}' | sed 's/\\(\\ \\)\\(\\.[^\\<]*\\)/\\ \\\\2\\<\\/a\\>/g' > " . dirname(__FILE__) . substr("\\",0,1) . "find_images_via_size.txt 2> " . dirname(__FILE__) . substr("\\",0,1) . "find_images_via_size.err"); } if (isset($_GET['commandline'])) { echo "
Find Images Via Size

RJM Programming - October, 2019


Width x Height File
" . str_replace(" "," ",str_replace("\n","
", file_get_contents("find_images_via_size.txt"))) . "
"; } else { echo "Find Images Via Size\n\nRJM Programming - October, 2019\n\n\nWidth x Height File\n\n" . file_get_contents("find_images_via_size.txt"); } } else { echo $htmlis; } exit;