Index: /trunk/admin/batch_manager_global.php
===================================================================
--- /trunk/admin/batch_manager_global.php	(revision 13543)
+++ /trunk/admin/batch_manager_global.php	(revision 13544)
@@ -412,37 +412,26 @@
   }
 
-  if ('regenerateThumbnails' == $action)
+  if ('delete_derivatives' == $action)
+  {
+    $query='SELECT path,representative_ext FROM '.IMAGES_TABLE.'
+  WHERE id IN ('.implode(',', $collection).')';
+    $result = pwg_query($query);
+    while ($info = pwg_db_fetch_assoc($result))
+    {
+      foreach( $_POST['del_derivatives_type'] as $type)
+      {
+        delete_element_derivatives($info, $type);
+      }
+    }
+  }
+
+  if ('generate_derivatives' == $action)
   {
     if ($_POST['regenerateSuccess'] != '0')
-      array_push($page['infos'], sprintf(l10n('%s thumbnails have been regenerated'), $_POST['regenerateSuccess']));
+      array_push($page['infos'], sprintf(l10n('%s photos were generated'), $_POST['regenerateSuccess']));
 
     if ($_POST['regenerateError'] != '0')
-      array_push($page['warnings'], sprintf(l10n('%s thumbnails can not be regenerated'), $_POST['regenerateError']));
-
-    $update_fields = array('thumb_maxwidth', 'thumb_maxheight', 'thumb_quality', 'thumb_crop', 'thumb_follow_orientation');
-  }
-
-  if ('regenerateWebsize' == $action)
-  {
-    if ($_POST['regenerateSuccess'] != '0')
-      array_push($page['infos'], sprintf(l10n('%s photos have been regenerated'), $_POST['regenerateSuccess']));
-
-    if ($_POST['regenerateError'] != '0')
-      array_push($page['warnings'], sprintf(l10n('%s photos can not be regenerated'), $_POST['regenerateError']));
-
-    $update_fields = array('websize_maxwidth', 'websize_maxheight', 'websize_quality');
-  }
-
-  if (!empty($update_fields))
-  {
-    // Update upload configuration
-    $updates = array();
-    foreach ($update_fields as $field)
-    {
-      $value = !empty($_POST[$field]) ? $_POST[$field] : null;
-      $form_values[$field] = $value;
-      $updates[$field] = $value;
-    }
-    save_upload_form_config($updates);
+      array_push($page['warnings'], sprintf(l10n('%s photos were not generated'), $_POST['regenerateError']));
+
   }
 
@@ -673,4 +662,17 @@
   );
 
+//derivatives
+$del_deriv_map = array();
+foreach(ImageStdParams::get_defined_type_map() as $params)
+{
+  $del_deriv_map[$params->type] = l10n($params->type);
+}
+$template->assign(
+    array(
+      'del_derivatives_types' => $del_deriv_map,
+      'generate_derivatives_types' => $del_deriv_map,
+    )
+  );
+
 // +-----------------------------------------------------------------------+
 // |                        global mode thumbnails                         |
@@ -757,5 +759,5 @@
   {
     $nb_thumbs_page++;
-    $src = DerivativeImage::thumb_url($row);
+    $src_image = new SrcImage($row);
 
     $title = render_element_name($row);
@@ -769,9 +771,9 @@
       array(
         'ID' => $row['id'],
-        'TN_SRC' => $src,
+        'TN_SRC' => DerivativeImage::url(IMG_THUMB, $src_image),
         'FILE' => $row['file'],
         'TITLE' => $title,
         'LEVEL' => $row['level'],
-        'FILE_SRC' => $row['path'],
+        'FILE_SRC' => DerivativeImage::url(IMG_LARGE, $src_image),
         'U_EDIT' => get_root_url().'admin.php?page=photo-'.$row['id'],
         )
Index: /trunk/admin/themes/default/template/batch_manager_global.tpl
===================================================================
--- /trunk/admin/themes/default/template/batch_manager_global.tpl	(revision 13543)
+++ /trunk/admin/themes/default/template/batch_manager_global.tpl	(revision 13544)
@@ -95,12 +95,11 @@
 var nb_thumbs_set = {$nb_thumbs_set};
 var applyOnDetails_pattern = "{'on the %d selected photos'|@translate}";
-var elements = new Array();
+var elements = [];
 var all_elements = [{if !empty($all_elements)}{','|@implode:$all_elements}{/if}];
+var generate_derivatives_done=false;
 
 var selectedMessage_pattern = "{'%d of %d photos selected'|@translate}";
 var selectedMessage_none = "{'No photo selected, %d photos in current set'|@translate}";
 var selectedMessage_all = "{'All %d photos are selected'|@translate}";
-var regenerateThumbnailsMessage = "{'Thumbnails generation in progress...'|@translate}";
-var regenerateWebsizeMessage = "{'Photos generation in progress...'|@translate}";
 
 var width_str = '{'Width'|@translate}';
@@ -163,10 +162,14 @@
     barImage: 'themes/default/images/progressbg_orange.gif'
   });
-  type = success ? 'regenerateSuccess': 'regenerateError'
-  s = jQuery('[name="'+type+'"]').val();
-  jQuery('[name="'+type+'"]').val(++s);
-
-  if (val == max)
-    jQuery('#applyAction').click();
+	if (success !== undefined) {
+		var type = success ? 'regenerateSuccess': 'regenerateError',
+			s = jQuery('[name="'+type+'"]').val();
+		jQuery('[name="'+type+'"]').val(++s);
+	}
+
+	if (val == max) {
+		generate_derivatives_done = true;
+		jQuery('#applyAction').click();
+	}
 }
 
@@ -403,98 +406,81 @@
 
   jQuery('#applyAction').click(function() {
-    if (elements.length != 0)
-    {
-      return true;
-    }
-    else if (jQuery('[name="selectAction"]').val() == 'regenerateThumbnails')
-    {
-      resizeMethod = 'pwg.images.resizeThumbnail';
-      maxRequests = 3;
-      maxwidth = jQuery('input[name="thumb_maxwidth"]').val();
-      maxheight = jQuery('input[name="thumb_maxheight"]').val();
-      regenerationText = regenerateThumbnailsMessage;
-      crop = jQuery('input[name="thumb_crop"]').is(':checked');
-      follow_orientation = jQuery('input[name="thumb_follow_orientation"]').is(':checked');
-    }
-    else if(jQuery('[name="selectAction"]').val() == 'regenerateWebsize')
-    {
-      resizeMethod = 'pwg.images.resizeWebsize';
-      maxRequests = 1;
-      maxwidth = jQuery('input[name="websize_maxwidth"]').val();
-      maxheight = jQuery('input[name="websize_maxheight"]').val();
-      regenerationText = regenerateWebsizeMessage;
-      crop = false;
-      follow_orientation = false;
-    }
-    else return true;
-
-    jQuery('.bulkAction').hide();
-    jQuery('#regenerationText').html(regenerationText);
-
-    var queuedManager = jQuery.manageAjax.create('queued', { 
-      queue: true,  
-      cacheResponse: false,
-      maxRequests: maxRequests
-    });
-
-    if (jQuery('input[name="setSelected"]').attr('checked'))
-      elements = all_elements;
-    else
-      jQuery('input[name="selection[]"]').each(function() {
-        if (jQuery(this).attr('checked')) {
-          elements.push(jQuery(this).val());
-        }
-      });
-
-    progressBar_max = elements.length;
-    todo = 0;
-
-    jQuery('#applyActionBlock').hide();
-    jQuery('select[name="selectAction"]').hide();
-    jQuery('#regenerationMsg').show();
-    
-    jQuery('#progressBar').progressBar(0, {
-      max: progressBar_max,
-      textFormat: 'fraction',
-      boxImage: 'themes/default/images/progressbar.gif',
-      barImage: 'themes/default/images/progressbg_orange.gif'
-    });
-
-    for (i=0;i<elements.length;i++) {
-      queuedManager.add({
-        type: 'GET', 
-        url: 'ws.php', 
-        data: {
-          method: resizeMethod,
-          maxwidth: maxwidth,
-          maxheight: maxheight,
-          crop: crop,
-          follow_orientation: follow_orientation,
-          image_id: elements[i],
-          format: 'json'
-        },
-        dataType: 'json',
-        success: ( function(data) { progress(++todo, progressBar_max, data['result']) }),
-        error: ( function(data) { progress(++todo, progressBar_max, false) })
-      });
-    }
-    return false;
-  });
-
-  function toggleCropFields(prefix) {
-    if (jQuery("#"+prefix+"_crop").is(':checked')) {
-      jQuery("#"+prefix+"_width_th").text(width_str);
-      jQuery("#"+prefix+"_height_th").text(height_str);
-      jQuery("#"+prefix+"_follow_orientation_tr").show();
-    }
-    else {
-      jQuery("#"+prefix+"_width_th").text(max_width_str);
-      jQuery("#"+prefix+"_height_th").text(max_height_str);
-      jQuery("#"+prefix+"_follow_orientation_tr").hide();
-    }
-  }
-
-  toggleCropFields("thumb");
-  jQuery("#thumb_crop").click(function () {toggleCropFields("thumb")});
+		if (jQuery('[name="selectAction"]').val() != 'generate_derivatives')
+		{
+			return true;
+		}
+		if (generate_derivatives_done)
+		{
+			return true;
+		}
+
+		jQuery('.bulkAction').hide();
+
+		var queuedManager = jQuery.manageAjax.create('queued', { 
+			queue: true,  
+			cacheResponse: false,
+			maxRequests: 1
+		});
+
+		if (jQuery('input[name="setSelected"]').attr('checked'))
+			elements = all_elements;
+		else
+			jQuery('input[name="selection[]"]').each(function() {
+				if (jQuery(this).attr('checked')) {
+					elements.push(jQuery(this).val());
+				}
+			});
+
+		progressBar_max = 0;
+		todo = 0;
+
+		jQuery('#applyActionBlock').hide();
+		jQuery('select[name="selectAction"]').hide();
+		jQuery('#regenerationMsg').show();
+		
+		jQuery('#progressBar').progressBar(0, {
+			max: progressBar_max,
+			textFormat: 'fraction',
+			boxImage: 'themes/default/images/progressbar.gif',
+			barImage: 'themes/default/images/progressbg_orange.gif'
+		});
+
+		getDerivativeUrls();
+		return false;
+  });
+
+	function getDerivativeUrls() {
+		if (elements.length==0)
+			return;
+		var ids = elements.splice(0, 500);
+		var params = {max_urls: 100000, ids: ids, types: []};
+		jQuery("#action_generate_derivatives input").each( function(i, t) {
+			if ($(t).attr("checked"))
+				params.types.push( t.value );
+		} );
+
+		jQuery.ajax( {
+			type: "POST",
+			url: 'ws.php?format=json&method=pwg.getMissingDerivatives',
+			data: params,
+			dataType: "json",
+			success: function(data) {
+				if (!data.stat || data.stat != "ok") {
+					return;
+				}
+				progressBar_max += data.result.urls.length;
+				progress(todo, progressBar_max);
+				for (var i=0; i < data.result.urls.length; i++) {
+					jQuery.manageAjax.add("queued", {
+						type: 'GET', 
+						url: data.result.urls[i] + "&ajaxload=true", 
+						dataType: 'json',
+						success: ( function(data) { progress(++todo, progressBar_max, true) }),
+						error: ( function(data) { progress(++todo, progressBar_max, false) })
+					});
+				}
+			}
+		} );
+	}
 
   checkPermitAction()
@@ -502,11 +488,13 @@
 
 jQuery(window).load(function() {
-  var max_dim = 0;
-  $(".thumbnails img").each(function () {
-    max_dim = Math.max(max_dim, $(this).height(), $(this).width() );
-  });
-  max_dim += 35;
-  $("ul.thumbnails span, ul.thumbnails label").css('width', max_dim+'px').css('height', max_dim+'px');
-  $('ul.thumbnails').enableShiftClick();
+	var max_w=0, max_h=0;
+	$(".thumbnails img").each(function () {
+		max_w = Math.max(max_w, $(this).width() );
+		max_h = Math.max(max_h, $(this).height() );
+	});
+	max_w += 10;
+	max_h += 35;
+	$("ul.thumbnails span, ul.thumbnails label").css('width', max_w+'px').css('height', max_h+'px');
+	$('ul.thumbnails').enableShiftClick();
 });
 {/literal}{/footer_script}
@@ -604,31 +592,27 @@
 
     <ul class="thumbnails">
-      {foreach from=$thumbnails item=thumbnail}
-        {if in_array($thumbnail.ID, $selection)}
-          {assign var='isSelected' value=true}
-        {else}
-          {assign var='isSelected' value=false}
-        {/if}
-
-      <li>
-        <span class="wrap1">
-          <label>
-            <span class="wrap2{if $isSelected} thumbSelected{/if}">
-            <div class="actions"><a href="{$thumbnail.FILE_SRC}" class="preview-box">{'Zoom'|@translate}</a> &middot; <a href="{$thumbnail.U_EDIT}" target="_blank">{'Edit'|@translate}</a></div>
-              {if $thumbnail.LEVEL > 0}
-              <em class="levelIndicatorB">{$pwg->l10n($pwg->sprintf('Level %d',$thumbnail.LEVEL))}</em>
-              <em class="levelIndicatorF" title="{'Who can see these photos?'|@translate} : ">{$pwg->l10n($pwg->sprintf('Level %d',$thumbnail.LEVEL))}</em>
-              {/if}
-              <span>
-                <img src="{$thumbnail.TN_SRC}"
-                   alt="{$thumbnail.FILE}"
-                   title="{$thumbnail.TITLE|@escape:'html'}"
-                   class="thumbnail">
-              </span>
-            </span>
-            <input type="checkbox" name="selection[]" value="{$thumbnail.ID}" {if $isSelected}checked="checked"{/if}>
-          </label>
-        </span>
-      </li>
+			{foreach from=$thumbnails item=thumbnail}
+				{if in_array($thumbnail.ID, $selection)}
+					{assign var='isSelected' value=true}
+				{else}
+					{assign var='isSelected' value=false}
+				{/if}
+			<li>
+				<span class="wrap1">
+					<label>
+						<span class="wrap2{if $isSelected} thumbSelected{/if}">
+						<div class="actions"><a href="{$thumbnail.FILE_SRC}" class="preview-box">{'Zoom'|@translate}</a> &middot; <a href="{$thumbnail.U_EDIT}" target="_blank">{'Edit'|@translate}</a></div>
+							{if $thumbnail.LEVEL > 0}
+							<em class="levelIndicatorB">{$pwg->l10n($pwg->sprintf('Level %d',$thumbnail.LEVEL))}</em>
+							<em class="levelIndicatorF" title="{'Who can see these photos?'|@translate} : ">{$pwg->l10n($pwg->sprintf('Level %d',$thumbnail.LEVEL))}</em>
+							{/if}
+							<span>
+								<img src="{$thumbnail.TN_SRC}" alt="{$thumbnail.FILE}" title="{$thumbnail.TITLE|@escape:'html'}" class="thumbnail">
+							</span>
+						</span>
+						<input type="checkbox" name="selection[]" value="{$thumbnail.ID}" {if $isSelected}checked="checked"{/if}>
+					</label>
+				</span>
+			</li>
       {/foreach}
     </ul>
@@ -687,6 +671,6 @@
       <option value="add_to_caddie">{'Add to caddie'|@translate}</option>
   {/if}
-      <option value="regenerateThumbnails">{'Regenerate Thumbnails'|@translate}</option>
-      <option value="regenerateWebsize">{'Regenerate Websize Photos'|@translate}</option>
+		<option value="delete_derivatives">{'Delete multiple size images'|@translate}</option>
+		<option value="generate_derivatives">{'Generate multiple size images'|@translate}</option>
   {if !empty($element_set_global_plugins_actions)}
     {foreach from=$element_set_global_plugins_actions item=action}
@@ -785,57 +769,43 @@
     </div>
 
-    <!-- regenerate thumbnails -->
-    <div id="action_regenerateThumbnails" class="bulkAction">
-      <table style="margin-left:20px;">
-        <tr>
-          <th><label for="thumb_crop">{'Crop'|@translate}</label></th>
-          <td><input type="checkbox" name="thumb_crop" id="thumb_crop" {if $upload_form_settings.thumb_crop}checked="checked"{/if}></td>
-        </tr>
-        <tr id="thumb_follow_orientation_tr">
-          <th><label for="thumb_follow_orientation">{'Follow Orientation'|@translate}</label></th>
-          <td><input type="checkbox" name="thumb_follow_orientation" id="thumb_follow_orientation" {if $upload_form_settings.thumb_follow_orientation}checked="checked"{/if}></td>
-        </tr>
-        <tr>
-          <th id="thumb_width_th">{'Maximum Width'|@translate}</th>
-          <td><input type="text" name="thumb_maxwidth" value="{$upload_form_settings.thumb_maxwidth}" size="4" maxlength="4"> {'pixels'|@translate}</td>
-        </tr>
-        <tr>
-          <th id="thumb_height_th">{'Maximum Height'|@translate}</th>
-          <td><input type="text" name="thumb_maxheight" value="{$upload_form_settings.thumb_maxheight}" size="4" maxlength="4"> {'pixels'|@translate}</td>
-        </tr>
-        <tr>
-          <th>{'Image Quality'|@translate}</th>
-          <td><input type="text" name="thumb_quality" value="{$upload_form_settings.thumb_quality}" size="3" maxlength="3"> %</td>
-        </tr>
-      </table>
-    </div>
-
-    <!-- regenerate websize -->
-    <div id="action_regenerateWebsize" class="bulkAction">
-      <p>
-        <img src="admin/themes/default/icon/warning.png" alt="!" style="vertical-align:middle;">
-        {'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>
-
-      <table style="margin:10px 20px;">
-        <tr>
-          <th>{'Maximum Width'|@translate}</th>
-          <td><input type="text" name="websize_maxwidth" value="{$upload_form_settings.websize_maxwidth}" size="4" maxlength="4"> {'pixels'|@translate}</td>
-        </tr>
-        <tr>
-          <th>{'Maximum Height'|@translate}</th>
-          <td><input type="text" name="websize_maxheight" value="{$upload_form_settings.websize_maxheight}" size="4" maxlength="4"> {'pixels'|@translate}</td>
-        </tr>
-        <tr>
-          <th>{'Image Quality'|@translate}</th>
-          <td><input type="text" name="websize_quality" value="{$upload_form_settings.websize_quality}" size="3" maxlength="3"> %</td>
-        </tr>
-      </table>
-    </div>
-
+		<!-- generate derivatives -->
+		<div id="action_generate_derivatives" class="bulkAction">
+			<a href="javascript:selectGenerateDerivAll()">{'All'|@translate}</a>,
+			<a href="javascript:selectGenerateDerivNone()">{'None'|@translate}</a>
+			<br>
+			{foreach from=$generate_derivatives_types key=type item=disp}
+				<label><input type="checkbox" name="generate_derivatives_type[]" value="{$type}"> {$disp}</label>
+			{/foreach}
+			{footer_script}
+			function selectGenerateDerivAll() {ldelim}
+				$("#action_generate_derivatives input[type=checkbox]").attr("checked", true);
+			}
+			function selectGenerateDerivNone() {ldelim}
+				$("#action_generate_derivatives input[type=checkbox]").attr("checked", false);
+			}
+			{/footer_script}
+		</div>
+
+		<!-- delete derivatives -->
+		<div id="action_delete_derivatives" class="bulkAction">
+			<a href="javascript:selectDelDerivAll()">{'All'|@translate}</a>,
+			<a href="javascript:selectDelDerivNone()">{'None'|@translate}</a>
+			<br>
+			{foreach from=$del_derivatives_types key=type item=disp}
+				<label><input type="checkbox" name="del_derivatives_type[]" value="{$type}"> {$disp}</label>
+			{/foreach}
+			{footer_script}
+			function selectDelDerivAll() {ldelim}
+				$("#action_delete_derivatives input[type=checkbox]").attr("checked", true);
+			}
+			function selectDelDerivNone() {ldelim}
+				$("#action_delete_derivatives input[type=checkbox]").attr("checked", false);
+			}
+			{/footer_script}
+		</div>
+		
     <!-- progress bar -->
-    <div id="regenerationMsg" class="bulkAction">
-      <p id="regenerationText" style="margin-bottom:10px;"></p>
+    <div id="regenerationMsg" class="bulkAction" style="display:none">
+      <p id="regenerationText" style="margin-bottom:10px;">{'Generate multiple size images'|@translate}</p>
       <span class="progressBar" id="progressBar"></span>
       <input type="hidden" name="regenerateSuccess" value="0">
Index: /trunk/admin/themes/default/template/maintenance.tpl
===================================================================
--- /trunk/admin/themes/default/template/maintenance.tpl	(revision 13543)
+++ /trunk/admin/themes/default/template/maintenance.tpl	(revision 13544)
@@ -35,5 +35,5 @@
 	<li><a href="{$U_MAINT_SEARCH}"onclick="return confirm('{'Purge search history'|@translate|@escape:'javascript'}');">{'Purge search history'|@translate}</a></li>
 	<li><a href="{$U_MAINT_COMPILED_TEMPLATES}">{'Purge compiled templates'|@translate}</a></li>
-	<li>{'Purge derivative image cache'|@translate}: 
+	<li>{'Delete multiple size images'|@translate}: 
 	{foreach from=$purge_derivatives key=name item=url name=loop}{if !$smarty.foreach.loop.first}, {/if}<a href="{$url}">{$name}</a>{/foreach}
 	</li>
Index: /trunk/include/ws_functions.inc.php
===================================================================
--- /trunk/include/ws_functions.inc.php	(revision 13543)
+++ /trunk/include/ws_functions.inc.php	(revision 13544)
@@ -220,4 +220,8 @@
   $where_clauses = ws_std_image_sql_filter( $params, '' );
   $where_clauses[] = 'id<start_id';
+  if ( !empty($params['ids']) )
+  {
+    $where_clauses[] = 'id IN ('.implode(',',$params['ids']).')';
+  }
 
   $query_model = 'SELECT id, path, representative_ext, width, height
@@ -3267,155 +3271,4 @@
 }
 
-function ws_images_resizethumbnail($params, &$service)
-{
-  if (!is_admin())
-  {
-    return new PwgError(401, 'Access denied');
-  }
-
-  if (empty($params['image_id']) and empty($params['image_path']))
-  {
-    return new PwgError(403, "image_id or image_path is missing");
-  }
-
-  include_once(PHPWG_ROOT_PATH.'admin/include/functions_upload.inc.php');
-  include_once(PHPWG_ROOT_PATH.'admin/include/image.class.php');
-
-  if (!empty($params['image_id']))
-  {
-    $query='
-SELECT id, path, tn_ext, has_high
-  FROM '.IMAGES_TABLE.'
-  WHERE id = '.(int)$params['image_id'].'
-;';
-    $image = pwg_db_fetch_assoc(pwg_query($query));
-
-    if ($image == null)
-    {
-      return new PwgError(403, "image_id not found");
-    }
-
-    $image_path = $image['path'];
-    $thumb_path = get_thumbnail_path($image);
-  }
-  else
-  {
-    $image_path = $params['image_path'];
-    $thumb_path = file_path_for_type($image_path, 'thumb');
-  }
-
-  if (!file_exists($image_path) or !is_valid_image_extension(get_extension($image_path)))
-  {
-    return new PwgError(403, "image can't be resized");
-  }
-
-  $result = false;
-  prepare_directory(dirname($thumb_path));
-  $img = new pwg_image($image_path, $params['library']);
-
-  if (!is_bool($params['crop']))
-    $params['crop'] = get_boolean($params['crop']);
-  if (!is_bool($params['follow_orientation']))
-    $params['follow_orientation'] = get_boolean($params['follow_orientation']);
-
-  $result =  $img->pwg_resize(
-    $thumb_path,
-    $params['maxwidth'],
-    $params['maxheight'],
-    $params['quality'],
-    false, // automatic rotation is not needed for thumbnails.
-    true, // strip metadata
-    $params['crop'],
-    $params['follow_orientation']
-  );
-
-  $img->destroy();
-  return $result;
-}
-
-function ws_images_resizewebsize($params, &$service)
-{
-  if (!is_admin())
-  {
-    return new PwgError(401, 'Access denied');
-  }
-
-  include_once(PHPWG_ROOT_PATH.'include/functions_picture.inc.php');
-  include_once(PHPWG_ROOT_PATH.'admin/include/functions_upload.inc.php');
-  include_once(PHPWG_ROOT_PATH.'admin/include/image.class.php');
-
-  $query='
-SELECT id, path, tn_ext, has_high, width, height
-  FROM '.IMAGES_TABLE.'
-  WHERE id = '.(int)$params['image_id'].'
-;';
-  $image = pwg_db_fetch_assoc(pwg_query($query));
-
-  if ($image == null)
-  {
-    return new PwgError(403, "image_id not found");
-  }
-
-  $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))
-  {
-    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");
-    }
-  }
-
-  $result = false;
-  $img = new pwg_image($hd_path, $params['library']);
-
-  $result = $img->pwg_resize(
-    $image_path,
-    $params['maxwidth'],
-    $params['maxheight'],
-    $params['quality'],
-    $params['automatic_rotation'],
-    false // strip metadata
-    );
-
-  $img->destroy();
-
-  global $conf;
-  $conf['use_exif'] = false;
-  $conf['use_iptc'] = false;
-  sync_metadata(array($image['id']));
-
-  return $result;
-}
-
 function ws_extensions_update($params, &$service)
 {
Index: /trunk/language/en_UK/admin.lang.php
===================================================================
--- /trunk/language/en_UK/admin.lang.php	(revision 13543)
+++ /trunk/language/en_UK/admin.lang.php	(revision 13544)
@@ -79,6 +79,4 @@
 $lang['%s photos can not be regenerated'] = '%s photos can not be regenerated';
 $lang['%s photos have been regenerated'] = '%s photos have been regenerated';
-$lang['%s thumbnails can not be regenerated'] = '%s thumbnails can not be regenerated';
-$lang['%s thumbnails have been regenerated'] = '%s thumbnails have been regenerated';
 $lang['%s value is not correct file because exif are not supported'] = "%s value is incorrect because exif are not supported";
 $lang['(this tag will be deleted)'] = '(this tag will be deleted)';
@@ -573,6 +571,4 @@
 $lang['Refresh photo set'] = 'Refresh photo set';
 $lang['Refresh'] = "Refresh";
-$lang['Regenerate Thumbnails'] = 'Regenerate Thumbnails';
-$lang['Regenerate Websize Photos'] = 'Regenerate Websize Photos';
 $lang['registration date'] = "registration date";
 $lang['Reinitialize check integrity'] = "Reinitialize integrity check";
@@ -867,3 +863,5 @@
 $lang['ReGalAndroid (RemoteGallery client for Android) is an open source (GPL v3) Piwigo client for the Android platform.'] = 'ReGalAndroid (RemoteGallery client for Android) is an open source (GPL v3) Piwigo client for the Android platform.';
 $lang['Features include gallery browsing, album creation and photo upload.'] = 'Features include gallery browsing, album creation and photo upload.';
+$lang['Generate multiple size images']='Generate multiple size images';
+$lang['Delete multiple size images']='Delete multiple size images';
 ?>
Index: /trunk/ws.php
===================================================================
--- /trunk/ws.php	(revision 13543)
+++ /trunk/ws.php	(revision 13544)
@@ -90,4 +90,5 @@
       array(
         'types' => array( 'default'=>array(), 'flags'=>WS_PARAM_FORCE_ARRAY),
+        'ids' => array( 'default'=>array(), 'flags'=>WS_PARAM_FORCE_ARRAY),
         'max_urls' => array( 'default' => 200 ),
         'prev_page' => array( 'default'=> null),
@@ -458,35 +459,4 @@
     'activate/deactivate/delete/set_default a theme<br>administration status required'
     );
-
-  $service->addMethod(
-    'pwg.images.resizeThumbnail',
-    'ws_images_resizethumbnail',
-    array(
-      'image_id' => array('default' => null),
-      'image_path' => array('default' => null),
-      'maxwidth' => array('default' => $conf['upload_form_thumb_maxwidth']),
-      'maxheight' => array('default' => $conf['upload_form_thumb_maxheight']),
-      'quality' => array('default' => $conf['upload_form_thumb_quality']),
-      'crop' => array('default' => $conf['upload_form_thumb_crop']),
-      'follow_orientation' => array('default' => $conf['upload_form_thumb_follow_orientation']),
-      'library' => array('default' => $conf['graphics_library']),
-    ),
-    'Create/Regenerate thumbnails photo with given arguments.
-<br>One of arguments "image_id" or "image_path" must be sent.'
-  );
-
-  $service->addMethod(
-    'pwg.images.resizeWebsize',
-    'ws_images_resizewebsize',
-    array(
-      'image_id' => array(),
-      'maxwidth' => array('default' => $conf['upload_form_websize_maxwidth']),
-      'maxheight' => array('default' => $conf['upload_form_websize_maxheight']),
-      'quality' => array('default' => $conf['upload_form_websize_quality']),
-      'automatic_rotation' => array('default' => $conf['upload_form_automatic_rotation']),
-      'library' => array('default' => $conf['graphics_library']),
-    ),
-    'Regenerate websize photo with given arguments.'
-  );
 
   $service->addMethod(
