Index: /extensions/Autosize/autosize.inc.php
===================================================================
--- /extensions/Autosize/autosize.inc.php	(revision 18126)
+++ /extensions/Autosize/autosize.inc.php	(revision 18127)
@@ -38,42 +38,38 @@
  global  $template,$version,$icon_path,$page,$picture,$conf;
   
-   $current = $template->get_template_vars('current');  
-      $has_pamoorama=isset($template->files['pamooramics_content']);
- //====================================================================    
-    $pictureDeriv = pwg_get_session_var('picture_deriv',$conf['derivative_default_size']); 
-    $SRC_IMG=""; 
-    if(isset($current['derivatives']['Autosize']))
-       $_COOKIE['picture_deriv']="Autosize";
-   if(isset( $_COOKIE['picture_deriv']))
-      $model=  $_COOKIE['picture_deriv'] ;
-   else
-      $model= $pictureDeriv ;
-
-   $selected_derivative =  $current['derivatives'][$model];
-   if (!isset($current['selected_derivative'])){  
-
-   $_COOKIE['picture_deriv']="Autosize";
-    $model=  $_COOKIE['picture_deriv'] ;
-         $current['SelMaxi']=ImageStdParams::get_custom(900,900); 
-         $current['derivatives'][$model]=ImageStdParams::get_custom($_COOKIE['theImageWidth'], $_COOKIE['theImageHeight']); 
-
-
-$selected_derivative=$current['derivatives'][$model];
-$selected_derivative->type="Autosize";
-          $template->append('current', array(
-                                        'selected_derivative' => $selected_derivative
-                                            ), 
-                             true);
-          $current = $template->get_template_vars('current');
-        }
- 
-        if(isset($current['derivatives'][$model])) {
-            $selected_derivative =  $current['derivatives'][$model];
-            $template->assign('current[selected_derivative]', $selected_derivative
-                              , true);
-            $current = $template->get_template_vars('current'); 
-        }
-
-    return $content;
+$current = $template->get_template_vars('current');  
+  $has_pamoorama=isset($template->files['pamooramics_content']);
+//====================================================================    
+$pictureDeriv = pwg_get_session_var('picture_deriv',$conf['derivative_default_size']); 
+$SRC_IMG=""; 
+if(isset($current['derivatives']['Autosize']))
+    $_COOKIE['picture_deriv']="Autosize";
+if(isset( $_COOKIE['picture_deriv']))
+  $model=  $_COOKIE['picture_deriv'] ;
+else
+  $model= $pictureDeriv ;
+
+$selected_derivative =  $current['derivatives'][$model];
+if (!isset($current['selected_derivative'])){  
+  $_COOKIE['picture_deriv']="Autosize";
+  $model=  $_COOKIE['picture_deriv'] ;
+  $current['SelMaxi']=ImageStdParams::get_custom(900,900); 
+  $current['derivatives'][$model]=ImageStdParams::get_custom($_COOKIE['theImageWidth'], $_COOKIE['theImageHeight']); 
+  $selected_derivative=$current['derivatives'][$model];
+  $selected_derivative->type="Autosize";
+  $template->append('current', array(
+                                'selected_derivative' => $selected_derivative
+                                    ), 
+                      true);
+  $current = $template->get_template_vars('current');
+  }
+ 
+  if(isset($current['derivatives'][$model])) {
+    $selected_derivative =  $current['derivatives'][$model];
+    $template->assign('current[selected_derivative]', $selected_derivative , true);
+    $current = $template->get_template_vars('current'); 
+  }
+
+return $content;
 
 }//INIT
@@ -171,6 +167,8 @@
             if ($img_type=="square" || $img_type=="thumb" ) continue ;
             if (!isset($last_img)) $last_img=$img_select; 
+           
             $img_url  = $img_select->get_url();
             $imgSizeWH  =  $img_select->get_size();	
+
             if($img_type=="Autosize" || $img_type=="SelMaxi"){
                 $img_url = $img_select->src_image->get_url();
@@ -178,8 +176,12 @@
                 $liste_type[$img_type]=$img_type.",".$img_url.",".$imgSizeWH[0] .",".$imgSizeWH[1] ;
             }else{ 
-            $liste_type[$img_type]=$img_type.",".$img_url.",".$imgSizeWH[0] .",".$imgSizeWH[1] ;
-            if ($img_type=="Original"){
-          
-            break ;
+              $liste_type[$img_type]=$img_type.",".$img_url.",".$imgSizeWH[0] .",".$imgSizeWH[1] ;
+              if ($img_type=="Original"){    
+                          $maxi_img=  $img_type;
+                          $maxi_url= $img_url;
+                          $maxi_i=$img_select;      
+                break ;
+
+
             }
             
@@ -235,7 +237,8 @@
             pwg_set_session_var('picture_deriv', $_COOKIE['picture_deriv']);
         }else{
-        echo "<pre>".$_COOKIE['picture_deriv']. "No exist  " ;
+       /* echo "<pre>".$_COOKIE['picture_deriv']. "No exist  " ;
         print_r($img_all );
         die();
+        */
         }
     setcookie('picture_deriv', false, 0, cookie_path() );
@@ -262,4 +265,6 @@
 
  if ('kardon' == $user['theme'] and isset($_GET['slideshow'])) return ;
+     if ('stripped' == $user['theme'] ) return ;
+
 		load_language('plugin.lang', AUTOSIZE_PATH);
 		$AUTOSIZE_PATH = dirname(__FILE__).'/';
@@ -318,5 +323,5 @@
         return $template->parse( 'autosize_content', false);
      				  }
-		}
+		} 
 
 	} //public function cl_autosize_affiche
@@ -335,4 +340,5 @@
     $has_pamoorama=isset($template->files['pamooramics_content']);
   if (!$has_pamoorama) return ; 
+      if ('stripped' == $user['theme'] ) return ;
 
     $template->set_filenames(array('autosize_init'=>AUTOSIZE_PATH_ABS. "template/conflit.tpl" ) );
@@ -372,5 +378,6 @@
      global  $has_pamoorama;
        if (!$has_pamoorama) return ; 
-      
+       if ('stripped' == $user['theme'] ) return ;
+
 			$AUTOSIZE_PATH = dirname(__FILE__).'/';
 //================================================================
Index: /extensions/Autosize/js/Affiche_script.js
===================================================================
--- /extensions/Autosize/js/Affiche_script.js	(revision 18126)
+++ /extensions/Autosize/js/Affiche_script.js	(revision 18127)
@@ -443,5 +443,5 @@
       marges_llgbo = 0;
       //========================================================================================== 
-
+       
       init_gen();
       jQuery(window).resize();
Index: /extensions/Autosize/main.inc.php
===================================================================
--- /extensions/Autosize/main.inc.php	(revision 18126)
+++ /extensions/Autosize/main.inc.php	(revision 18127)
@@ -2,10 +2,10 @@
 /*
 Plugin Name: AutoSize
-Version: auto
+Version: 2.08
 Description: Ajuste l'affichage des photos en fonction de la hauteur de la fenetre de navigation
 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=448
 Author: cljosse
 Author URI:http://cljosse.free.fr
-*/
+*/ 
 
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
Index: /extensions/Autosize/maintain.inc.php
===================================================================
--- /extensions/Autosize/maintain.inc.php	(revision 18126)
+++ /extensions/Autosize/maintain.inc.php	(revision 18127)
@@ -59,7 +59,9 @@
  function plugin_deactivate(){
  global $conf ;
+ 
  if (isset($conf['cl_derivatives_sav']))  {    
     $arr = @unserialize($conf['cl_derivatives_sav']);         
       if(isset($arr['d'])){ 
+      $conf['derivatives'] = $conf['cl_derivatives_sav'];
         $query = '
     		UPDATE '.CONFIG_TABLE.'
@@ -72,5 +74,10 @@
      pwg_query($q);
        }
-    }     
+    }   
+      $model= $conf['derivative_default_size'];
+      $_COOKIE  ['picture_deriv'] = $model;
+      $_COOKIE ['picture_map'] = $model;
+      pwg_set_session_var('picture_deriv', $model);
+    
  }
 
