if($_POST["url"]!=""){
$k=1;
$hdl=fopen($_POST["url"], "rb");
do {
$data = fread($hdl, 100);
if (strlen($data) == 0) {
break;
}
$cont .= $data;
} while(true);
fclose ($hdl);
$pattern = '/src\\=[\\\'\\"]?([^\\\'\\"]*)[\\"\\\']?/i';
$img = array();
preg_match_all($pattern, $cont, $img);
$realurl=parse_url($_POST["url"]);
$realurl=parse_url($_POST["url"]);
for($i=0; $i<count($img[1]); $i++){
if(ereg(".jpg", $img[1][$i]) || ereg(".jpeg", $img[1][$i])){
if(!ereg("http://", $img[1][$i])){
$arr=explode("/", $_POST["url"]);
array_pop($arr);
$img[1][$i] = implode("/", $arr)."/".$img[1][$i];
}
$filename=basename($img[1][$i]);
$id = ImageCreateFromJPEG($img[1][$i]);
$prefix=uniqid($tom);
$filename=$prefix.$filename;
@ImageJPEG($id,'../xttempthumbs/'.$filename);
$thumbsti='../xttempthumbs/'.$filename;
$sizes = getimagesize($thumbsti);
$sizex = $sizes[0];
$sizey = $sizes[1];
if($sizex>$sizey){
$dif=$sizex/$sizey;
}
if($sizey>$sizex){
$dif=$sizey/$sizex;
}
if($dif<2.5){
if($k==1){
echo '<tr><td width="25%">Add: <input class="check" type="checkbox" name="pic" value="'.$thumbsti.'">
<br><img src="'.$thumbsti.'"></td>';
$k++;
}elseif($k<4 && $k>1){
echo '<td width="25%">Add: <input class="check" type="checkbox" name="pic" value="'.$thumbsti.'">
<br><img src="'.$thumbsti.'"></td>';
$k++;
}elseif($k==4){
echo '<td width="25%">Add: <input class="check" type="checkbox" name="pic" value="'.$thumbsti.'">
<br><img src="'.$thumbsti.'"></td></tr>';
$k=1;
}
}
}
}
echo '</table></form>';
exit;
}
ok what this script does is take a url and looks at the html source code on the page, then filters out the jpgs to save.
For some jpgs this works great and for some i get an error of
I dont know what is going on, I tried this on various sites, some that worked and some that didnt. As far as i could can tell all the jpegs are RGB. The server that I am running the script on has GB 2.0 or higher.
I can give you two examples of sites that I tried "BEWARE THESE SITES HAVE ADULT PICTURES ON THEM!"
works on this site:
http://galleries.googirls.com/gals/?s=Nasty_Swapping_Bitches&rid=pp11072
dosen't work on this site:
http://www.wannawatch.com/hosted/index.php?ws/gross312/pumpthatass36