Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Get image from HTTP with ascending name */
- /* Example
- https://example.com/images/0/0
- https://example.com/images/0/1
- https://example.com/images/1/0
- https://example.com/images/1/1
- */
- for( $y = 0; $y <= 250; $y++ ) {
- for( $x = 0; $x <= 10; $x++ ) {
- $url = 'https://example.com/images/' . $y . '/' . $x . '.jpeg';
- $locationURL = 'images/' . $y . '-' . $x . '.jpeg';
- $file_headers = get_headers($url);
- if(strpos($file_headers[0], '404') !== false){
- echo $url . " Doesn't exist !<br/>";
- } else {
- $image = file_get_contents($url);
- $img = new Imagick();
- $img->readImageBlob($image);
- $img->writeImage ($locationURL);
- $img -> destroy();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment