Index: extensions/Autosize/autosize.inc.php
===================================================================
--- extensions/Autosize/autosize.inc.php	(revision 19764)
+++ extensions/Autosize/autosize.inc.php	(revision 19844)
@@ -66,6 +66,6 @@
     }
     if(preg_match("|test|", $DEBUG_autosize, $val)) { 
-    $infos_message .= "#65 autosize_calcContent: <br>";
-       if ( isset($_COOKIE['pwg_id']) ) unset ($_COOKIE['pwg_id']) ;
+        $infos_message .= "#65 autosize_calcContent: <br>";
+        if ( isset($_COOKIE['pwg_id']) ) unset ($_COOKIE['pwg_id']) ;
         $infos_message .=  "SESSION:"  . cl_print_var($_SESSION) ;
         $infos_message .=  "COOKIE:"  . cl_print_var($_COOKIE) ;
@@ -80,17 +80,13 @@
           self::Fin_php("#80 autosize_calcContent:" . $DEBUG_autosize );
         }
-        self::reload("#82");
-        self::Fin_php("#83 autosize_calcContent:" + $DEBUG_autosize);
-    }  
-
-
-   if (!isset($_COOKIE['autosize_reload'])  ){  
-           if(preg_match("|test_2|", $DEBUG_autosize, $val)) { 
-          $infos_message .= "not COOKIE['autosize_reload'] -> reload(): <br>";
-           echo $infos_message;
-          self::Fin_php("#91 autosize_calcContent:" . $DEBUG_autosize);
+        unset($_COOKIE['autosize_reload']);
+    } 
+    if (!isset($_COOKIE['autosize_reload'])  ){  
+        if(preg_match("|test_2|", $DEBUG_autosize, $val)) { 
+          $infos_message .= "not COOKIE['autosize_reload'] -> reload(): <br>";           
+          self::Fin_php("#87 autosize_calcContent:" . $DEBUG_autosize);
         }
-          self::reload("#93");
-          self::Fin_php("#94 autosize_calcContent:" + $DEBUG_autosize);
+          self::reload("#89");
+      //  self::Fin_php("#90 autosize_calcContent:" + $DEBUG_autosize);
 
     }  
@@ -120,5 +116,7 @@
 * INIT
 *********************/
-
+static public function init_3(){
+ 
+}
 static public function init_1($content, $image)
 		{
@@ -128,12 +126,11 @@
        if ( !stristr($image['name'], $asp['in_mode_360']) and !stristr($image['name'], $asp['in_mode_180']) ) return $content;
 
-       $windowWidth=$_COOKIE['windowWidth'] -$_COOKIE['theImageLeft']-$_COOKIE['theImageRight'];
-       $windowHeight=$_COOKIE['windowHeight']-130 ;
+      $asp['min_viewport_width']=$_COOKIE['windowWidth'] -$_COOKIE['theImageLeft']-$_COOKIE['theImageRight'];
+          $asp['viewport_height']=$_COOKIE['windowHeight']-130 ;
 
       $asp['start_position']= 10;     
-           $asp['min_viewport_width']= $windowWidth;     
-            $asp['viewport_height']= $windowHeight;     
+  
       }
-
+/*********************/
 static public function init($content,$element_info){
   global  $template,$version,$icon_path,$page,$picture,$conf;
@@ -914,12 +911,14 @@
 //================= Liste =========================   
   $ok= 0 ;
-  $nofile=0 ;  
+  $nofile=0 ;      global $max_crop;
   //=============================================
   // Liste mini maxi
   //=============================================
     foreach ($img_all as $img_select){
+
             $img_type  =  $img_select->get_type();	
             $img_url  = $img_select->get_path();     
-            $imgWH  =  $img_select->get_size();	   
+              $max_crop = 0 ;
+            $imgWH  =  self::Get_Size($img_select);	   
             if ($img_type=="square" || $img_type=="thumb" ) continue ;   
             if($img_type=="Autosize" || $img_type=="SelMaxi"){
@@ -934,5 +933,5 @@
             }          
              if(preg_match("|get_minfos|", $DEBUG_autosize, $val)) 
-                      $infos_message .=$img_url . " -> " . $img_type ."<br >";
+                      $infos_message .=$img_url . " " . $max_crop ." -> " . $img_type . " " . print_r($imgWH,true). " <br >";
 
           if(file_exists(PHPWG_ROOT_PATH.$img_url)){    } // if file        
@@ -1048,4 +1047,18 @@
 
   }
+  //=================================================================
+
+static public function Get_Size($Img_Select){
+      global  $max_crop;
+             $imgWH  =  $Img_Select->get_size();	  
+            $img_type  =  $Img_Select->get_type();	   
+              $smaller = ImageStdParams::get_by_type($img_type);    
+              $max_crop=0;
+              if($smaller->sizing->max_crop==1){
+                $imgWH  =$smaller->sizing->min_size;
+                 $max_crop=1;
+          }      
+          return $imgWH ;
+      }
 //==================================================================
 static public  function  cl_autosize_nofile($img_all){
Index: extensions/Autosize/include/affiche.php
===================================================================
--- extensions/Autosize/include/affiche.php	(revision 19764)
+++ extensions/Autosize/include/affiche.php	(revision 19844)
@@ -52,4 +52,5 @@
     foreach ($defined_types as $type_size){
       $value = $type_size;
+      if($type_size != "square" && $type_size != "thumb" )
       $options[$value] = $type_size;    
     }  
Index: extensions/Autosize/main.inc.php
===================================================================
--- extensions/Autosize/main.inc.php	(revision 19764)
+++ extensions/Autosize/main.inc.php	(revision 19844)
@@ -57,9 +57,10 @@
     add_event_handler('loc_after_page_header',array(&$autosize_ctrl, 'cl_autosize_script_3')  );
     add_event_handler('loc_after_page_header', array(&$autosize_ctrl, 'cl_autosize_affiche'), EVENT_HANDLER_PRIORITY_NEUTRAL +21    );
+           if(!isset($_GET['slideshow'])) add_event_handler('loc_begin_picture', array(&$autosize_ctrl, 'init_3'), EVENT_HANDLER_PRIORITY_NEUTRAL+6);
     }
 } ;
 
      
-       
+
 
 ?>
