Projet

Général

Profil

Paste
Télécharger (1,72 ko) Statistiques
| Branche: | Révision:

root / genererPano.php @ a1063f68

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

    
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
    // Redirect in js to sumary page
42
    if ($_GET['wizard']) {
43
      printf('<script>window.location=\'panoInfo.php?name=%s\'</script>\n', $pano_name);
44
    }
45

    
46
  } catch (TilesGeneratorRightsException $e) {
47
    printf("<p class=\"error\">%s</p>\n", $e->getMessage());
48
  } catch (TilesGeneratorScriptException $e) {
49
    printf("<h4><span class=\"error\">%s</span></h4>\n", $e->getMessage());
50
    print("</pre>\n");
51
  }
52
}
53
?>
54
</body>
55
</html>