Project

General

Profile

Paste
Download (1.58 KB) Statistics
| Branch: | Revision:

root / genererPano.php @ afe20e9f

1
<!DOCTYPE html>
2
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
3
<head>
4
  <meta http-equiv="Content-type" content="text/html; charset=UTF-8"/>
5
  <link type="image/x-icon" rel="shortcut icon" href="images/tsf.png"/>
6
  <title>convertiseur image vers panorama</title>
7
</head>
8

    
9
<body>
10
<?php
11
require_once 'class/utils.class.php';
12
require_once 'class/site_point.class.php';
13
require_once 'class/TilesGenerator.php';
14
require_once 'constants.inc.php';
15
utils::init();
16
if (isset($_GET['name'])) {
17
  $image_path = UPLOAD_PATH.'/'.$_GET['name'];
18
  // We init the panorama with the same name as image.
19
  $pano_name = utils::strip_extension($_GET['name']);
20
  $panorama = site_point::get($pano_name);
21

    
22
  $tiles_generator = new TilesGenerator($image_path, $panorama);
23

    
24
  try {
25
    $tiles_generator->prepare();
26
    printf("<h2>Exécution de la commande :</h2>\n");
27
    printf("<p class=\"cmd\"><samp>%s</samp></p>\n",
28
           $tiles_generator->mk_command());
29

    
30
    echo "<pre>\n";
31
    $tiles_generator->process();
32
    print("</pre>\n");
33

    
34

    
35
    print("<h4><span class=\"success\">Opération réussie</span></h4>\n");
36
    printf("<p>Pour acceder directement au panorama <a href=\"%s\">cliquer ici</a></p>\n",
37
           $panorama->get_url());
38
    print("<p>Pour acceder à la liste des panoramas <a href=\".\">cliquer ici</a></p>\n") ;
39

    
40

    
41
  } catch (TilesGeneratorRightsException $e) {
42
    printf("<p class=\"error\">%s</p>\n", $e->getMessage());
43
  } catch (TilesGeneratorScriptException $e) {
44
    printf("<h4><span class=\"error\">%s</span></h4>\n", $e->getMessage());
45
    print("</pre>\n");
46
  }
47
}
48
?>
49
</body>
50
</html>