array('width' => 720, 'height' => 720), // Number of pixels by which tiles overlap 'overlap' => array('x' => 70, 'y' => 70), // Zoom level 'zoom_level' => 2, // Start in the middle of the tile set, rather than the top-left corner 'ignore_tiles' => array('x' => 0, 'y' => 0), // Image identifier (I= parameter on initial view page) 'image_id' => 'w013s000g001', // Total number of tiles we're interested in 'tile_count' => array('x' => 3, 'y' => 2), ); $options = sanitise_options( array_merge($default_options, $_GET) ); switch ( $_GET['action'] ) { case 'image': process_and_display_image($options); break; case 'source': header('Content-type: text/plain'); readfile(__FILE__); break; default: display_option_form($options); } function sanitise_options($raw_options) { return array( 'tile_size' => array( 'width' => intval($raw_options['tile_size']['width']), 'height' => intval($raw_options['tile_size']['height']), ), 'overlap' => array( 'x' => intval($raw_options['overlap']['x']), 'y' => intval($raw_options['overlap']['y']) ), 'zoom_level' => intval($raw_options['zoom_level']), 'ignore_tiles' => array( 'x' => intval($raw_options['ignore_tiles']['x']), 'y' => intval($raw_options['ignore_tiles']['y']) ), 'tile_count' => array( 'x' => intval($raw_options['tile_count']['x']), 'y' => intval($raw_options['tile_count']['y']) ), 'image_id' => preg_replace('/[^0-9A-Za-z]/', '', $raw_options['image_id']), ); } function display_option_form($options) { ?> Tiled image fetch and assembler
Source image
Total number of tiles we're interested in:
Ignore tiles (to start in the middle of the tile set, rather than the top-left corner):
Maximum / normal size of each tile image:
Number of pixels by which tiles overlap:

Script © Rowan Collins 2009, AKA IMSoP

View source.

Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License.

somefile.jpeg`) header('Content-type: image/jpeg'); imagejpeg($output_image); exit; } function create_image_url($image_id, $zoom_level, $x, $y) { // The parts of the URL we don't want to change $url_base = 'http://www.emuseum.jp/map/map_img/'; // Note the "sprintf" to give leading zeros where necessary return $url_base . substr($image_id, 0, 4) . '/' . $image_id . '/m/' . sprintf('%02d', $zoom_level) . '/x' . sprintf('%02d', $x) . 'y' . sprintf('%02d', $y) . '.jpg'; }