Index: /extensions/Panoramas/AS_Panorama.php
===================================================================
--- /extensions/Panoramas/AS_Panorama.php	(revision 19459)
+++ /extensions/Panoramas/AS_Panorama.php	(revision 19460)
@@ -12,44 +12,59 @@
 		  global $conf, $template, $page;
 		  $asp = & $conf['AS_panorama'];
-		  if ( !stristr($image['name'], $asp['in_mode_360']) 
-		   and !stristr($image['name'], $asp['in_mode_180']) ) return $content;
-		  if (!isset($image['image_url'])) return $content;
-		  if ( isset($page['slideshow']) and $page['slideshow'] ) return $content;
-		  if (isset($image['width']) and $image['width'] < $asp['min_viewport_width']) return $content;
-		  $asp['image_name'] = $image['name'];
-		  $asp['width'] = $image['width'];
-		  $asp['height'] = $image['height'];
-		  if (stristr($image['name'], $asp['in_mode_180'])) {
-			$asp['mode_360'] = 'false';
-			$asp['name'] = str_replace($asp['in_mode_180'],'', $image['name']);
-		  }
-		  else  {
-			$asp['name'] = str_replace($asp['in_mode_360'],'', $image['name']);
-		  }
-		  $template->set_filenames(
-			array('AS_panorama_content' => dirname(__FILE__) . '/template/AS_panorama_content.tpl') );
-		  $asp['Path'] = embellish_url($template->get_template_vars('ROOT_URL').ASP_PATH);
-		  $asp['content'] = $content;
-		  $template->assign( array( 'ASP' => $asp, ) );
-		  return $template->parse('AS_panorama_content', true);
-		}
-  }
+	//echo "<pre>"; print_r($template); echo "</pre>"; exit;
+	
+	if (isset($template->files['slideshow'])) return $content;
+	if ( !stristr($image['name'], $asp['in_mode_360']) and !stristr($image['name'], $asp['in_mode_180']) ) return $content;
+	if (!isset($image['path'])) return $content;
+	if ( isset($page['slideshow']) and $page['slideshow'] ) return $content;
+	if (isset($image['width']) and $image['width'] < $asp['min_viewport_width']) return $content;
+
+	$divtag = "<img src=\"";
+	$divtag.= str_replace( "./", "", $image['path'])."\" width=\"".$image['width']."\" ";
+	$divtag.= "height=\"".$image['height']."\" ";
+	$divtag.= "alt=\"".$image['file']."\" id=\"theMainImage\" ";
+	
+	if ($image['height'] > $asp['viewport_height']) {
+		$ratio = $image['width'] / $image['height'];
+		$image['height'] = $asp['viewport_height'];
+		$image['width'] = $asp['viewport_height'] * $ratio;
+	}
+
+	$asp['image_name'] = $image['name'];
+	$asp['width'] = $image['width'];
+	$asp['height'] = $image['height'];
+	if (stristr($image['name'], $asp['in_mode_180'])) {
+		$asp['mode_360'] = 'false';
+		$asp['name'] = str_replace($asp['in_mode_180'],'', $image['name']);
+	}
+	else  {
+		$asp['name'] = str_replace($asp['in_mode_360'],'', $image['name']);
+	}
+	
+	$template->set_filenames(
+	array('AS_panorama_content' => dirname(__FILE__) . '/template/AS_panorama_content.tpl') );
+	$asp['Path'] = embellish_url($template->get_template_vars('ROOT_URL').ASP_PATH);
+	$asp['content'] = $divtag;
+	$template->assign( array( 'ASP' => $asp, ) );
+	return $template->parse('AS_panorama_content', true);
+}
+}
 }
 
 if ( !function_exists( 'AS_panorama_title' ) ) {
-  if ( $conf['AS_panorama']['In_name_display_removal'] ) {
-    add_event_handler('loc_end_picture', 'AS_panorama_title');
-    function AS_panorama_title()
-    {
-      global $conf, $template;
-      $asp = & $conf['AS_panorama'];
-      $picture = $template->get_template_vars('current');
-	  if ( isset($asp['name']) ) {
-		  $picture['TITLE'] = $asp['name'];
-		  $template->assign('current', $picture);
-		  $template->assign( array( 'ASP' => $asp, ) );
-	  }
-    }
-  }
+	if ( $conf['AS_panorama']['In_name_display_removal'] ) {
+		add_event_handler('loc_end_picture', 'AS_panorama_title');
+		function AS_panorama_title()
+		{
+			global $conf, $template;
+			$asp = & $conf['AS_panorama'];
+			$picture = $template->get_template_vars('current');
+			if ( isset($asp['name']) ) {
+			$picture['TITLE'] = $asp['name'];
+			$template->assign('current', $picture);
+			$template->assign( array( 'ASP' => $asp, ) );
+			}
+		}
+	}
 }
 
@@ -57,15 +72,15 @@
 	if ( defined('IN_ADMIN') and IN_ADMIN ) {
 		add_event_handler('get_admin_plugin_menu_links', 'AS_panorama_menu');
-    function AS_panorama_menu($menu)
-    {
-        array_push($menu,
-            array(
-                'NAME' => 'Panoramas',
-                'URL' => get_admin_plugin_menu_link(dirname(__FILE__).'/AS_Panorama_admin.php')
-            )
-        );
-        return $menu;
-    }
-  }
+		function AS_panorama_menu($menu)
+		{
+			array_push($menu,
+				array(
+					'NAME' => 'Panoramas',
+					'URL' => get_admin_plugin_menu_link(dirname(__FILE__).'/AS_Panorama_admin.php')
+					)
+			);
+		return $menu;
+		}
+	}
 }
 ?>
Index: /extensions/Panoramas/AS_Panorama_admin.php
===================================================================
--- /extensions/Panoramas/AS_Panorama_admin.php	(revision 19459)
+++ /extensions/Panoramas/AS_Panorama_admin.php	(revision 19460)
@@ -19,5 +19,7 @@
   $nsp = array_merge($asp, $_POST);
 	if ( $nsp['viewport_width']=='' or !is_numeric($nsp['viewport_width']) or $nsp['viewport_width'] < 50 or $nsp['viewport_width'] > 100 )
-    array_push($errors, l10n('Viewport width ratio is out of range (Correct range: 50-100).')); 
+    array_push($errors, l10n('Viewport width ratio is out of range (Correct range: 50-100).'));
+	if ( $nsp['viewport_height']=='' or !is_numeric($nsp['viewport_height']) or $nsp['viewport_height'] < 500 or $nsp['viewport_height'] > 800 )
+    array_push($errors, l10n('Viewport height is out of range (Correct range: 500/+).')); 
 	if ( $nsp['min_viewport_width']=='' or !is_numeric($nsp['min_viewport_width']) or $nsp['min_viewport_width'] < 320 )
     array_push($errors, l10n('Minimal Viewport width is out of range (Correct range: 320/+).')); 
Index: /extensions/Panoramas/AS_Panorama_default.php
===================================================================
--- /extensions/Panoramas/AS_Panorama_default.php	(revision 19459)
+++ /extensions/Panoramas/AS_Panorama_default.php	(revision 19460)
@@ -2,4 +2,5 @@
   $default = array(
 	'viewport_width' => 100,
+	'viewport_height' => 500,
 	'min_viewport_width' => 720,
 	'max_viewport_width' => 1500,
Index: /extensions/Panoramas/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/Panoramas/language/fr_FR/plugin.lang.php	(revision 19459)
+++ /extensions/Panoramas/language/fr_FR/plugin.lang.php	(revision 19460)
@@ -27,4 +27,5 @@
 $lang['Viewport maximal width [pixels >= minimal width]'] = 'Largeur maximale de la partie visible [pixels >= largeur minimale]';
 $lang['Viewport minimal width [pixels > 320]'] = 'Largeur minimale de la partie visible [pixels > 320]';
+$lang['Viewport height [pixels > 500]'] = 'Hauteur de la partie visible [pixels > 300]';
 $lang['Viewport width [% between 50-100]'] = 'Largeur relative de la partie visible [% between 50-100]';
 $lang['Viewport width ratio is out of range (Correct range: 50-100).'] = 'La largeur relative de la partie visible est incorrecte (Valeurs acceptables: 50-100).'; 
Index: /extensions/Panoramas/language/no_NO/description.txt
===================================================================
--- /extensions/Panoramas/language/no_NO/description.txt	(revision 19460)
+++ /extensions/Panoramas/language/no_NO/description.txt	(revision 19460)
@@ -0,0 +1,1 @@
+en enkel panorama fremviser basert på jQuery med 2 moduser (360 eller 180) hvor 180 modus vil reversere rotasjons rettningen. 
Index: /extensions/Panoramas/language/no_NO/plugin.lang.php
===================================================================
--- /extensions/Panoramas/language/no_NO/plugin.lang.php	(revision 19460)
+++ /extensions/Panoramas/language/no_NO/plugin.lang.php	(revision 19460)
@@ -0,0 +1,34 @@
+<?php
+$lang['Auto'] = 'Auto';
+$lang['Automatic start'] = 'Automatisk start';
+$lang['Control display'] = 'Kontrol visning';
+$lang['Left'] = 'Left';
+$lang['Maximal Viewport width is out of range (Correct range: Minimal/+).'] = 'Maksimal Viewport bredde er ute av bildekant (Endre bildestørrelse/kant: Minimal/+).';
+$lang['Minimal Viewport width is out of range (Correct range: 320/+).'] = 'Minimal Viewport bredde er ute av bildekant (Endre bildestørrelse/kant: 320/+).';
+$lang['Mode 180 (Alternative left-right restart)'] = 'Mouse 180 (Alternative venstre-høyre omstart)';
+$lang['Mode 360'] = 'Modus 360';
+$lang['Off'] = 'av';
+$lang['On'] = 'På';
+$lang['Panoramas configuration'] = 'Panorama konfigurasjon';
+$lang['Permanent'] = 'Permanent';
+$lang['Picture name substring could not be empty.'] = 'Bilde navn substring kan ikke være tom.';
+$lang['Picture name substring to display in Mode 180 [ != previous substring ]'] = 'Bilde navn substring å vise i modus 180 [ != forrige substring ]';
+$lang['Picture name substring to display in Mode 360'] = 'Bilde navn substring å vise i modus 360';
+$lang['Picture name substrings must be different.'] = 'Bilde navn substrings må være anderledes.';
+$lang['Relative speed factor [10-90]'] = 'Relativ hastighets faktor [10-90]';
+$lang['Relative speed factor is out of range (Correct range: 10-90).'] = 'Relativ hastighets faktor er utenfor parametrene (Korrekte parameter: 10-90).';
+$lang['Remove substring from picture title'] = 'Fjern substring fra bilde tittel';
+$lang['Right'] = 'Høyre';
+$lang['Rotation direction'] = 'Rotasjons rettning';
+$lang['Special thanks to:'] = 'Spesielt takk til:';
+$lang['authors of'] = 'forfatter av';
+$lang['Start position [% between 0-99]'] = 'Start posisjon [% mellom 0-99]';
+$lang['Start position ratio is out of range (Correct range: 0-99).'] = 'Start posisjon ratioen er utenfor parametrene (Korrekt parameter: 0-99).';
+$lang['Viewport maximal width [pixels >= minimal width]'] = 'Viewport maksimal bredde [pixels >= minimal bredde]';
+$lang['Viewport minimal width [pixels > 320]'] = 'Viewport minimal bredde [pixels > 320]';
+$lang['Viewport width [% between 50-100]'] = 'Viewport bredde [% mellom 50-100]';
+$lang['Viewport width ratio is out of range (Correct range: 50-100).'] = 'Viewport bredde instilling er utenfor parametrene (Korrekt parameter: 50-100).';
+$lang['You are not authorized to change this configuration (Webmaster only).'] = 'Du er ikke autorisert til å endre denne konfigurasjonen (Kun Webmaster).';
+$lang['Your configuration is NOT saved due to above reasons.'] = 'Din konfigurasjon er IKKE lagret grunner overnevnte årsak.';
+$lang['Your configuration is saved.'] = 'Din konfigurasjon er lagret.';
+?>
Index: /extensions/Panoramas/main.inc.php
===================================================================
--- /extensions/Panoramas/main.inc.php	(revision 19459)
+++ /extensions/Panoramas/main.inc.php	(revision 19460)
@@ -1,7 +1,7 @@
 <?php /*
 Plugin Name: Panoramas
-Version: auto
+Version: 2.4.5
 Description: A simple panorama viewer based on jQuery
-Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=207
+Plugin URI: http://piwigo.org/ext/extension_view.php?eid=207
 Author: Piwigo team & OpenStudio
 Author URI: http://www.vdigital.org
@@ -17,4 +17,7 @@
 
 History
+  2012-12-15 2.4.5
+			 New: Add Viewport height parameter
+			 Upgrade for Piwigo 2.4.5
   2010-05-27 2.1.a
 			 New: jQuery function replacement
Index: /extensions/Panoramas/template/AS_Panorama_admin.tpl
===================================================================
--- /extensions/Panoramas/template/AS_Panorama_admin.tpl	(revision 19459)
+++ /extensions/Panoramas/template/AS_Panorama_admin.tpl	(revision 19460)
@@ -15,4 +15,9 @@
   <legend>{'Panoramas configuration'|@translate}</legend>
   <table id="table">
+     <tr>
+    <td class="label">{'Viewport height [pixels > 500]'|@translate}</td>
+    <td><input type="text" class="field" name="viewport_height" value="{$ASP.viewport_height}" size="20" maxlength="3"/></td>
+   </tr>
+
    <tr>
     <td class="label">{'Viewport width [% between 50-100]'|@translate}</td>
