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 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='//www.rjmprogramming.com.au/PHP/read_exif_off_image_rotate.php?image=' + encodeURIComponent(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; kiGif Create';
document.getElementById('gifsel').style.backgroundColor='white';
document.getElementById('gifsel').size='2';
}
document.getElementById('t' + another).style.backgroundColor='yellow';
if (agifsuff.length == 0) {
if (fhelper == '') { fhelper=document.getElementById('mygifform').innerHTML; }
ihelper= document.getElementById('slideshow').outerHTML;
aurl=document.getElementById('t' + another).innerHTML.split(' href=')[1].substring(1).split(document.getElementById('t' + another).innerHTML.split(' href=')[1].substring(0,1))[0];
if (aurl.toLowerCase().indexOf('//') == 0) {
document.getElementById('slideshow').value='http:' + aurl;
} else if (aurl.toLowerCase().indexOf('http') == 0) {
document.getElementById('slideshow').value=aurl;
} else if (aurl.toLowerCase().indexOf('./') == 0) {
//document.getElementById('slideshow').value='.' + aurl; //(document.URL.split('find_images_via_size.')[0] + aurl.substring(2)).replace('https:','http:');
document.getElementById('slideshow').value=(document.URL.split('find_images_via_size.')[0] + aurl.substring(2)).replace('https:','http:');
} else if (aurl.toLowerCase().indexOf('../') == 0) {
//document.getElementById('slideshow').value='../' + aurl; //(document.URL.split('find_images_via_size.')[0] + aurl.substring(2)).replace('https:','http:');
document.getElementById('slideshow').value=(document.URL.split('find_images_via_size.')[0] + aurl.substring(2)).replace('https:','http:');
} else {
document.getElementById('slideshow').value=(document.URL.split('find_images_via_size.')[0] + aurl).replace('/PHP/../','/').replace('https:','http:');
}
agifs.push(\"document.getElementById('slideshow').value='\" + document.getElementById('slideshow').value + \"';\");
bgifs.push(\"document.getElementById('wt\" + another + \"').style.backgroundColor='white';\");
bgifs.push(\"document.getElementById('t\" + another + \"').style.backgroundColor='white';\");
agifsuff='2';
document.getElementById('readyfor' + agifsuff).innerHTML=ihelper.replace(/slideshow/g, 'slideshow' + agifsuff) + '';
} 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="";
}
function valit($inname, $indef) {
global $scriptis, $detpref, $detsuff, $formis, $onl, $tablep, $tables, $postbody;
if (!isset($argc)) {
if (isset($_GET[$inname])) {
$tablep="";
//$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(" 1) {
$subsub=explode("href=", $subbits[1]);
$retct.=",'" . $ir . "');\tclass=widthtd\tid=wt". $ir . ">" . $subbits[0] . " | | | | | | | ";
$formis.="";
$formis.=$scriptis;
$htmlis="". $headscr ."Find Images Via Size - RJM Programming - October, 2019Find 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 (PHP_OS=='WINNT' || PHP_OS=='WIN32' || PHP_OS=='Windows') {
$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("+"," ",$_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("+"," ",$_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("+"," ",$_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";
}
$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("+"," ",$_GET['wo']) . " " . valit('wv',str_replace("+"," ",$_GET['wv'])) . " && int($3) " . str_replace("+"," ",$_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}'");
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 {
echo $htmlis;
}
exit;