Index: /extensions/Tags2File/db_export_image_metadata.php
===================================================================
--- /extensions/Tags2File/db_export_image_metadata.php	(revision 4620)
+++ /extensions/Tags2File/db_export_image_metadata.php	(revision 4620)
@@ -0,0 +1,60 @@
+<?php
+defined('PHPWG_ROOT_PATH') or trigger_error('Hacking attempt!', E_USER_ERROR);
+//if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+$plugin_path = dirname(__FILE__).'/';
+
+include_once($plugin_path.'db_export_image_metadata_class.php');
+
+// Template and variable init
+global $template;
+load_language('plugin.lang', $plugin_path);
+$destDir = ""; $exiftoolPath = ""; $exiv2path = ""; $use_exiftool = true; $use_exiv2 = true; 
+$use_utf8 = true; $use_whole_desc = true; $nb_tags = 0; $test_mode = false; $test_img_id ='2 OR img.id = 655';
+
+// Retrieve form
+if (isset($_POST['exportmetadata_post_form']) == 1)
+//if (isset($_POST['submit']))
+{
+	if ($_POST['exportmetadata_dir'] !== '')
+	{
+		$destDir = $_POST['exportmetadata_dir'];
+		$exiv2path = realpath($_POST['exiv2_path']);
+		$exiftoolPath = realpath($_POST['exiftool_path']);
+		$use_exiftool = isset($_POST['use_exiftool']); //checkbox
+		$use_exiv2 = isset($_POST['use_exiv2']); //checkbox
+		$use_utf8 = isset($_POST['use_utf8']); //checkbox
+		$use_whole_desc = isset($_POST['multi_lang_desc']) ? $_POST['multi_lang_desc']  === 'true' : true;
+		$test_mode = isset($_POST['test_mode']); //checkbox
+		$test_img_id = $_POST['test_imgid'];
+		if (file_exists($destDir))
+		{
+			$destDir = realpath($destDir);
+			$export_image_metadata = new ExportImageMetadata($use_exiftool, $use_exiv2, $use_whole_desc, $use_utf8);
+			$export_image_metadata->set_test_mode($test_mode, $test_img_id);
+			$export_image_metadata->set_tool_pathes($exiftoolPath, $exiv2path);
+			$nb_tags = $export_image_metadata->image_properties_to_file($destDir);
+		}
+	}
+}
+
+// template assign
+$template->set_filenames( array('db_export_image_metadata_content' => $plugin_path.'db_export_image_metadata.tpl') );
+
+$template->assign(array(
+	'F_ACTION' => PHPWG_ROOT_PATH.'admin.php?page=plugin&amp;section=Tags2File%2Fdb_export_image_metadata.php',
+	'EXPORTMETADATA_DIR' => $destDir,
+	'EXIFTOOL_PATH' => $exiftoolPath, 
+	'EXIV2_PATH' => $exiv2path,
+	'USE_EXIFTOOL' => $use_exiftool ? 'checked="checked"' : '',
+	'USE_EXIV2' => $use_exiv2 ? 'checked="checked"' : '',
+	'USE_UTF8' => $use_utf8 ? 'checked="checked"' : '',
+	'MULTI_LANG_DESC' => $use_whole_desc ? 'true' : 'false',
+	'NB_FILE_TO_TAG' => $nb_tags,
+	'TEST_MODE' => $test_mode ? 'checked="checked"' : '',
+	'TEST_IMG_ID' => $test_img_id
+));
+
+$template->assign_var_from_handle( 'ADMIN_CONTENT', 'db_export_image_metadata_content');
+
+?>
Index: /extensions/Tags2File/db_export_image_metadata.tpl
===================================================================
--- /extensions/Tags2File/db_export_image_metadata.tpl	(revision 4620)
+++ /extensions/Tags2File/db_export_image_metadata.tpl	(revision 4620)
@@ -0,0 +1,66 @@
+<div class="titrePage">
+  <h2>Tags2File: Export Image Metadata</h2>
+</div>
+
+<div class="doc">
+<p>{'plugin_doc'|@translate}<br/>{'plugin_doc2'|@translate}<br/>{'plugin_doc3'|@translate}</p>
+</div>
+
+<form method="post" action="{$F_ACTION}" class="properties">
+
+ <fieldset id="mainConf">
+  <ul>
+    <li>
+      <span class="property">
+        <label for="use_exiftool">{'use_exiftool'|@translate}</label>        
+      </span>
+      <input type="checkbox" name="use_exiftool" id="use_exiftool" {$USE_EXIFTOOL} />
+      <label>{'toolpath'|@translate}</label>
+      <input type="text" maxlength="255" size="50" name="exiftool_path" id="exiftool_path" value="{$EXIFTOOL_PATH}" />
+      <a href="http://www.sno.phy.queensu.ca/~phil/exiftool/">ExifTool by Phil Harvey</a>
+    </li>
+    <li>
+      <span class="property">
+        <label for="use_exiv2">{'use_exiv2'|@translate}</label>        
+      </span>
+      <input type="checkbox" name="use_exiv2" id="use_exiv2" {$USE_EXIV2} />
+      <label>{'toolpath'|@translate}</label>
+      <input type="text" maxlength="255" size="50" name="exiv2_path" id="exiv2_path" value="{$EXIV2_PATH}" />
+      <a href="http://www.exiv2.org/">Exiv2 home</a>
+    </li>
+    <li>
+      <span class="property">
+        <label for="exportmetadata_dir">{'exportmetadata_dir'|@translate}</label>
+      </span>
+      <input type="text" maxlength="255" size="77" name="exportmetadata_dir" id="exportmetadata_dir" value="{$EXPORTMETADATA_DIR}" />
+    </li>
+    <li>
+      <span class="property">
+        <label for="use_utf8">{'use_utf8'|@translate}</label>        
+      </span>
+      <input type="checkbox" name="use_utf8" id="use_utf8" {$USE_UTF8} />
+    </li>
+    <li>
+      <span class="property"> {'multi_lang_desc'|@translate}</span>
+	 {html_radios name='multi_lang_desc' values='true,false'|@explode output='whole,current'|@explode|translate selected=$MULTI_LANG_DESC}	
+    </li>
+    <li>
+      <span class="property">
+        <label for="nb_file_to_tag">{'nb_file_to_tag'|@translate}</label>        
+      </span>
+      <label>{$NB_FILE_TO_TAG}</label>
+    </li>
+    <li>
+      <span class="property">
+        <label for="test_mode">{'test_mode'|@translate}</label>
+      </span>
+      <input type="checkbox" name="test_mode" id="test_mode" {$TEST_MODE} />
+      <label>{'test_img_id_lbl'|@translate}</label>
+      <input type="text" maxlength="255" size="30" name="test_imgid" id="test_imgid" value="{$TEST_IMG_ID}" />
+    </li>
+  </ul>
+ </fieldset>
+
+ <input type="hidden" name="exportmetadata_post_form" id="exportmetadata_post_form" value="1" /> 
+ <p><input type="submit" value="{'Submit'|@translate}" /></p>
+</form>
Index: /extensions/Tags2File/db_export_image_metadata_class.php
===================================================================
--- /extensions/Tags2File/db_export_image_metadata_class.php	(revision 4620)
+++ /extensions/Tags2File/db_export_image_metadata_class.php	(revision 4620)
@@ -0,0 +1,326 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Plugin Name : Export Image metadata                                   |
+// | Plugin Version : 0.1                                                  |
+// | Plugin Author: Eric                                                   |
+// | Plugin Description :                                                  |
+// | Ce module est base sur le module existant pour le telechargement,     |
+// | cette version permet le telechargement sur plusieurs pages.           |
+// +-----------------------------------------------------------------------+
+// | 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.               '                                                  |
+// +-----------------------------------------------------------------------+
+
+class ExportImageMetadata
+{
+  private $use_exiftool, $use_exiv2, $use_whole_desc, $isMSWin, $useUTF8_txt, $useUTF8_cp, $eol;
+  private $exiftoolDefaultCmd, $exiv2DefaultCmd, $nbfiles;
+  private $isTest = false, $test_img_id; 
+
+  function ExportImageMetadata($use_exiftool_p, $use_exiv2_p, $use_whole_desc_p, $useUTF8_txt)
+  {
+	$this->use_exiftool = $use_exiftool_p;
+	$this->use_exiv2 = $use_exiv2_p;
+	$this->use_whole_desc = $use_whole_desc_p;
+	$this->isMSWin = stristr(php_uname(), 'windows');
+	$this->eol = $this->isMSWin ? "\r\n" : "\n";
+	$this->useUTF8_txt = $useUTF8_txt; // encoding of the batch file
+	$this->useUTF8_cp = false; // pb under windows xp for the author with this code page...
+  }
+
+  public function set_test_mode($test_mode, $test_img_id)
+  {
+	  $this->isTest = $test_mode;
+	  $this->test_img_id = $test_img_id;
+  }
+
+  public function set_tool_pathes($exiftoolPath, $exiv2path)
+  {
+	if ($this->use_exiftool)
+	{
+		$this->exiftoolDefaultCmd = $this->init_exif_tool_cmd_name($exiftoolPath, "exiftool");
+		if ($this->useUTF8_txt) {
+			$this->exiftoolDefaultCmd .= " -IPTC:CodedCharacterSet=UTF8";
+		}
+		else {
+			$this->exiftoolDefaultCmd .= " -L"; // convert to Latin1 internaly, see FAQ #10 at http://www.sno.phy.queensu.ca/~phil/exiftool/faq.html
+		}
+		$this->exiftoolDefaultCmd .= " -overwrite_original"; // no backup!
+	}
+	if ($this->use_exiv2)
+	{
+		$this->exiv2DefaultCmd = $this->init_exif_tool_cmd_name($exiv2path, "exiv2");
+	       	$this->exiv2DefaultCmd .= " -k"; // conserve original date
+	}
+  }
+
+  private function init_exif_tool_cmd_name($toolPath, $toolName)
+  {
+	return (file_exists($toolPath) && strpos(strtolower($toolPath), strtolower($toolName)) !== false) ? "\"".realpath($toolPath)."\"" : $toolName;
+  }
+
+  public function image_properties_to_file($destPath)
+  { 		
+	$exiftoolScript = ""; $exiv2Script = "";
+	if ($this->use_exiftool)
+	{
+		$exiftoolScript = $destPath ."/writeTagsToIptcWithExifTool.cmd";
+		$fp_exiftool = $this->open_create_file($exiftoolScript);
+	}
+	if ($this->use_exiv2)
+	{
+		$exiv2Script = $destPath ."/writeTagsToIptcWithExiv2.cmd";
+		$fp_exiv2 = $this->open_create_file($exiv2Script);
+	}
+
+	$datas = $this->get_image_properties();
+	$this->nbfiles = 0;
+
+	while ($row = mysql_fetch_row($datas)) // row to avoid conflict with name
+	{		
+		$image_path = $row[5];
+		$has_high = $row[6] === 'true';
+		
+		if ($this->isTest || file_exists($image_path))
+		{
+			if ($this->use_exiftool)
+			{
+				$cmd = $this->convert_row_to_file_exiftool($row);
+				$this->write_exifCmd($cmd, $image_path, $has_high, $fp_exiftool);
+			}
+			if ($this->use_exiv2)
+			{
+				$cmd = $this->convert_row_to_file_exiv2($row);
+				$this->write_exifCmd($cmd, $image_path, $has_high, $fp_exiv2);
+			}
+		}
+	}
+
+	if ($this->use_exiftool && isset($fp_exiftool))
+	{
+		$this->close_file($fp_exiftool);
+	}
+	if ($this->use_exiv2 && isset($fp_exiv2))
+	{
+		$this->close_file($fp_exiv2);
+	}
+	if ($this->use_exiftool && $this->use_exiv2)
+	{
+		$this->nbfiles = $this->nbfiles / 2; // each picture counted twice
+	}
+
+	return $this->nbfiles; // incremented by write_exifCmd
+  }
+
+  // IO function
+  private function open_create_file($destPath)
+  {
+	// prepare output file
+	if(file_exists($destPath))
+	{
+		if (!$this->isMSWin) chmod($destPath, 0777);
+		unlink($destPath);
+	}
+	touch($destPath);
+	$fp = fopen($destPath,"w"); 
+	if ($this->isMSWin && isset($fp) )
+	{
+		// the default command prompt is stupid and won't display the correct character set, so we need to change the code page
+		if ($this->useUTF8_cp)
+		{ fwrite($fp, "chcp 65001".$this->eol); } // UTF-8, prevent cmd to work, see perhaps http://blogs.msdn.com/michkap/archive/2006/03/06/544251.aspx
+		else
+		{ fwrite($fp, "chcp 1252".$this->eol); }  // default Windows Latin1		
+	}
+	return $fp;
+  }
+
+  private function close_file($fp)
+  {
+	if (isset($fp))
+	{
+		if ($this->nbfiles > 0)
+		{
+			fwrite($fp, $this->eol);
+		}
+		fclose($fp);
+	}
+  }
+
+  // prepare data for script
+  private function convert_row_to_file_exiv2($row)
+  {
+	if (!$this->use_exiv2)
+		return "exiv2 shall not be used";
+	$name =  $this->cutString($this->explode_description($this->decode_html_string_to_unicode($row[0], true)), 256);
+	$description = $this->cutString($this->explode_description($this->decode_html_string_to_unicode($row[1], true)), 2000);
+	$author = $this->cutString($this->decode_html_string_to_unicode($row[2], true), 32);
+	//$date_creation = $this->decode_html_string_to_unicode($row[3], true);
+	$tags = $this->cutString($this->decode_html_string_to_unicode($row[4], true), 64);
+	$image_path = $row[5];
+	$has_high = $row[6] === 'true';
+	
+	$exiv2Cmd = $this->exiv2DefaultCmd;
+
+	if (strlen($name) > 0)
+	{
+		$exiv2Cmd .= " -M\"set Iptc.Application2.Headline ".$name."\"";
+		$exiv2Cmd .= " -M\"set Iptc.Application2.ObjectName ". $this->cutString($name, 64)."\"";
+	}
+	if (strlen($description) > 0)
+	{							
+		$exiv2Cmd .= " -M\"set Iptc.Application2.Caption ".$description."\"";
+	}
+	if (strlen($author) > 0)
+	{
+		$exiv2Cmd .= " -M\"set Iptc.Application2.Writer ".$author."\"";
+	}	
+	if (strlen($tags) > 0)			
+	{
+		$exiv2Cmd .= " -M\"add Iptc.Application2.Keywords ".$tags."\"";
+	}
+	return $exiv2Cmd;
+  }
+
+  private function convert_row_to_file_exiftool($row)
+  {
+	if (!$this->use_exiftool)
+		return "exiftool shall not be used";
+	$name = $this->cutString($this->explode_description($this->decode_html_string_to_unicode($row[0], false)), 256);
+	$description = $this->cutString($this->explode_description($this->decode_html_string_to_unicode($row[1], false)), 2000);
+	$author = $this->cutString($this->decode_html_string_to_unicode($row[2], false), 32);
+	//$date_creation = $this->decode_html_string_to_unicode($row[3], false);
+	$tags = $this->cutString($this->decode_html_string_to_unicode($row[4], false), 64);
+
+	$exiftoolCmd = $this->exiftoolDefaultCmd;	
+
+	// exiftool allow to set a field only if the field in the original file is empty 
+	// as explained here: http://www.cpanforum.com/posts/10765
+
+	if (strlen($name) > 0)
+	{
+		$exiftoolCmd .= " -IPTC:Headline-= -IPTC:Headline=\"".$name."\"";
+		$exiftoolCmd .= " -IPTC:ObjectName-= -IPTC:ObjectName=\"".$this->cutString($name, 64)."\"";
+	}
+	if (strlen($description) > 0)
+	{							
+		$exiftoolCmd .= " -IPTC:Caption-Abstract-= -IPTC:Caption-Abstract=\"".$description."\"";
+	}
+	if (strlen($author) > 0)
+	{
+		$exiftoolCmd .= " -IPTC:Writer-Editor-= -IPTC:Writer-Editor=\"".$author."\"";
+	}	
+	if (strlen($tags) > 0)			
+	{ // Keywords are overwritten, since they allow multiple entries, with "-=", given keywords will be added to the existing 
+		$exiftoolCmd .= " -IPTC:Keywords=\"".$tags."\"";
+	}
+	return $exiftoolCmd;	
+  }
+
+  private function write_exifCmd($exifCmd, $image_path, $has_high, $fp)
+  {
+	$exifCmdN = $exifCmd ." ";
+	$exifCmdN .= $this->isTest ? $image_path : realpath(PHPWG_ROOT_PATH.$image_path);
+	$writeOK = fwrite($fp, $exifCmdN.$this->eol) !== FALSE;
+	if ($writeOK)  $this->nbfiles++;
+
+	if ($has_high)
+	{
+		$imageHigh = dirname($image_path) . "/pwg_high/" . basename($image_path);
+		if (file_exists($imageHigh)) 
+		{ 	$this->write_exifCmd($exifCmd, $imageHigh, false, $fp);  }
+	}
+  }
+
+  // html function
+  private function decode_html_string_to_unicode($string, $forceANSI) 
+  {
+	if (isset($string) && strlen($string) > 0)
+	{
+		$txt_encoding = ($this->useUTF8_txt && !$forceANSI) ? 'UTF-8' : 'ISO-8859-15';
+		$string = html_entity_decode(trim($string), ENT_QUOTES, $txt_encoding);
+		$string = stripslashes($string);
+	}
+	else $string = "";
+	return($string);
+  } 
+
+    // remove end of line char from desc and keep if required only the current language
+  private function explode_description($description)
+  {
+	if (!$this->use_whole_desc)
+	{
+		$description = $this->get_user_language_desc($description);	
+	}
+	return str_replace( array( '<br>', '<br />', "\n", "\r" ), array('', '', '', ''), $description );
+  }
+
+  private function cutString($description, $maxLen)
+  {
+	if (strlen($description) > $maxLen)
+	{
+		$description = substr($description, 0, $maxLen);
+	}
+	return $description;
+  }
+  
+  // Traite les balises [lang=xx], copy&paste from ExtendedDescription plugin, main.inc.php
+  private function get_user_language_desc($desc)
+  {
+	global $user;
+  
+	$user_lang = substr($user['language'], 0, 2);
+
+	if (!substr_count(strtolower($desc), '[lang=' . $user_lang . ']'))
+	{
+		$user_lang = 'default';
+  	}
+  
+	if (substr_count(strtolower($desc), '[lang=' . $user_lang . ']'))
+	{
+		// la balise avec la langue de l'utilisateur a été trouvée
+		$patterns[] = '#(^|\[/lang\])(.*?)(\[lang=(' . $user_lang . '|all)\]|$)#is';
+		$replacements[] = '';
+		$patterns[] = '#\[lang=(' . $user_lang . '|all)\](.*?)\[/lang\]#is';
+		$replacements[] = '\\1';
+	}
+	else
+	{
+		// la balise avec la langue de l'utilisateur n'a pas été trouvée
+		// On prend tout ce qui est hors balise
+		$patterns[] = '#\[lang=all\](.*?)\[/lang\]#is';
+		$replacements[] = '\\1';
+		$patterns[] = '#\[lang=.*\].*\[/lang\]#is';
+		$replacements[] = '';
+	}
+	return preg_replace($patterns, $replacements, $desc);
+  }
+
+  // data access
+  private function get_image_properties() 
+  {
+	$query_path = $this->isTest ? 'img.file' : 'img.path';
+	$query_restriction = $this->isTest ? 'AND (img.id = '.$this->test_img_id.'))' : ')';
+	// get direct properties and tags, even if no tags, with either name, comment or tags not null
+	// restritive query with image.ID for tests with copied images with file instead of path
+	$img_query = 'SELECT img.name, img.comment, img.author, img.date_creation, GROUP_CONCAT(tags.name), '.$query_path.', has_high
+		FROM '.IMAGES_TABLE.' AS img
+		LEFT OUTER JOIN '.IMAGE_TAG_TABLE.' AS img_tag ON img_tag.image_id = img.id
+		LEFT OUTER JOIN '.TAGS_TABLE.' AS tags ON tags.id = img_tag.tag_id
+		WHERE ( ( LENGTH(img.name) > 0 OR LENGTH(img.comment) > 0 OR LENGTH(img.author) > 0 OR LENGTH(tags.name) > 0 ) '.$query_restriction.'
+		GROUP BY img.id, img.name, img.comment, img.author, '.$query_path.', has_high
+		ORDER BY img.id ASC; ';
+	
+	return pwg_query($img_query);
+  }
+}
Index: /extensions/Tags2File/index.php
===================================================================
--- /extensions/Tags2File/index.php	(revision 4620)
+++ /extensions/Tags2File/index.php	(revision 4620)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008      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/Tags2File/language/de_DE/index.php
===================================================================
--- /extensions/Tags2File/language/de_DE/index.php	(revision 4620)
+++ /extensions/Tags2File/language/de_DE/index.php	(revision 4620)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008      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/Tags2File/language/de_DE/plugin.lang.php
===================================================================
--- /extensions/Tags2File/language/de_DE/plugin.lang.php	(revision 4620)
+++ /extensions/Tags2File/language/de_DE/plugin.lang.php	(revision 4620)
@@ -0,0 +1,40 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008      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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+
+$lang['plugin_doc'] 		= 'Exportiert die Eigenschaften und Tags der Bilder aus der Datenbank nach einer batsch script Datei. Dieses Script wird die Daten in IPTC Felder der Bilddateien setzten.';
+$lang['plugin_doc2']		= 'Zwei Werkzeuge können für den Tagging benutzen werden, entweder exiftool, oder exiv2. Das erste ist besser getestet und besser für UTF-8, während das zweite schneller ist. Ein Script wird pro Tool erzeugt. Die Programmpfade sind optional, vor allem relevant, wenn es nicht zu PATH variable gehört';
+$lang['plugin_doc3']		= 'Der Zielordner muss aber gültig sein, um die Scripte zu erzeugen. Es ist empfohlen, mit dem Test-Modus anzufangen, mit einer Bilddatei in den Zielordner kopiert, für die das img_ID aus der DB bekannt ist (z.B. kann die Image Tabelle mit phpmyadmin gesehen werden)';
+$lang['use_exiftool'] 		= 'exiftool benutzen?';
+$lang['use_exiv2'] 		= 'exiv2 benutzen?';
+$lang['toolpath']		= 'Programmpfad: ';
+$lang['exportmetadata_dir'] 	= 'Ordner für die Zieldatei';
+$lang['use_utf8'] 		= 'UTF-8 (nur exiftool)? Nein=ANSI/Latin-1';
+$lang['multi_lang_desc'] 	= 'Wie soll die Beschreibung betrachten werden?';
+$lang['whole']			= 'Die komplete Beschreibung lesen';
+$lang['current']		= 'nur für die aktuelle Sprache (lang tag)';
+$lang['nb_file_to_tag']		= 'Nummer von Bilder die aktualisiert werden können';
+$lang['test_mode']		= 'Test-Modus';
+$lang['test_img_id_lbl']	= 'Nur die folgende img_id betrachten';
+?>
+
Index: /extensions/Tags2File/language/en_UK/index.php
===================================================================
--- /extensions/Tags2File/language/en_UK/index.php	(revision 4620)
+++ /extensions/Tags2File/language/en_UK/index.php	(revision 4620)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008      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/Tags2File/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/Tags2File/language/en_UK/plugin.lang.php	(revision 4620)
+++ /extensions/Tags2File/language/en_UK/plugin.lang.php	(revision 4620)
@@ -0,0 +1,38 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008      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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+$lang['plugin_doc'] 		= 'Export the image properties and tags from the database to a batch script. This script will tag the files and set the data in IPTC fields.';
+$lang['plugin_doc2']		= 'Two tools can be used for the tag, either exiftool, or exiv2. The first one is better tested and better support UTF-8, while the second one is faster. One script will be generated by enabled tool. The tool paths are optional and relevant if not already set in the PATH variable';
+$lang['plugin_doc3']		= 'A valid destination directory is required for the algorithm to run. It is recommanded to start with the test mode, and a image file copied into the destination directory for which you know the id in the DB (e.g. look at image table with phpmyadmin)';
+$lang['use_exiftool'] 		= 'Use exiftool?';
+$lang['use_exiv2'] 		= 'Use exiv2?';
+$lang['toolpath']		= 'Full path executable: ';
+$lang['exportmetadata_dir'] 	= 'Destination directory for the generated script';
+$lang['use_utf8'] 		= 'UTF-8 encoding (exiftool only)? No=ANSI/Latin-1';
+$lang['multi_lang_desc'] 	= 'How to deal with the description field?';
+$lang['whole']			= 'whole description field';
+$lang['current']		= 'only for the current language (lang tag)';
+$lang['nb_file_to_tag']		= 'Number of image files which can be tagged';
+$lang['test_mode']		= 'Test mode';
+$lang['test_img_id_lbl']	= 'Consider only the following img_id';
+?>
Index: /extensions/Tags2File/language/fr_FR/index.php
===================================================================
--- /extensions/Tags2File/language/fr_FR/index.php	(revision 4620)
+++ /extensions/Tags2File/language/fr_FR/index.php	(revision 4620)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008      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/Tags2File/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/Tags2File/language/fr_FR/plugin.lang.php	(revision 4620)
+++ /extensions/Tags2File/language/fr_FR/plugin.lang.php	(revision 4620)
@@ -0,0 +1,39 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008      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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+$lang['plugin_doc'] 		= 'Exporte les propriétés et les tags des images de la base vers un fichier batch. Ce fichier va tagger les images en utilisant les champs IPTC.';
+$lang['plugin_doc2']		= 'Deux outils peuvent être utilisés pour le tagging, soit exiftool, soit exiv2, le 1er est mieux testé et supporte mieux l\'UTF-8, tandis que le 2nd est plus rapide. Un fichier batch par outil activé sera généré. Le chemin de l\'outil est optionnel et pertinent si pas ds la variable PATH';
+$lang['plugin_doc3']		= 'Le répertoire de destination doit être valide pour la génération des scripts. Il est recommandé de commencer par le mode test, avec un fichier image copié dans le répertoire de destination, et pour lequel l\'img_ID de la BD est connu (on pourra par ex. regarder la table image avec phpmyadmin)';
+$lang['use_exiftool'] 		= 'Utilisation d\'exiftool?';
+$lang['use_exiv2'] 		= 'Utilisation d\'exiv2?';
+$lang['toolpath']		= 'Chemin de l\'exécutable :';
+$lang['exportmetadata_dir'] 	= 'Répertoire destination pour le script';
+$lang['use_utf8'] 		= 'Codage UTF-8 (exiftool seulement)? Non=ANSI/Latin-1';
+$lang['multi_lang_desc'] 	= 'Comment considérer le champ description?';
+$lang['multi_lang_desc_all']	= 'Le champ complet est considéré';
+$lang['whole']			= 'Le champ complet';
+$lang['current']		= 'la partie entre balises lang pour le langage courant';
+$lang['nb_file_to_tag']		= 'Nombre de fichier images qui peuvent être taggées';
+$lang['test_mode']		= 'Mode test';
+$lang['test_img_id_lbl']	= 'Considérer seulement l\'img_id suivant';
+?>
Index: /extensions/Tags2File/language/index.php
===================================================================
--- /extensions/Tags2File/language/index.php	(revision 4620)
+++ /extensions/Tags2File/language/index.php	(revision 4620)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008      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/Tags2File/main.inc.php
===================================================================
--- /extensions/Tags2File/main.inc.php	(revision 4620)
+++ /extensions/Tags2File/main.inc.php	(revision 4620)
@@ -0,0 +1,34 @@
+<?php
+/*
+Plugin Name: Tags2File
+Description: Export the image properties and tags from the database to a batch script. This script will tag the files and set the data in IPTC fields
+Author: Eric B, inspired from Tags2File MOD from Nicco
+Plugin URI: http://piwigo.org/ext/extension_view.php?eid=292
+Version: 0.4
+*/
+
+/*
+Changelog :
+
+v0.1, 2009-05-18: first beta, major pb with character encoding
+v0.2, 2009-05-19: fix GUI, german translation, extended description (multi lingual), batch for both exiftool & exiv2. Character encoding pb solved under Windows: exiv2 requires ANSI file, whereas exiftool can also use UTF-8. Characters displayed in Ansi/latin-1 in command line (cp1252)
+v0.3, 2009-05-2x: set not only ObjectName but also Headline with the image name. Consider also the image in pwg_high subfolders. With exiftool, set the IPTC fields only if they are empty (do not overwrite existing data)
+v0.4, 2009-06-15: use -IPTC:CodedCharacterSet=UTF8 with exiftool when utf8 is required. Add documentation in the GUI. Add test modus.
+v1.0 : release
+
+*/
+
+add_event_handler('get_admin_plugin_menu_links', 'db_export_image_metadata' );
+
+function db_export_image_metadata($menu)
+{
+	array_push($menu,
+		array(
+			'NAME' => 'Tags2File',
+			'URL' => get_admin_plugin_menu_link(dirname(__FILE__).'/db_export_image_metadata.php')
+		)
+	);
+	return $menu;
+}
+
+?>
