Index: /trunk/admin/themes/default/template/batch_manager_global.tpl
===================================================================
--- /trunk/admin/themes/default/template/batch_manager_global.tpl	(revision 12174)
+++ /trunk/admin/themes/default/template/batch_manager_global.tpl	(revision 12175)
@@ -739,5 +739,6 @@
       <p>
         <img src="admin/themes/default/icon/warning.png" alt="!" style="vertical-align:middle;">
-        {'Only photos with HD can be regenerated!'|@translate}
+        {'By default, Piwigo will create a new websize from the HD (high definition) version of your photo.'|@translate}
+        {'If no HD is available and if the current websize is bigger than resize dimensions, Piwigo will move it as HD and create a downsized websize photo from it.'|@translate}
       </p>
 
Index: /trunk/include/ws_functions.inc.php
===================================================================
--- /trunk/include/ws_functions.inc.php	(revision 12174)
+++ /trunk/include/ws_functions.inc.php	(revision 12175)
@@ -2963,5 +2963,5 @@
 
   $query='
-SELECT id, path, tn_ext, has_high
+SELECT id, path, tn_ext, has_high, width, height
   FROM '.IMAGES_TABLE.'
   WHERE id = '.(int)$params['image_id'].'
@@ -2975,9 +2975,40 @@
 
   $image_path = $image['path'];
+
+  if (!is_valid_image_extension(get_extension($image_path)))
+  {
+    return new PwgError(403, "image can't be resized");
+  }
+  
   $hd_path = get_high_path($image);
 
-  if (empty($image['has_high']) or !file_exists($hd_path) or !is_valid_image_extension(get_extension($image_path)))
-  {
-    return new PwgError(403, "image can't be resized");
+  if (empty($image['has_high']) or !file_exists($hd_path))
+  {
+    if ($image['width'] > $params['maxwidth'] or $image['height'] > $params['maxheight'])
+    {
+      $hd_path = file_path_for_type($image_path, 'high');
+      $hd_dir = dirname($hd_path);
+      prepare_directory($hd_dir);
+      
+      rename($image_path, $hd_path);
+      $hd_infos = pwg_image_infos($hd_path);
+
+      single_update(
+        IMAGES_TABLE,
+        array(
+          'has_high' => 'true',
+          'high_filesize' => $hd_infos['filesize'],
+          'high_width' => $hd_infos['width'],
+          'high_height' => $hd_infos['height'],
+          ),
+        array(
+          'id' => $image['id']
+          )
+        );
+    }
+    else
+    {
+      return new PwgError(403, "image can't be resized");
+    }
   }
 
Index: /trunk/language/cs_CZ/admin.lang.php
===================================================================
--- /trunk/language/cs_CZ/admin.lang.php	(revision 12174)
+++ /trunk/language/cs_CZ/admin.lang.php	(revision 12175)
@@ -803,5 +803,4 @@
 $lang['%s photos have been regenerated'] = '%s fotek bylo regenerováno';
 $lang['%s photos can not be regenerated'] = '%s fotek nemohlo být regenerováno';
-$lang['Only photos with HD can be regenerated!'] = 'Pouze fotky s vysokým rozlišením mohou být regenerovány!';
 $lang['Updates'] = 'Aktualizace';
 $lang['Update in progress... Please wait.'] = 'Probíhá aktualizace... Prosím čekejte.';
Index: /trunk/language/de_DE/admin.lang.php
===================================================================
--- /trunk/language/de_DE/admin.lang.php	(revision 12174)
+++ /trunk/language/de_DE/admin.lang.php	(revision 12175)
@@ -791,5 +791,4 @@
 $lang['%s photos have been regenerated'] = '%s Fotos wurden neu erstellt';
 $lang['%s photos can not be regenerated'] = '%s Fotos konnten nicht neu erstellt werden';
-$lang['Only photos with HD can be regenerated!'] = 'Diese Erweiterung berücksichtigt nur HD Material!';
 $lang['new'] = 'neu';
 $lang['No results'] = 'Keine Ergebnisse';
Index: /trunk/language/en_UK/admin.lang.php
===================================================================
--- /trunk/language/en_UK/admin.lang.php	(revision 12174)
+++ /trunk/language/en_UK/admin.lang.php	(revision 12175)
@@ -802,5 +802,4 @@
 $lang['%s photos have been regenerated'] = '%s photos have been regenerated';
 $lang['%s photos can not be regenerated'] = '%s photos can not be regenerated';
-$lang['Only photos with HD can be regenerated!'] = 'Only photos with HD can be regenerated!';
 
 $lang['Updates'] = 'Updates';
@@ -860,3 +859,5 @@
 $lang['Learn more'] = 'Learn more';
 $lang['Select an album'] = 'Select an album';
+$lang['By default, Piwigo will create a new websize from the HD (high definition) version of your photo.'] = 'By default, Piwigo will create a new websize from the HD (high definition) version of your photo.';
+$lang['If no HD is available and if the current websize is bigger than resize dimensions, Piwigo will move it as HD and create a downsized websize photo from it.'] = 'If no HD is available and if the current websize is bigger than resize dimensions, Piwigo will move it as HD and create a downsized websize photo from it.';
 ?>
Index: /trunk/language/es_ES/admin.lang.php
===================================================================
--- /trunk/language/es_ES/admin.lang.php	(revision 12174)
+++ /trunk/language/es_ES/admin.lang.php	(revision 12175)
@@ -787,5 +787,4 @@
 $lang['%s photos have been regenerated'] = '%s fotos fueron regeneradas.';
 $lang['%s photos can not be regenerated'] = '%s fotos no pueden ser regeneradas';
-$lang['Only photos with HD can be regenerated!'] = 'Sólo las fotos de alta definición pueden ser regeneradas';
 $lang['display'] = 'Visualizar';
 $lang['Type in a search term'] = 'Introduce un término de búsqueda';
Index: /trunk/language/fr_FR/admin.lang.php
===================================================================
--- /trunk/language/fr_FR/admin.lang.php	(revision 12174)
+++ /trunk/language/fr_FR/admin.lang.php	(revision 12175)
@@ -801,5 +801,4 @@
 $lang['%s photos have been regenerated'] = '%s photos ont été régénérées';
 $lang['%s photos can not be regenerated'] = '%s photos ne peuvent pas être régénérées';
-$lang['Only photos with HD can be regenerated!'] = 'Seules les photos avec HD peuvent être régénérées';
 
 $lang['Updates'] = 'Mises à jour';
@@ -871,3 +870,5 @@
 $lang['Learn more'] = 'En savoir plus';
 $lang['Select an album'] = 'Selectionnez un album';
+$lang['By default, Piwigo will create a new websize from the HD (high definition) version of your photo.'] = 'Par défaut, Piwigo créera la nouvelle taille web à partir de la HD (haute définition).';
+$lang['If no HD is available and if the current websize is bigger than resize dimensions, Piwigo will move it as HD and create a downsized websize photo from it.'] = 'Si la HD n\'est pas disponible et que la version actuelle de la taille web est plus grande que les dimensions ci-dessous, alors Piwigo la considérera comme HD et créera la nouvelle taille web à partir de celle-ci.';
 ?>
Index: /trunk/language/he_IL/admin.lang.php
===================================================================
--- /trunk/language/he_IL/admin.lang.php	(revision 12174)
+++ /trunk/language/he_IL/admin.lang.php	(revision 12175)
@@ -813,5 +813,4 @@
 $lang['%s photos have been regenerated'] = '%s תמונות חודשו';
 $lang['%s photos can not be regenerated'] = '%s תמונות לא יכלו להתחדש';
-$lang['Only photos with HD can be regenerated!'] = 'רק תמונות HD יכולות להתחדש!';
 $lang['Updates'] = 'עדכונים';
 $lang['Update in progress... Please wait.'] = 'עדכון בתהליך... המתן.';
Index: /trunk/language/hu_HU/admin.lang.php
===================================================================
--- /trunk/language/hu_HU/admin.lang.php	(revision 12174)
+++ /trunk/language/hu_HU/admin.lang.php	(revision 12175)
@@ -799,5 +799,4 @@
 $lang['%s photos have been regenerated'] = '%s kép újragenerálva';
 $lang['%s photos can not be regenerated'] = '%s képet nem lehet újragenerálni';
-$lang['Only photos with HD can be regenerated!'] = 'Csak HD képeket lehet újragenerálni!';
 $lang['Updates'] = 'Frissítések';
 $lang['Update in progress... Please wait.'] = 'Frissítés folyamatban... Kérem várjon.';
Index: /trunk/language/it_IT/admin.lang.php
===================================================================
--- /trunk/language/it_IT/admin.lang.php	(revision 12174)
+++ /trunk/language/it_IT/admin.lang.php	(revision 12175)
@@ -801,5 +801,4 @@
 $lang['%s photos have been regenerated'] = '%s foto sono state rigenerate';
 $lang['%s photos can not be regenerated'] = '%s foto non possono essere rigenerate';
-$lang['Only photos with HD can be regenerated!'] = 'Solo le foto con una HD possono essere rigenerate';
 
 $lang['Updates'] = 'Aggiornamento';
Index: /trunk/language/lv_LV/admin.lang.php
===================================================================
--- /trunk/language/lv_LV/admin.lang.php	(revision 12174)
+++ /trunk/language/lv_LV/admin.lang.php	(revision 12175)
@@ -782,5 +782,4 @@
 $lang['%s photos have been regenerated'] = 'izveidotas %s fotogrāfijas';
 $lang['%s photos can not be regenerated'] = '%s fotogrāfijas nav iespējams reģenerēt';
-$lang['Only photos with HD can be regenerated!'] = 'Tikai HD kvalitātes fotogrāfijas iespējams reģenerēt!';
 $lang['new'] = 'jauns';
 $lang['No results'] = 'Nav rezultātu';
Index: /trunk/language/nl_NL/admin.lang.php
===================================================================
--- /trunk/language/nl_NL/admin.lang.php	(revision 12174)
+++ /trunk/language/nl_NL/admin.lang.php	(revision 12175)
@@ -790,5 +790,4 @@
 $lang['%s photos have been regenerated'] = '%s foto\'s zijn hergegenereerd.';
 $lang['%s photos can not be regenerated'] = '%s foto\'s konden niet opnieuw gegenereerd worden.';
-$lang['Only photos with HD can be regenerated!'] = 'Alleen foto\'s met HD kunnen opnieuw worden gegenereerd!';
 $lang['display'] = 'toon';
 $lang['new'] = 'nieuw';
Index: /trunk/language/pl_PL/admin.lang.php
===================================================================
--- /trunk/language/pl_PL/admin.lang.php	(revision 12174)
+++ /trunk/language/pl_PL/admin.lang.php	(revision 12175)
@@ -800,5 +800,4 @@
 $lang['%s photos have been regenerated'] = 'Stworzono %s zdjęć';
 $lang['%s photos can not be regenerated'] = '%s zdjęć nie mogło zostać stworzonych';
-$lang['Only photos with HD can be regenerated!'] = 'Tylko zdjęcia HD mogą być ponownie utworzone!';
 $lang['Updates'] = 'Aktualizacje';
 $lang['Update in progress... Please wait.'] = 'Trwa aktualizacja... Proszę czekać.';
Index: /trunk/language/ru_RU/admin.lang.php
===================================================================
--- /trunk/language/ru_RU/admin.lang.php	(revision 12174)
+++ /trunk/language/ru_RU/admin.lang.php	(revision 12175)
@@ -799,5 +799,4 @@
 $lang['%s photos have been regenerated'] = '%s фотографий было создано заново';
 $lang['%s photos can not be regenerated'] = '%s фотографий не было создано заново';
-$lang['Only photos with HD can be regenerated!'] = 'Только фотографии с HD могут быть созданы заново!';
 $lang['Updates'] = 'Обновление';
 $lang['Update in progress... Please wait.'] = 'Процесс обновления... Пожалуйста, подождите.';
Index: /trunk/language/sk_SK/admin.lang.php
===================================================================
--- /trunk/language/sk_SK/admin.lang.php	(revision 12174)
+++ /trunk/language/sk_SK/admin.lang.php	(revision 12175)
@@ -792,5 +792,4 @@
 $lang['%s photos have been regenerated'] = '%s fotografií bolo vytvorených';
 $lang['%s photos can not be regenerated'] = '%s fotografií nebolo vytvorených';
-$lang['Only photos with HD can be regenerated!'] = 'Len forografie v HD môžu byť vytvorené!';
 $lang['new'] = 'nové';
 $lang['No results'] = 'Bez výsledkov';
Index: /trunk/language/sr_RS/admin.lang.php
===================================================================
--- /trunk/language/sr_RS/admin.lang.php	(revision 12174)
+++ /trunk/language/sr_RS/admin.lang.php	(revision 12175)
@@ -802,5 +802,4 @@
 $lang['%s photos have been regenerated'] = 'Број регенерисаних фотографија: %s';
 $lang['%s photos can not be regenerated'] = 'Број фотографија који се не може регенерисати: %s';
-$lang['Only photos with HD can be regenerated!'] = 'Само фотографије у HD могу бити регенерисане!';
 $lang['Updates'] = 'Унапређење';
 $lang['Update in progress... Please wait.'] = 'У току је унапређење... Молимо Вас да сачеката.';
Index: /trunk/language/sv_SE/admin.lang.php
===================================================================
--- /trunk/language/sv_SE/admin.lang.php	(revision 12174)
+++ /trunk/language/sv_SE/admin.lang.php	(revision 12175)
@@ -788,5 +788,4 @@
 $lang['%s photos have been regenerated'] = '%s foton har skapats';
 $lang['%s photos can not be regenerated'] = '%s foton har inte skapats';
-$lang['Only photos with HD can be regenerated!'] = 'Endast foton med HD kan regenereras!';
 $lang['new'] = 'ny';
 $lang['No results'] = 'Inga poster hittades';
Index: /trunk/language/tr_TR/admin.lang.php
===================================================================
--- /trunk/language/tr_TR/admin.lang.php	(revision 12174)
+++ /trunk/language/tr_TR/admin.lang.php	(revision 12175)
@@ -784,5 +784,4 @@
 $lang['%s photos have been regenerated'] = '%s resimler oluşturuldu';
 $lang['%s photos can not be regenerated'] = '%s resimler oluşturulamadı';
-$lang['Only photos with HD can be regenerated!'] = 'Sadece HD  olan resimler oluşturulabilir!';
 $lang['new'] = 'yeni';
 $lang['No results'] = 'Sonuç yok';
Index: /trunk/language/vi_VN/admin.lang.php
===================================================================
--- /trunk/language/vi_VN/admin.lang.php	(revision 12174)
+++ /trunk/language/vi_VN/admin.lang.php	(revision 12175)
@@ -788,5 +788,4 @@
 $lang['%s photos have been regenerated'] = 'có %s ảnh đã được tạo ra';
 $lang['%s photos can not be regenerated'] = 'Có %s ảnh không thể tạo ra được';
-$lang['Only photos with HD can be regenerated!'] = 'Chỉ có những ảnh định dạng cao mới có thể được khởi tạo!';
 $lang['new'] = 'mới';
 $lang['No results'] = 'Không có kết quả nào';
Index: /trunk/language/zh_CN/admin.lang.php
===================================================================
--- /trunk/language/zh_CN/admin.lang.php	(revision 12174)
+++ /trunk/language/zh_CN/admin.lang.php	(revision 12175)
@@ -801,5 +801,4 @@
 $lang['%s photos have been regenerated'] = '%s 相片已被生成';
 $lang['%s photos can not be regenerated'] = '%s 相片不能被生成';
-$lang['Only photos with HD can be regenerated!'] = '只有高清相片才可被生成!';
 $lang['Update in progress... Please wait.'] = '正在更新... 请稍等.';
 $lang['Ignore this update'] = '忽略此更新';
