Index: /extensions/batch_manager_prefilters_ratio/index.php
===================================================================
--- /extensions/batch_manager_prefilters_ratio/index.php	(revision 27591)
+++ /extensions/batch_manager_prefilters_ratio/index.php	(revision 27591)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/batch_manager_prefilters_ratio/language/en_UK/description.txt
===================================================================
--- /extensions/batch_manager_prefilters_ratio/language/en_UK/description.txt	(revision 27591)
+++ /extensions/batch_manager_prefilters_ratio/language/en_UK/description.txt	(revision 27591)
@@ -0,0 +1,1 @@
+Add some prefilters of ratio of width/length in Batch Manager.
Index: /extensions/batch_manager_prefilters_ratio/language/en_UK/index.php
===================================================================
--- /extensions/batch_manager_prefilters_ratio/language/en_UK/index.php	(revision 27591)
+++ /extensions/batch_manager_prefilters_ratio/language/en_UK/index.php	(revision 27591)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2010 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/batch_manager_prefilters_ratio/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/batch_manager_prefilters_ratio/language/en_UK/plugin.lang.php	(revision 27591)
+++ /extensions/batch_manager_prefilters_ratio/language/en_UK/plugin.lang.php	(revision 27591)
@@ -0,0 +1,6 @@
+<?php
+$lang['ratio of the image 3/2'] = 'ratio of the image 3/2';
+$lang['ratio of the image 4/3'] = 'ratio of the image 4/3';
+$lang['ratio of the image 16/9'] = 'ratio of the image 16/9';
+$lang['ratio of the image square'] = 'ratio of the image square';
+?>
Index: /extensions/batch_manager_prefilters_ratio/language/fr_FR/description.txt
===================================================================
--- /extensions/batch_manager_prefilters_ratio/language/fr_FR/description.txt	(revision 27591)
+++ /extensions/batch_manager_prefilters_ratio/language/fr_FR/description.txt	(revision 27591)
@@ -0,0 +1,1 @@
+﻿Ajoute des préfiltres de ratio longeur/largeur dans la gestion par lot.
Index: /extensions/batch_manager_prefilters_ratio/language/fr_FR/index.php
===================================================================
--- /extensions/batch_manager_prefilters_ratio/language/fr_FR/index.php	(revision 27591)
+++ /extensions/batch_manager_prefilters_ratio/language/fr_FR/index.php	(revision 27591)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2010 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/batch_manager_prefilters_ratio/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/batch_manager_prefilters_ratio/language/fr_FR/plugin.lang.php	(revision 27591)
+++ /extensions/batch_manager_prefilters_ratio/language/fr_FR/plugin.lang.php	(revision 27591)
@@ -0,0 +1,6 @@
+<?php
+$lang['ratio of the image 3/2'] = 'ratio de l\'image 3/2';
+$lang['ratio of the image 4/3'] = 'ratio de l\'image 4/3';
+$lang['ratio of the image 16/9'] = 'ratio de l\'image 16/9';
+$lang['ratio of the image square'] = 'ratio de l\'image square';
+?>
Index: /extensions/batch_manager_prefilters_ratio/language/index.php
===================================================================
--- /extensions/batch_manager_prefilters_ratio/language/index.php	(revision 27591)
+++ /extensions/batch_manager_prefilters_ratio/language/index.php	(revision 27591)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2010 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/batch_manager_prefilters_ratio/main.inc.php
===================================================================
--- /extensions/batch_manager_prefilters_ratio/main.inc.php	(revision 27591)
+++ /extensions/batch_manager_prefilters_ratio/main.inc.php	(revision 27591)
@@ -0,0 +1,100 @@
+<?php
+/*
+Plugin Name: Batch Manager Prefilters ratio
+Version: 1.0
+Description: Add ration image prefilters in Batch Manager.
+Plugin URI: http://piwigo.org/ext/extension_view.php?eid=530
+Author: Miklfe
+Author URI: http://www.piwitheme.fr
+*/
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+  add_event_handler('get_batch_manager_prefilters', 'mps_add_batch_manager_prefilters');
+  add_event_handler('perform_batch_manager_prefilters', 'mps_perform_batch_manager_prefilters', EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
+
+  load_language('plugin.lang', dirname(__FILE__).'/');
+
+
+/**
+ * add a prefilter to the Batch Downloader
+ */
+function mps_add_batch_manager_prefilters($prefilters)
+{
+	array_push($prefilters, array(
+    'ID' => 'mps3.2',
+    'NAME' => l10n('ratio of the image 3/2'),
+  ));
+	array_push($prefilters, array(
+    'ID' => 'mps4.3',
+    'NAME' => l10n('ratio of the image 4/3'),
+  ));
+	array_push($prefilters, array(
+    'ID' => 'mps16.9',
+    'NAME' => l10n('ratio of the image 16/9'),
+  ));
+	array_push($prefilters, array(
+    'ID' => 'mpssquare',
+    'NAME' => l10n('ratio of the image square'),
+  ));
+  
+	return $prefilters;
+}
+
+/**
+ * perform added prefilter
+ */
+function mps_perform_batch_manager_prefilters($filter_sets, $prefilter)
+{
+if ($prefilter == 'mps3.2')
+	{
+ $ratios = array(
+	1.47,
+	1.53,
+	0.63,
+	0.69
+	);
+ $res= filter_sets_image_format($ratios);
+ $filter_sets[] = $res;	
+	}
+	
+if ($prefilter == 'mps4.3')
+	{
+ $ratios = array(
+	1.3,
+	1.4,
+	0.72,
+	0.78
+	);
+ $res= filter_sets_image_format($ratios);
+ $filter_sets[] = $res;	
+	}
+	
+if ($prefilter == 'mps16.9')
+	{
+ $ratios = array(
+	1.74,
+	1.80,
+	0.53,
+	0.59
+	);
+ $res= filter_sets_image_format($ratios);
+ $filter_sets[] = $res;	
+	}
+
+if ($prefilter == 'mpssquare')
+	{
+ $ratios = array(
+	0.97,
+	1.03,
+	0.97,
+	1.03
+	);
+ $res= filter_sets_image_format($ratios);
+ $filter_sets[] = $res;	
+	}
+	
+	return $filter_sets;
+}
+
+?>
