diff -u -r /ImageManager_20062020/assets/editorFrame.js ./assets/editorFrame.js
--- /ImageManager_20062020/assets/editorFrame.js	2006-06-20 22:17:36.000000000 +0200
+++ ./assets/editorFrame.js	2006-12-17 13:36:35.000000000 +0100
@@ -1,8 +1,8 @@
 /**
  * Javascript used by the editorFrame.php, it basically initializes the frame.
- * @author $Author: Wei Zhuo $
- * @author $Author: Paul Moers <mail@saulmade.nl> $ - watermarking and replace code + several small enhancements <http://www.saulmade.nl/FCKeditor/FCKPlugins.php>
- * @version $Id: editorFrame.js 26 2004-03-31 02:35:21Z Wei Zhuo $
+ * @author $Author: thierrybo $
+ * @author $Author: thierrybo $ - watermarking and replace code + several small enhancements <http://www.saulmade.nl/FCKeditor/FCKPlugins.php>
+ * @version $Id: editorFrame.js,v 1.1 2006/12/17 12:19:58 thierrybo Exp $
  * @package ImageManager
  */
 
diff -u -r /ImageManager_20062020/Classes/api.watermark.php ./Classes/api.watermark.php
--- /ImageManager_20062020/Classes/api.watermark.php	2006-06-20 22:17:34.000000000 +0200
+++ ./Classes/api.watermark.php	2006-12-16 22:38:13.000000000 +0100
@@ -1,8 +1,9 @@
-<?
+<?php
 /**
  * Watermarking API
- * @author $Author: Brian Vaughn $ http://boynamedbri.com/  -  http://portfolio.boynamedbri.com/ -  @ devshed http://www.devshed.com/c/a/PHP/Dynamic-Watermarking-with-PHP/
- * @author $Author: Paul Moers <mail@saulmade.nl> $ - small changes to place the watermark on a given coordinate and to only handle watermark area
+ * @author Brian Vaughn http://boynamedbri.com/  -  http://portfolio.boynamedbri.com/ -  @ devshed http://www.devshed.com/c/a/PHP/Dynamic-Watermarking-with-PHP/
+ * @author Paul Moers <mail@saulmade.nl> - small changes to place the watermark on a given coordinate and to only handle watermark area
+ * @version $Id: api.watermark.php,v 1.2 2006/12/16 21:38:13 thierrybo Exp $
  * @package ImageManager
  */
 
@@ -100,4 +101,4 @@
 	} # EBD _get_image_color()
 
 } # END watermark API
-?>
\ Pas de fin de ligne à la fin du fichier.
+?>

diff -u -r /ImageManager_20062020/Classes/Files.php ./Classes/Files.php
--- /ImageManager_20062020/Classes/Files.php	2006-06-20 22:17:34.000000000 +0200
+++ ./Classes/Files.php	2006-12-16 22:38:13.000000000 +0100
@@ -1,215 +1,215 @@
-<?
+<?php
 /**
  * File Utilities.
- * @author $Author: Wei Zhuo $
- * @version $Id: Files.php 26 2004-03-31 02:35:21Z Wei Zhuo $
+ * @author Wei Zhuo
+ * @version $Id: Files.php,v 1.2 2006/12/16 21:38:13 thierrybo Exp $
  * @package ImageManager
  */
 
-define('FILE_ERROR_NO_SOURCE', 100);
-define('FILE_ERROR_COPY_FAILED', 101);
-define('FILE_ERROR_DST_DIR_FAILED', 102);
-define('FILE_COPY_OK', 103);
+define('FILE_ERROR_NO_SOURCE', 100);
+define('FILE_ERROR_COPY_FAILED', 101);
+define('FILE_ERROR_DST_DIR_FAILED', 102);
+define('FILE_COPY_OK', 103);
 
 /**
  * File Utilities
- * @author $Author: Wei Zhuo $
- * @version $Id: Files.php 26 2004-03-31 02:35:21Z Wei Zhuo $
+ * @author Wei Zhuo
+ * @version $Id: Files.php,v 1.2 2006/12/16 21:38:13 thierrybo Exp $
  * @package ImageManager
  * @subpackage files
  */
-class Files 
-{
-	
-	/**
-	 * Copy a file from source to destination. If unique == true, then if
-	 * the destination exists, it will be renamed by appending an increamenting 
-	 * counting number.
-	 * @param string $source where the file is from, full path to the files required
-	 * @param string $destination_file name of the new file, just the filename
-	 * @param string $destination_dir where the files, just the destination dir,
-	 * e.g., /www/html/gallery/
-	 * @param boolean $unique create unique destination file if true.
-	 * @return string the new copied filename, else error if anything goes bad.
-	 */
-	function copyFile($source, $destination_dir, $destination_file, $unique=true) 
-	{
-		if(!(file_exists($source) && is_file($source))) 
-			return FILE_ERROR_NO_SOURCE;
-
-		$destination_dir = Files::fixPath($destination_dir);
-
-		if(!is_dir($destination_dir)) 
-			Return FILE_ERROR_DST_DIR_FAILED;
-
-		$filename = Files::escape($destination_file);
-
-		if($unique) 
-		{
-			$dotIndex = strrpos($destination_file, '.');
-			$ext = '';
-			if(is_int($dotIndex)) 
-			{
-				$ext = substr($destination_file, $dotIndex);
-				$base = substr($destination_file, 0, $dotIndex);
-			}
-			$counter = 0;
-			while(is_file($destination_dir.$filename)) 
-			{
-				$counter++;
-				$filename = $base.'_'.$counter.$ext;
-			}
-		}
-
-		if (!copy($source, $destination_dir.$filename))
-			return FILE_ERROR_COPY_FAILED;
-		
-		//verify that it copied, new file must exists
-		if (is_file($destination_dir.$filename))
-			Return $filename;
-		else
-			return FILE_ERROR_COPY_FAILED;
-	}
-
-	/**
-	 * Create a new folder.
-	 * @param string $newFolder specifiy the full path of the new folder.
-	 * @return boolean true if the new folder is created, false otherwise.
-	 */
-	function createFolder($newFolder) 
-	{
-		mkdir ($newFolder, 0777);
-		return chmod($newFolder, 0777);
-	}
-
-
-	/**
-	 * Escape the filenames, any non-word characters will be
-	 * replaced by an underscore.
-	 * @param string $filename the orginal filename
-	 * @return string the escaped safe filename
-	 */
-	function escape($filename) 
-	{
-		Return preg_replace('/[^\w\._]/', '_', $filename);
-	}
-
-	/**
-	 * Delete a file.
-	 * @param string $file file to be deleted
-	 * @return boolean true if deleted, false otherwise.
-	 */
-	function delFile($file) 
-	{
-		if(is_file($file)) 
-			Return unlink($file);
-		else
-			Return false;
-	}
-
-	/**
-	 * Delete folder(s), can delete recursively.
-	 * @param string $folder the folder to be deleted.
-	 * @param boolean $recursive if true, all files and sub-directories
-	 * are delete. If false, tries to delete the folder, can throw
-	 * error if the directory is not empty.
-	 * @return boolean true if deleted.
-	 */
-	function delFolder($folder, $recursive=false) 
-	{
-		$deleted = true;
-		if($recursive) 
-		{
-			$d = dir($folder);
-			while (false !== ($entry = $d->read())) 
-			{
-				if ($entry != '.' && $entry != '..')
-				{
-					$obj = Files::fixPath($folder).$entry;
-					//var_dump($obj);
-					if (is_file($obj))
-					{
-						$deleted &= Files::delFile($obj);					
-					}
-					else if(is_dir($obj))
-					{
-						$deleted &= Files::delFolder($obj, $recursive);
-					}
-					
-				}
-			}
-			$d->close();
-
-		}
-
-		//$folder= $folder.'/thumbs';
-		//var_dump($folder);
-		if(is_dir($folder)) 
-			$deleted &= rmdir($folder);
-		else
-			$deleted &= false;
-
-		Return $deleted;
-	}
-
-	/**
-	 * Append a / to the path if required.
-	 * @param string $path the path
-	 * @return string path with trailing /
-	 */
-	function fixPath($path) 
-	{
-		//append a slash to the path if it doesn't exists.
-		if(!(substr($path,-1) == '/'))
-			$path .= '/';
-		Return $path;
-	}
-
-	/**
-	 * Concat two paths together. Basically $pathA+$pathB
-	 * @param string $pathA path one
-	 * @param string $pathB path two
-	 * @return string a trailing slash combinded path.
-	 */
-	function makePath($pathA, $pathB) 
-	{
-		$pathA = Files::fixPath($pathA);
-		if(substr($pathB,0,1)=='/')
-			$pathB = substr($pathB,1);
-		Return Files::fixPath($pathA.$pathB);
-	}
-
-	/**
-	 * Similar to makePath, but the second parameter
-	 * is not only a path, it may contain say a file ending.
-	 * @param string $pathA the leading path
-	 * @param string $pathB the ending path with file
-	 * @return string combined file path.
-	 */
-	function makeFile($pathA, $pathB) 
-	{		
-		$pathA = Files::fixPath($pathA);
-		if(substr($pathB,0,1)=='/')
-			$pathB = substr($pathB,1);
-		
-		Return $pathA.$pathB;
-	}
-
-	
-	/**
-	 * Format the file size, limits to Mb.
-	 * @param int $size the raw filesize
-	 * @return string formated file size.
-	 */
-	function formatSize($size) 
-	{
-		if($size < 1024) 
-			return $size.' bytes';	
-		else if($size >= 1024 && $size < 1024*1024) 
-			return sprintf('%01.2f',$size/1024.0).' Kb';	
-		else
-			return sprintf('%01.2f',$size/(1024.0*1024)).' Mb';	
+class Files 
+{
+	
+	/**
+	 * Copy a file from source to destination. If unique == true, then if
+	 * the destination exists, it will be renamed by appending an increamenting 
+	 * counting number.
+	 * @param string $source where the file is from, full path to the files required
+	 * @param string $destination_file name of the new file, just the filename
+	 * @param string $destination_dir where the files, just the destination dir,
+	 * e.g., /www/html/gallery/
+	 * @param boolean $unique create unique destination file if true.
+	 * @return string the new copied filename, else error if anything goes bad.
+	 */
+	function copyFile($source, $destination_dir, $destination_file, $unique=true) 
+	{
+		if(!(file_exists($source) && is_file($source))) 
+			return FILE_ERROR_NO_SOURCE;
+
+		$destination_dir = Files::fixPath($destination_dir);
+
+		if(!is_dir($destination_dir)) 
+			Return FILE_ERROR_DST_DIR_FAILED;
+
+		$filename = Files::escape($destination_file);
+
+		if($unique) 
+		{
+			$dotIndex = strrpos($destination_file, '.');
+			$ext = '';
+			if(is_int($dotIndex)) 
+			{
+				$ext = substr($destination_file, $dotIndex);
+				$base = substr($destination_file, 0, $dotIndex);
+			}
+			$counter = 0;
+			while(is_file($destination_dir.$filename)) 
+			{
+				$counter++;
+				$filename = $base.'_'.$counter.$ext;
+			}
+		}
+
+		if (!copy($source, $destination_dir.$filename))
+			return FILE_ERROR_COPY_FAILED;
+		
+		//verify that it copied, new file must exists
+		if (is_file($destination_dir.$filename))
+			Return $filename;
+		else
+			return FILE_ERROR_COPY_FAILED;
+	}
+
+	/**
+	 * Create a new folder.
+	 * @param string $newFolder specifiy the full path of the new folder.
+	 * @return boolean true if the new folder is created, false otherwise.
+	 */
+	function createFolder($newFolder) 
+	{
+		mkdir ($newFolder, 0777);
+		return chmod($newFolder, 0777);
+	}
+
+
+	/**
+	 * Escape the filenames, any non-word characters will be
+	 * replaced by an underscore.
+	 * @param string $filename the orginal filename
+	 * @return string the escaped safe filename
+	 */
+	function escape($filename) 
+	{
+		Return preg_replace('/[^\w\._]/', '_', $filename);
+	}
+
+	/**
+	 * Delete a file.
+	 * @param string $file file to be deleted
+	 * @return boolean true if deleted, false otherwise.
+	 */
+	function delFile($file) 
+	{
+		if(is_file($file)) 
+			Return unlink($file);
+		else
+			Return false;
+	}
+
+	/**
+	 * Delete folder(s), can delete recursively.
+	 * @param string $folder the folder to be deleted.
+	 * @param boolean $recursive if true, all files and sub-directories
+	 * are delete. If false, tries to delete the folder, can throw
+	 * error if the directory is not empty.
+	 * @return boolean true if deleted.
+	 */
+	function delFolder($folder, $recursive=false) 
+	{
+		$deleted = true;
+		if($recursive) 
+		{
+			$d = dir($folder);
+			while (false !== ($entry = $d->read())) 
+			{
+				if ($entry != '.' && $entry != '..')
+				{
+					$obj = Files::fixPath($folder).$entry;
+					//var_dump($obj);
+					if (is_file($obj))
+					{
+						$deleted &= Files::delFile($obj);					
+					}
+					else if(is_dir($obj))
+					{
+						$deleted &= Files::delFolder($obj, $recursive);
+					}
+					
+				}
+			}
+			$d->close();
+
+		}
+
+		//$folder= $folder.'/thumbs';
+		//var_dump($folder);
+		if(is_dir($folder)) 
+			$deleted &= rmdir($folder);
+		else
+			$deleted &= false;
+
+		Return $deleted;
+	}
+
+	/**
+	 * Append a / to the path if required.
+	 * @param string $path the path
+	 * @return string path with trailing /
+	 */
+	function fixPath($path) 
+	{
+		//append a slash to the path if it doesn't exists.
+		if(!(substr($path,-1) == '/'))
+			$path .= '/';
+		Return $path;
+	}
+
+	/**
+	 * Concat two paths together. Basically $pathA+$pathB
+	 * @param string $pathA path one
+	 * @param string $pathB path two
+	 * @return string a trailing slash combinded path.
+	 */
+	function makePath($pathA, $pathB) 
+	{
+		$pathA = Files::fixPath($pathA);
+		if(substr($pathB,0,1)=='/')
+			$pathB = substr($pathB,1);
+		Return Files::fixPath($pathA.$pathB);
+	}
+
+	/**
+	 * Similar to makePath, but the second parameter
+	 * is not only a path, it may contain say a file ending.
+	 * @param string $pathA the leading path
+	 * @param string $pathB the ending path with file
+	 * @return string combined file path.
+	 */
+	function makeFile($pathA, $pathB) 
+	{		
+		$pathA = Files::fixPath($pathA);
+		if(substr($pathB,0,1)=='/')
+			$pathB = substr($pathB,1);
+		
+		Return $pathA.$pathB;
+	}
+
+	
+	/**
+	 * Format the file size, limits to Mb.
+	 * @param int $size the raw filesize
+	 * @return string formated file size.
+	 */
+	function formatSize($size) 
+	{
+		if($size < 1024) 
+			return $size.' bytes';	
+		else if($size >= 1024 && $size < 1024*1024) 
+			return sprintf('%01.2f',$size/1024.0).' Kb';	
+		else
+			return sprintf('%01.2f',$size/(1024.0*1024)).' Mb';	
 	}
 }
 
-?>
\ Pas de fin de ligne à la fin du fichier.
+?>
diff -u -r /ImageManager_20062020/Classes/ImageEditor.php ./Classes/ImageEditor.php
--- /ImageManager_20062020/Classes/ImageEditor.php	2006-06-20 22:17:34.000000000 +0200
+++ ./Classes/ImageEditor.php	2006-12-20 19:34:11.000000000 +0100
@@ -1,9 +1,9 @@
-<?
+<?php
 /**
  * Image Editor. Editing tools, crop, rotate, scale and save.
- * @author $Author: Wei Zhuo $
- * @author $Author: Paul Moers <mail@saulmade.nl> $ - watermarking and replace code + several small enhancements <http://www.saulmade.nl/FCKeditor/FCKPlugins.php>
- * @version $Id: ImageEditor.php 27 2004-04-01 08:31:57Z Wei Zhuo $
+ * @author Wei Zhuo
+ * @author Paul Moers <mail@saulmade.nl> - watermarking and replace code + several small enhancements <http://www.saulmade.nl/FCKeditor/FCKPlugins.php>
+ * @version $Id: ImageEditor.php,v 1.3 2006/12/20 18:34:11 thierrybo Exp $
  * @package ImageManager
  */
 
@@ -11,8 +11,8 @@
 
 /**
  * Handles the basic image editing capbabilities.
- * @author $Author: Wei Zhuo $
- * @version $Id: ImageEditor.php 27 2004-04-01 08:31:57Z Wei Zhuo $
+ * @author Wei Zhuo
+ * @version $Id: ImageEditor.php,v 1.3 2006/12/20 18:34:11 thierrybo Exp $
  * @package ImageManager
  * @subpackage Editor
  */
@@ -243,18 +243,18 @@
 						//get unique filename just returns the filename, so
 						//we need to make the relative path again.
 						$newSaveFile = $this->makeRelative($relative, $newName);
-
-						// forced new name?
-						if ($oldSaveFile != $newSaveFile)
-						{
-							$this->forcedNewName = $newName;
-						}
-						else
-						{
-							$this->forcedNewName = false;
-						}
 					}
 
+					// forced new name?
+					if ($oldSaveFile != $newSaveFile)
+					{
+						$this->forcedNewName = $newName;
+					}
+					else
+					{
+						$this->forcedNewName = false;
+					}
+						
 					$newSaveFullpath = $this->manager->getFullPath($newSaveFile);
 					$img->save($newSaveFullpath, $values[0], $quality);
 					if(is_file($newSaveFullpath))
@@ -582,4 +582,4 @@
 	}
 }
 
-?>
\ Pas de fin de ligne à la fin du fichier.
+?>
diff -u -r /ImageManager_20062020/Classes/ImageManager.php ./Classes/ImageManager.php
--- /ImageManager_20062020/Classes/ImageManager.php	2006-06-20 22:17:34.000000000 +0200
+++ ./Classes/ImageManager.php	2006-12-21 22:28:00.000000000 +0100
@@ -1,17 +1,18 @@
-<?
+<?php
 /**
  * ImageManager, list images, directories, and thumbnails.
- * @author $Author: Wei Zhuo $
- * @version $Id: ImageManager.php 27 2004-04-01 08:31:57Z Wei Zhuo $
+ * @author Wei Zhuo
+ * @version $Id: ImageManager.php,v 1.4 2006/12/21 21:28:00 thierrybo Exp $
  * @package ImageManager
  */
 
 require_once('Files.php');
+require_once('Transform.php');
 
 /**
  * ImageManager Class.
- * @author $Author: Wei Zhuo $
- * @version $Id: ImageManager.php 27 2004-04-01 08:31:57Z Wei Zhuo $
+ * @author Wei Zhuo
+ * @version $Id: ImageManager.php,v 1.4 2006/12/21 21:28:00 thierrybo Exp $
  */
 class ImageManager 
 {
@@ -341,7 +342,7 @@
 	function validRelativePath($path) 
 	{
 		$dirs = $this->getDirs();
-		if($path == '/')
+		if($path == '/' || $path == '')
 			Return true;
 		//check the path given in the url against the 
 		//list of paths in the system.
@@ -430,6 +431,22 @@
 		$path = Files::makePath($this->getBaseDir(),$relative);
 		$result = Files::copyFile($file['tmp_name'], $path, $file['name']);
 
+       // constrain image size
+       if(!is_int($result))
+       {
+           $img = Image_Transform::factory(IMAGE_CLASS);
+           $img->load($path . $result);
+
+           // If maximum size is specified, constrain image to it.
+           if ($this->config['maxWidth'] > 0 && $this->config['maxHeight'] > 0 && ($img->img_x > $this->config['maxWidth'] || $img->img_y > $this->config['maxHeight']))
+           {
+               $percentage = min($this->config['maxWidth']/$img->img_x, $this->config['maxHeight']/$img->img_y);
+               $img->scale($percentage);
+           }
+           $img->save($path . $result);
+           $img->free();
+       }
+       
 		//no copy error
 		if(!is_int($result))
 		{
@@ -674,4 +691,4 @@
 	}
 }
 
-?>
\ Pas de fin de ligne à la fin du fichier.
+?>
diff -u -r /ImageManager_20062020/Classes/IM.php ./Classes/IM.php
--- /ImageManager_20062020/Classes/IM.php	2006-06-20 22:17:34.000000000 +0200
+++ ./Classes/IM.php	2006-12-19 22:14:36.000000000 +0100
@@ -25,7 +25,7 @@
 // | Authors: Peter Bowyer <peter@mapledesign.co.uk>                      |
 // +----------------------------------------------------------------------+
 //
-// $Id: IM.php 26 2004-03-31 02:35:21Z Wei Zhuo $
+// $Id: IM.php,v 1.2 2006/12/19 21:14:36 thierrybo Exp $
 //
 // Image Transformation interface using command line ImageMagick
 //
@@ -79,10 +79,14 @@
      */
     function _resize($new_x, $new_y)
     {
+		// prevent illegal data
+		if (!is_numeric($new_x)) die("new X must be numeric");
+		if (!is_numeric($new_y)) die("new Y must be numeric");
+
         /*if (isset($this->command['resize'])) {
             return PEAR::raiseError("You cannot scale or resize an image more than once without calling save or display", true);
         }*/
-        $this->command['resize'] = "-geometry ${new_x}x${new_y}!";
+        $this->command['resize'] = "-geometry {$new_x}x{$new_y}!";
 
         $this->new_x = $new_x;
         $this->new_y = $new_y;
@@ -98,6 +102,10 @@
      */
     function crop($crop_x, $crop_y, $crop_width, $crop_height) 
     {
+		if (!is_numeric($crop_x)) die("crop_x must be numeric");
+		if (!is_numeric($crop_y)) die("crop_y must be numeric");
+		if (!is_numeric($crop_width)) die("crop_width must be numeric");
+		if (!is_numeric($crop_height)) die("crop_height must be numeric");
         $this->command['crop'] = "-crop {$crop_width}x{$crop_height}+{$crop_x}+{$crop_y}";
     }
 
@@ -122,6 +130,7 @@
      */
     function rotate($angle, $options=null)
     {
+        if (!is_numeric($angle)) die("angle must be numeric");
         if ('-' == $angle{0}) {
             $angle = 360 - substr($angle, 1);
         }
@@ -164,6 +173,13 @@
          } else {
             $key = 'text';
          }
+		 // test input params
+         if (!is_numeric($x)) die("x must be numeric");
+         if (!is_numeric($y)) die("y must be numeric");
+         // escape others
+         $font = escapeshellarg($font);
+         $color = escapeshellarg($color);
+         $text = escapeshellarg($text);
          $this->command[$key] = "-font $font -fill $color -draw 'text $x,$y \"$text\"'";
          // Producing error: gs: not found gs: not found convert: Postscript delegate failed [No such file or directory].
     } // End addText
@@ -176,6 +192,7 @@
      * @return none
      */
     function gamma($outputgamma=1.0) {
+        if (!is_numeric($outputgamma)) die("outputgamma must be numeric");
         $this->command['gamma'] = "-gamma $outputgamma";
     }
 
@@ -190,6 +207,7 @@
      */
     function save($filename, $type='', $quality = 85)
     {
+        if (!is_numeric($quality)) die("quality must be numeric");
         $type == '' ? $this->type : $type;
         $cmd = '' . IMAGE_TRANSFORM_LIB_PATH . 'convert ';
 		$cmd .= implode(' ', $this->command) . " -quality $quality ";
@@ -210,6 +228,7 @@
      */
     function display($type = '', $quality = 75)
     {
+        if (!is_numeric($quality)) die("quality must be numeric");
         if ($type == '') {
             header('Content-type: image/' . $this->type);
             passthru(IMAGE_TRANSFORM_LIB_PATH . 'convert ' . implode(' ', $this->command) . " -quality $quality "  . escapeshellarg($this->image) . ' ' . strtoupper($this->type) . ":-");
diff -u -r /ImageManager_20062020/Classes/Thumbnail.php ./Classes/Thumbnail.php
--- /ImageManager_20062020/Classes/Thumbnail.php	2006-06-20 22:17:34.000000000 +0200
+++ ./Classes/Thumbnail.php	2006-12-16 22:38:13.000000000 +0100
@@ -1,125 +1,125 @@
-<?
+<?php
 /**
  * Create thumbnails.
- * @author $Author: Wei Zhuo $
- * @version $Id: Thumbnail.php 26 2004-03-31 02:35:21Z Wei Zhuo $
+ * @author Wei Zhuo
+ * @version $Id: Thumbnail.php,v 1.2 2006/12/16 21:38:13 thierrybo Exp $
  * @package ImageManager
  */
 
-
-require_once('Transform.php');
+
+require_once('Transform.php');
 
 /**
  * Thumbnail creation
- * @author $Author: Wei Zhuo $
- * @version $Id: Thumbnail.php 26 2004-03-31 02:35:21Z Wei Zhuo $
+ * @author Wei Zhuo
+ * @version $Id: Thumbnail.php,v 1.2 2006/12/16 21:38:13 thierrybo Exp $
  * @package ImageManager
  * @subpackage Images
  */
-class Thumbnail 
-{
-	/**
-	 * Graphics driver, GD, NetPBM or ImageMagick.
-	 */
-	var $driver;
-
-	/**
-	 * Thumbnail default width.
-	 */
-	var $width = 96;
-
-	/**
-	 * Thumbnail default height.
-	 */
-	var $height = 96;
-
-	/**
-	 * Thumbnail default JPEG quality.
-	 */
-	var $quality = 85;
-
-	/**
-	 * Thumbnail is proportional
-	 */
-	var $proportional = true;
-
-	/**
-	 * Default image type is JPEG.
-	 */
-	var $type = 'jpeg';
-
-	/**
-	 * Create a new Thumbnail instance.
-	 * @param int $width thumbnail width
-	 * @param int $height thumbnail height
-	 */
-	function Thumbnail($width=96, $height=96) 
-	{
-		$this->driver = Image_Transform::factory(IMAGE_CLASS);
-		$this->width = $width;
-		$this->height = $height;
-	}
-
-	/**
-	 * Create a thumbnail.
-	 * @param string $file the image for the thumbnail
-	 * @param string $thumbnail if not null, the thumbnail will be saved
-	 * as this parameter value.
-	 * @return boolean true if thumbnail is created, false otherwise
-	 */
-	function createThumbnail($file, $thumbnail=null) 
-	{
-		if(!is_file($file)) 
-			Return false;
-
-		//error_log('Creating Thumbs: '.$file);
-
-		$this->driver->load($file);
-
-		if($this->proportional) 
-		{
-			$width = $this->driver->img_x;
-			$height = $this->driver->img_y;
-
-			if ($width > $height)
-				$this->height = intval($this->width/$width*$height);
-			else if ($height > $width)
-				$this->width = intval($this->height/$height*$width);
-		}
-
-		$this->driver->resize($this->width, $this->height);
-
-		if(is_null($thumbnail)) 
-			$this->save($file);
-		else
-			$this->save($thumbnail);
-
-
-		$this->free();
-
-		if(is_file($thumbnail)) 
-			Return true;
-		else
-			Return false;
-	}
-
-	/**
-	 * Save the thumbnail file.
-	 * @param string $file file name to be saved as.
-	 */
-	function save($file) 
-	{
-		$this->driver->save($file);
-	}
-
-	/**
-	 * Free up the graphic driver resources.
-	 */
-	function free() 
-	{
-		$this->driver->free();
-	}
+class Thumbnail 
+{
+	/**
+	 * Graphics driver, GD, NetPBM or ImageMagick.
+	 */
+	var $driver;
+
+	/**
+	 * Thumbnail default width.
+	 */
+	var $width = 96;
+
+	/**
+	 * Thumbnail default height.
+	 */
+	var $height = 96;
+
+	/**
+	 * Thumbnail default JPEG quality.
+	 */
+	var $quality = 85;
+
+	/**
+	 * Thumbnail is proportional
+	 */
+	var $proportional = true;
+
+	/**
+	 * Default image type is JPEG.
+	 */
+	var $type = 'jpeg';
+
+	/**
+	 * Create a new Thumbnail instance.
+	 * @param int $width thumbnail width
+	 * @param int $height thumbnail height
+	 */
+	function Thumbnail($width=96, $height=96) 
+	{
+		$this->driver = Image_Transform::factory(IMAGE_CLASS);
+		$this->width = $width;
+		$this->height = $height;
+	}
+
+	/**
+	 * Create a thumbnail.
+	 * @param string $file the image for the thumbnail
+	 * @param string $thumbnail if not null, the thumbnail will be saved
+	 * as this parameter value.
+	 * @return boolean true if thumbnail is created, false otherwise
+	 */
+	function createThumbnail($file, $thumbnail=null) 
+	{
+		if(!is_file($file)) 
+			Return false;
+
+		//error_log('Creating Thumbs: '.$file);
+
+		$this->driver->load($file);
+
+		if($this->proportional) 
+		{
+			$width = $this->driver->img_x;
+			$height = $this->driver->img_y;
+
+			if ($width > $height)
+				$this->height = intval($this->width/$width*$height);
+			else if ($height > $width)
+				$this->width = intval($this->height/$height*$width);
+		}
+
+		$this->driver->resize($this->width, $this->height);
+
+		if(is_null($thumbnail)) 
+			$this->save($file);
+		else
+			$this->save($thumbnail);
+
+
+		$this->free();
+
+		if(is_file($thumbnail)) 
+			Return true;
+		else
+			Return false;
+	}
+
+	/**
+	 * Save the thumbnail file.
+	 * @param string $file file name to be saved as.
+	 */
+	function save($file) 
+	{
+		$this->driver->save($file);
+	}
+
+	/**
+	 * Free up the graphic driver resources.
+	 */
+	function free() 
+	{
+		$this->driver->free();
+	}
 }
 
 
-?>
\ Pas de fin de ligne à la fin du fichier.
+?>
diff -u -r /ImageManager_20062020/config.inc.php ./config.inc.php
--- /ImageManager_20062020/config.inc.php	2006-06-20 22:17:32.000000000 +0200
+++ ./config.inc.php	2006-12-20 19:39:39.000000000 +0100
@@ -1,9 +1,9 @@
-<?
+<?php
 /**
  * Image Manager configuration file.
- * @author $Author: Wei Zhuo $
- * @author $Author: Paul Moers <mail@saulmade.nl> $ - watermarking and replace code + several small enhancements <http://www.saulmade.nl/FCKeditor/FCKPlugins.php>
- * @version $Id: config.inc.php 27 2004-04-01 08:31:57Z Wei Zhuo $
+ * @author Wei Zhuo
+ * @author Paul Moers <mail@saulmade.nl> - watermarking and replace code + several small enhancements <http://www.saulmade.nl/FCKeditor/FCKPlugins.php>
+ * @version $Id: config.inc.php,v 1.4 2006/12/17 14:53:50 thierrybo Exp $
  * @package ImageManager
  */
 
@@ -16,7 +16,7 @@
        PHP must be able to create files in this directory.
 	   Able to create directories is nice, but not necessary.
 */
-#$IMConfig['base_dir'] = '/var/www/FCKeditor/images/';
+$IMConfig['base_dir'] = '/var/www/FCKeditor/images/';
 
 /*
  The URL to the above path, the web browser needs to be able to see it.
@@ -27,8 +27,7 @@
  in this directory and its subdirectories.
 */
 $IMConfig['base_url'] = 'http://www.saulmade.nl/FCKeditor/images/';
-//$IMConfig['base_dir'] = $_SERVER['DOCUMENT_ROOT'].$IMConfig['base_url'];
-$IMConfig['base_dir'] = '/home/saulmade.nl/www/FCKeditor/images/';
+
 $IMConfig['server_name'] = $_SERVER['SERVER_NAME'];
 
 /*
@@ -152,10 +151,7 @@
   Specifying none will hide watermarking functionality.
 */
 $IMConfig['watermarks'] = array	(
-													"imageManager.png",
-													"imageManager.jpg",
-													"devshed.png",
-													"natureWatermark.png"
+													"imageManager.png"
 												);
 
 /*
@@ -194,4 +190,4 @@
   Image Editor temporary filename prefix.
 */
 $IMConfig['tmp_prefix'] = '.editor_';
-?>
\ Pas de fin de ligne à la fin du fichier.
+?>
diff -u -r /ImageManager_20062020/editorFrame.php ./editorFrame.php
--- /ImageManager_20062020/editorFrame.php	2006-06-20 22:17:32.000000000 +0200
+++ ./editorFrame.php	2006-12-20 19:19:28.000000000 +0100
@@ -1,9 +1,9 @@
-<?
+<?php
 	/**
 	 * The frame that contains the image to be edited.
-	 * @author $Author: Wei Zhuo $
-	 * @author $Author: Paul Moers <mail@saulmade.nl> $ - watermarking and replace code + several small enhancements <http://www.saulmade.nl/FCKeditor/FCKPlugins.php>
-	 * @version $Id: editorFrame.php 26 2004-03-31 02:35:21Z Wei Zhuo $
+	 * @author Wei Zhuo
+	 * @author Paul Moers <mail@saulmade.nl> - watermarking and replace code + several small enhancements <http://www.saulmade.nl/FCKeditor/FCKPlugins.php>
+	 * @version $Id: editorFrame.php,v 1.7 2006/12/20 18:19:28 thierrybo Exp $
 	 * @package ImageManager
 	 */
 
@@ -49,7 +49,7 @@
 <script type="text/javascript">
 // <![CDATA[
 
-	var processedAction = "<?=$_GET['action']?>";
+	var processedAction = "<?php echo (isset($_GET['action']) ? $_GET['action'] : ''); ?>";
 
 	if (processedAction == 'replace' && parent.old)
 	{
@@ -101,8 +101,8 @@
 
 <script type="text/javascript">
 
-	var mode = "<? echo $editor->getAction(); ?>" //crop, scale, measure
-	var currentImageFile = "<? if(count($imageInfo)>0) echo rawurlencode($imageInfo['file']); ?>";
+	var mode = "<?php echo $editor->getAction(); ?>" //crop, scale, measure
+	var currentImageFile = "<?php if(count($imageInfo)>0) echo rawurlencode($imageInfo['file']); ?>";
 
 	if(window.top)
 	{
@@ -120,7 +120,7 @@
 </script>
 
 <script type="text/javascript">
-<?
+<?php
 	if ($editor->isFileSaved() == 1)
 	{
 ?>
@@ -159,28 +159,32 @@
 
 	// save message
 	var message = i18n('File saved.');
-<?
+<?php
 	if ($editor->forcedNewName != false)
 	{
 ?>
-	message += '\n' + i18n('File name was changed into ') +  '<?=$editor->forcedNewName?>';
-<?
+	message += '\n' + i18n('File name was changed into ') +  '<?php echo $editor->forcedNewName; ?>';
+<?php
 	}
 ?>
 	alert(message);
-<?
+<?php
 	}
 	else if ($editor->isFileSaved() == -1)
 	{
 ?>
 	alert(i18n('File was not saved.'));
-<?
+<?php
 	}
 ?>
 
 	// show action buttons and current action's controls - were hidden during processing
 	if (processedAction != '')
 	{
+		if ('flip' == processedAction)
+		{
+			processedAction = 'rotate';
+		}
 		var tools = parent.document.getElementById('tools_' + processedAction);
 		tools.style.display = 'block';
 		var buttons = parent.document.getElementById('buttons');
@@ -193,12 +197,12 @@
 	imagesArray = new Array();
 	// first clear all its options
 	watermarkBox.options.length = 0;
-<?
+<?php
 	foreach($IMConfig['watermarks'] as $watermark)
 	{
 		$watermarkInfo = @getImageSize($IMConfig['base_dir'] . $watermark);
 		// populate
-		if ($watermarkInfo[0] < $imageInfo[width] && $watermarkInfo[1] < $imageInfo[height])
+		if ($watermarkInfo[0] < $imageInfo['width'] && $watermarkInfo[1] < $imageInfo['height'] && $watermarkInfo[0] != '')
 		{
 			$pos = strrpos(basename($watermark), ".");
 			$filename = substr(basename($watermark), 0, $pos);
@@ -243,23 +247,25 @@
 <body>
 <div id="status"></div>
 <div id="ant" class="selection" style="visibility:hidden"><img src="img/spacer.gif" width="0" height="0" border="0" alt="" id="cropContent"></div>
-<? if ($editor->isGDEditable() == -1) { ?>
+<?php if ($editor->isGDEditable() == -1) { ?>
 	<div style="text-align:center; padding:10px;"><span class="error">GIF format is not supported, image editing not supported.</span></div>
-<? } ?>
+<?php } ?>
 <table height="100%" width="100%">
 	<tr>
 		<td>
-<? if(count($imageInfo) > 0 && is_file($imageInfo['fullpath'])) { ?>
+<?php if(count($imageInfo) > 0 && is_file($imageInfo['fullpath'])) { ?>
 
-		<div id="background" name="background" style="margin: auto; width: <? echo $imageInfo['width']; ?>px; height: <? echo $imageInfo['height']; ?>px; background-image: url(<? echo $imageInfo['src']; ?>);">
-			<img name="floater" id="floater" style="width: 150px; height: 150px; behavior: url('assets/pngbehavior.htc'); position: absolute" src="<?= $IMConfig['base_url'] . $IMConfig['watermarks'][0] ?>" />
+		<div id="background" name="background" style="margin: auto; width: <?php echo $imageInfo['width']; ?>px; height: <?php echo $imageInfo['height']; ?>px; background-image: url(<?php echo $imageInfo['src']; ?>);">
+		<?php if (count($IMConfig['watermarks']) > 0) { ?>
+			<img name="floater" id="floater" style="width: 150px; height: 150px; behavior: url('assets/pngbehavior.htc'); position: absolute" src="<?php echo $IMConfig['base_url'] . $IMConfig['watermarks'][0]; ?>" />
+		<?php } ?>
 		</div>
 
-		<span id="imgCanvas" name="imgCanvas" class="crop" style="display: none;"><img src="<? echo $imageInfo['src']; ?>" <? echo $imageInfo['dimensions']; ?> alt="" id="theImage" name="theImage" /></span>
+		<span id="imgCanvas" name="imgCanvas" class="crop" style="display: none;"><img src="<?php echo $imageInfo['src']; ?>" <?php echo $imageInfo['dimensions']; ?> alt="" id="theImage" name="theImage" /></span>
 
-<? } else { ?>
+<?php } else { ?>
 				<span class="error">No Image Available</span>
-<? } ?>
+<?php } ?>
 		</td>
 	</tr>
 </table>
@@ -279,13 +285,13 @@
 		verifyBounds();
 		dd.elements.floater.nimg.style.behavior = "url('assets/pngbehavior.htc')";
 
-<?
+<?php
 	if (isset($_GET['action']))
 	{
 		if ($_GET['action'] == "watermark")
 		{?>
 				dd.elements.floater.show();
-		<?}
+		<?php }
 	}
 ?>
 	}
@@ -306,4 +312,4 @@
 // ]]>
 </script>
 </body>
-</html>
\ Pas de fin de ligne à la fin du fichier.
+</html>
diff -u -r /ImageManager_20062020/editor.php ./editor.php
--- /ImageManager_20062020/editor.php	2006-06-20 22:17:32.000000000 +0200
+++ ./editor.php	2006-12-17 14:53:34.000000000 +0100
@@ -1,9 +1,9 @@
-<?
+<?php
 /**
  * The PHP Image Editor user interface.
- * @author $Author: Wei Zhuo $
- * @author $Author: Paul Moers <mail@saulmade.nl> $ - watermarking and replace code + several small enhancements <http://www.saulmade.nl/FCKeditor/FCKPlugins.php>
- * @version $Id: editor.php 26 2004-03-31 02:35:21Z Wei Zhuo $
+ * @author Wei Zhuo
+ * @author Paul Moers <mail@saulmade.nl> - watermarking and replace code + several small enhancements <http://www.saulmade.nl/FCKeditor/FCKPlugins.php>
+ * @version $Id: editor.php,v 1.3 2006/12/17 13:53:34 thierrybo Exp $
  * @package ImageManager
  */
 
@@ -79,9 +79,9 @@
 		<table>
 		<tr>
 			<td>
-				<form action="editorFrame.php?img=<?=$_GET['img']?>&action=replace" target='editor' id="uploadForm" method="post" enctype="multipart/form-data">
+				<form action="editorFrame.php?img=<?php echo $_GET['img']?>&action=replace" target='editor' id="uploadForm" method="post" enctype="multipart/form-data">
 					&nbsp;<input type="file" name="upload" id="upload"/>
-					<input type="hidden" name="dir" id="dir" value="<?=dirname($img)?>" />
+					<input type="hidden" name="dir" id="dir" value="<?php echo dirname($_GET['img'])?>" />
 				</form>
 			</td>
 			<td>
@@ -189,7 +189,7 @@
               <option value="90">Rotate 90 &deg; CW</option>
               <option value="-90">Rotate 90 &deg; CCW</option>
          </select>
-			<label for="ra">Angle:</label><input type="text" id="ra" class="textInput" />
+			<label for="ra">Angle:</label><input type="text" id="ra" class="textInput" value="0"/>
 			<img src="img/div.gif" height="30" width="2" class="div" alt="|" />
 		</div>	
 		<a href="javascript: editor.doSubmit('rotate');" class="buttons" title="OK"><img src="img/btn_ok.gif" height="30" width="30" alt="OK" /></a>
@@ -219,32 +219,32 @@
 	</div>
 	<div id="tools_save" style="display:none;">
 
-<? if($IMConfig['demo'] != true) { ?>
+<?php if($IMConfig['demo'] != true) { ?>
 
 		<div id="tool_inputs">
 
-	<? if($IMConfig['allow_newFileName'] == true) { ?>
-			<label for="save_filename">Filename:</label><input type="text" id="save_filename" value="<? if($IMConfig['allow_overwrite'] == false){ echo $editor->getDefaultSaveFile(); }else{ echo basename($_GET['img']); } ?>" />
-	<? }else{ ?>
-			<input type="hidden" id="save_filename" value="<? echo basename($_GET['img']); ?>" />
-	<? } ?>
+	<?php if($IMConfig['allow_newFileName'] == true) { ?>
+			<label for="save_filename">Filename:</label><input type="text" id="save_filename" value="<?php if($IMConfig['allow_overwrite'] == false){ echo $editor->getDefaultSaveFile(); }else{ echo basename($_GET['img']); } ?>" />
+	<?php }else{ ?>
+			<input type="hidden" id="save_filename" value="<?php echo basename($_GET['img']); ?>" />
+	<?php } ?>
 
-	<?
+	<?php
 	$pos = strrpos($_GET['img'], ".");
 	$ext = substr($_GET['img'], $pos + 1);
 	?>
-			<select name="format" id="save_format" style="margin-left: 10px; vertical-align: middle; <? if($IMConfig['allow_newFileName'] != true && $ext != "jpg" && $ext != "jpeg") {echo "display: none;";} ?>" onchange="updateFormat(this)">
+			<select name="format" id="save_format" style="margin-left: 10px; vertical-align: middle; <?php if($IMConfig['allow_newFileName'] != true && $ext != "jpg" && $ext != "jpeg") {echo "display: none;";} ?>" onchange="updateFormat(this)">
             <option value="" selected>Image Format</option>
             <option value="">---------------------</option>
             <option value="jpeg,85">JPEG High</option>
             <option value="jpeg,60">JPEG Medium</option>
             <option value="jpeg,35">JPEG Low</option>
-			<? if($IMConfig['allow_newFileName'] == true){ ?>
+			<?php if($IMConfig['allow_newFileName'] == true){ ?>
             <option value="png">PNG</option>
-			<?    if($editor->isGDGIFAble() != -1) { ?>
+			<?php    if($editor->isGDGIFAble() != -1) { ?>
             <option value="gif">GIF</option>
-			<?    } ?>
-			<? } ?>
+			<?php    } ?>
+			<?php } ?>
 			</select>
 
 			<label>Quality:</label>
@@ -263,21 +263,21 @@
 		</div>	
 		<a href="javascript: editor.doSubmit('save');" class="buttons" title="OK"><img src="img/btn_ok.gif" height="30" width="30" alt="OK" /></a>
 
-	<? }else{ ?>
+	<?php }else{ ?>
 
 		<div id="tool_inputs" style="text-align: center; width: 90%; font-size: 150%; font-weight: bold; letter-spacing: 3px; color: #474767;">
 			<label>Demo</label>
 		</div>	
 
-	<? } ?>
+	<?php } ?>
 
 	</div>	
 </div>
 <div id="toolbar">
 	<div id="buttons">
 
-		<a href="javascript:toggle('replace')" id="icon_replace" title="Replace" <? if($IMConfig['allow_replace'] == false) { echo "style=\"display: none;\""; } ?> ><img src="img/replace.gif" height="20" width="20" alt="Replace" /><span>Replace</span></a>
-		<a href="javascript:toggle('watermark')" id="icon_watermark" title="Watermark" <? if(empty($IMConfig['watermarks'])) { echo "style=\"display: none;\""; } ?> ><img src="img/watermark.gif" height="20" width="20" alt="Watermark" /><span>Watermark</span></a>
+		<a href="javascript:toggle('replace')" id="icon_replace" title="Replace" <?php if($IMConfig['allow_replace'] == false) { echo "style=\"display: none;\""; } ?> ><img src="img/replace.gif" height="20" width="20" alt="Replace" /><span>Replace</span></a>
+		<a href="javascript:toggle('watermark')" id="icon_watermark" title="Watermark" <?php if(empty($IMConfig['watermarks'])) { echo "style=\"display: none;\""; } ?> ><img src="img/watermark.gif" height="20" width="20" alt="Watermark" /><span>Watermark</span></a>
 		<a href="javascript:toggle('crop')" id="icon_crop" title="Crop"><img src="img/crop.gif" height="20" width="20" alt="Crop" /><span>Crop</span></a>
 		<a href="javascript:toggle('scale')" id="icon_scale" title="Resize"><img src="img/scale.gif" height="20" width="20" alt="Resize" /><span>Resize</span></a>
 		<a href="javascript:toggle('rotate')" id="icon_rotate" title="Rotate"><img src="img/rotate.gif" height="20" width="20" alt="Rotate" /><span>Rotate</span></a>
@@ -288,8 +288,8 @@
 </div>
 <div id="contents">
 <div id="messages" style="display: none;"><span id="message"></span><img SRC="img/dots.gif" width="22" height="12" alt="..." /></div>
-<iframe src="editorFrame.php?img=<? if(isset($_GET['img'])) echo rawurlencode($_GET['img']); ?>" name="editor" id="editor" scrolling="auto" title="Image Editor" frameborder="0"></iframe>
+<iframe src="editorFrame.php?img=<?php if(isset($_GET['img'])) echo rawurlencode($_GET['img']); ?>" name="editor" id="editor" scrolling="auto" title="Image Editor" frameborder="0"></iframe>
 </div>
 <div id="bottom"></div>
 </body>
-</html>
\ Pas de fin de ligne à la fin du fichier.
+</html>
diff -u -r /ImageManager_20062020/fckplugin.js ./fckplugin.js
--- /ImageManager_20062020/fckplugin.js	2006-06-20 22:17:32.000000000 +0200
+++ ./fckplugin.js	2006-12-21 22:39:28.000000000 +0100
@@ -8,6 +8,7 @@
 // PHP image manager http://www.zhuo.org/htmlarea/
 // ================================================
 // Revision: 1.0                   Date: 06/03/2005
+// $Id: fckplugin.js,v 1.4 2006/12/21 20:47:55 thierrybo Exp $
 // ================================================
 
 
@@ -146,7 +147,8 @@
 				im = FCK.CreateElement('IMG');					
 			}
 
-			// set image attributes				
+			// set image attributes	
+			setAttrib(im, "_fcksavedurl", param.f_url, true);			
 			setAttrib(im, 'src', param.f_url, true);				
 			setAttrib(im, 'alt', param.f_alt, true);
 			setAttrib(im, 'title', param.f_title, true);
@@ -174,7 +176,7 @@
 // Version 3.0 developed by Mihai Bazon.
 //   http://dynarch.com/mishoo
 //
-// $Id: dialog.js 26 2004-03-31 02:35:21Z Wei Zhuo $
+// Id: dialog.js 26 2004-03-31 02:35:21Z Wei Zhuo 
 
 // Though "Dialog" looks like an object, it isn't really an object.  Instead
 // it's just namespace for protecting global symbols.
diff -u -r /ImageManager_20062020/images.php ./images.php
--- /ImageManager_20062020/images.php	2006-06-20 22:17:32.000000000 +0200
+++ ./images.php	2006-12-16 22:38:13.000000000 +0100
@@ -1,8 +1,8 @@
-<?
+<?php
 /**
  * Show a list of images in a long horizontal table.
- * @author $Author: Wei Zhuo $
- * @version $Id: images.php 27 2004-04-01 08:31:57Z Wei Zhuo $
+ * @author Wei Zhuo
+ * @version $Id: images.php,v 1.2 2006/12/16 21:38:13 thierrybo Exp $
  * @package ImageManager
  */
 
@@ -54,15 +54,15 @@
 	foreach($list as $entry => $file) 
 	{ ?>
 		<td><table width="100" cellpadding="0" cellspacing="0"><tr><td class="block">
-		<a href="javascript:;" onclick="selectImage('<? echo $file['relative'];?>', '<? echo $entry; ?>', <? echo $file['image'][0];?>, <? echo $file['image'][1]; ?>);"title="<? echo $entry; ?> - <? echo Files::formatSize($file['stat']['size']); ?>"><img src="<? echo $manager->getThumbnail($file['relative']); ?>" alt="<? echo $entry; ?> - <? echo Files::formatSize($file['stat']['size']); ?>"/></a>
+		<a href="javascript:;" onclick="selectImage('<?php echo $file['relative'];?>', '<?php echo $entry; ?>', <?php echo $file['image'][0];?>, <?php echo $file['image'][1]; ?>);"title="<?php echo $entry; ?> - <?php echo Files::formatSize($file['stat']['size']); ?>"><img src="<?php echo $manager->getThumbnail($file['relative']); ?>" alt="<?php echo $entry; ?> - <?php echo Files::formatSize($file['stat']['size']); ?>"/></a>
 		</td></tr><tr><td class="edit">
-		<? if($IMConfig['allow_delete'] == true) { ?>
-			<a href="images.php?dir=<? echo $relative; ?>&amp;delf=<? echo rawurlencode($file['relative']);?>" title="Trash" onclick="return confirmDeleteFile('<? echo $entry; ?>');"><img src="img/edit_trash.gif" height="15" width="15" alt="Trash"/></a>
-		<? } ?>
-			<a href="javascript:;" title="Edit" onclick="editImage('<? echo rawurlencode($file['relative']);?>');"><img src="img/edit_pencil.gif" height="15" width="15" alt="Edit"/></a>
-		<? if($file['image']){ echo $file['image'][0].'x'.$file['image'][1]; } else echo $entry;?>
+		<?php if($IMConfig['allow_delete'] == true) { ?>
+			<a href="images.php?dir=<?php echo $relative; ?>&amp;delf=<?php echo rawurlencode($file['relative']);?>" title="Trash" onclick="return confirmDeleteFile('<?php echo $entry; ?>');"><img src="img/edit_trash.gif" height="15" width="15" alt="Trash"/></a>
+		<?php } ?>
+			<a href="javascript:;" title="Edit" onclick="editImage('<?php echo rawurlencode($file['relative']);?>');"><img src="img/edit_pencil.gif" height="15" width="15" alt="Edit"/></a>
+		<?php if($file['image']){ echo $file['image'][0].'x'.$file['image'][1]; } else echo $entry;?>
 		</td></tr></table></td> 
-	  <? 
+	  <?php 
 	}//foreach
 }//function drawFiles
 
@@ -77,14 +77,14 @@
 	foreach($list as $path => $dir) 
 	{ ?>
 		<td><table width="100" cellpadding="0" cellspacing="0"><tr><td class="block">
-		<a href="images.php?dir=<? echo rawurlencode($path); ?>" onclick="updateDir('<? echo $path; ?>')" title="<? echo $dir['entry']; ?>"><img src="img/folder.gif" height="80" width="80" alt="<? echo $dir['entry']; ?>" /></a>
+		<a href="images.php?dir=<?php echo rawurlencode($path); ?>" onclick="updateDir('<?php echo $path; ?>')" title="<?php echo $dir['entry']; ?>"><img src="img/folder.gif" height="80" width="80" alt="<?php echo $dir['entry']; ?>" /></a>
 		</td></tr><tr>
 		<td class="edit">
-			<a href="images.php?dir=<? echo $relative; ?>&amp;deld=<? echo rawurlencode($path); ?>" title="Trash" onclick="return confirmDeleteDir('<? echo $dir['entry']; ?>', <? echo $dir['count']; ?>);"><img src="img/edit_trash.gif" height="15" width="15" alt="Trash"/></a>
-			<? echo $dir['entry']; ?>
+			<a href="images.php?dir=<?php echo $relative; ?>&amp;deld=<?php echo rawurlencode($path); ?>" title="Trash" onclick="return confirmDeleteDir('<?php echo $dir['entry']; ?>', <?php echo $dir['count']; ?>);"><img src="img/edit_trash.gif" height="15" width="15" alt="Trash"/></a>
+			<?php echo $dir['entry']; ?>
 		</td>
 		</tr></table></td>
-	  <? 
+	  <?php 
 	} //foreach
 }//function drawDirs
 
@@ -100,7 +100,7 @@
     <td class="noResult">No Images Found</td>
   </tr>
 </table>
-<?	
+<?php	
 }
 
 /**
@@ -111,10 +111,10 @@
 ?>
 <table width="100%">
   <tr>
-    <td class="error">Invalid base directory: <? echo $manager->config['base_dir']; ?></td>
+    <td class="error">Invalid base directory: <?php echo $manager->config['base_dir']; ?></td>
   </tr>
 </table>
-<?	
+<?php	
 }
 
 ?>
@@ -145,7 +145,7 @@
 		hideMessage();
 		var topDoc = window.top.document;
 
-<? 
+<?php 
 	//we need to refesh the drop directory list
 	//save the current dir, delete all select options
 	//add the new list, re-select the saved dir.
@@ -159,10 +159,10 @@
 		while(selection.length > 0)
 		{	selection.remove(0); }
 		
-		selection.options[selection.length] = new Option("/","<? echo rawurlencode('/'); ?>");	
-		<? foreach($dirs as $relative=>$fullpath) { ?>
-		selection.options[selection.length] = new Option("<? echo $relative; ?>","<? echo rawurlencode($relative); ?>");		
-		<? } ?>
+		selection.options[selection.length] = new Option("/","<?php echo rawurlencode('/'); ?>");	
+		<?php foreach($dirs as $relative=>$fullpath) { ?>
+		selection.options[selection.length] = new Option("<?php echo $relative; ?>","<?php echo rawurlencode($relative); ?>");		
+		<?php } ?>
 		
 		for(var i = 0; i < selection.length; i++)
 		{
@@ -173,7 +173,7 @@
 				break;
 			}
 		}		
-<? } ?>
+<?php } ?>
 	}	
 
 	function editImage(image) 
@@ -196,14 +196,14 @@
 </head>
 
 <body>
-<? if ($manager->isValidBase() == false) { drawErrorBase($manager); } 
+<?php if ($manager->isValidBase() == false) { drawErrorBase($manager); } 
 	elseif(count($list[0]) > 0 || count($list[1]) > 0) { ?>
 <table>
 	<tr>
-	<? drawDirs($list[0], $manager); ?>
-	<? drawFiles($list[1], $manager); ?>
+	<?php drawDirs($list[0], $manager); ?>
+	<?php drawFiles($list[1], $manager); ?>
 	</tr>
 </table>
-<? } else { drawNoResults(); } ?>
+<?php } else { drawNoResults(); } ?>
 </body>
-</html>
\ Pas de fin de ligne à la fin du fichier.
+</html>
diff -u -r /ImageManager_20062020/lang/fr.js ./lang/fr.js
--- /ImageManager_20062020/lang/fr.js	2006-06-20 22:17:46.000000000 +0200
+++ ./lang/fr.js	2006-12-17 12:46:48.000000000 +0100
@@ -1,7 +1,8 @@
 // I18N constants
 
 // LANG: "fr", ENCODING: UTF-8
-// Author: ?
+// Author: Thierry Bothorel (update)
+// $Id: fr.js,v 1.2 2006/12/17 11:46:48 thierrybo Exp $
 // Updated for FCKeditor by: Paul Moers, http://www.saulmade.nl/FCKeditor/FCKPlugins.php
 
 // FOR TRANSLATORS:
@@ -86,19 +87,19 @@
 	"Padding:"										: "Espacement:",
 	"Border:"										: "Bordure:",
 	"Upload:"										: "Télétransmission:",
-	"File name was changed into "		: "File name was changed into ", // not translated yet
-	"start x coordinate"							: "start x coordinate", // not translated yet
-	"start y coordinate"							: "start y coordinate", // not translated yet
+	"File name was changed into "		: "Le nom du fichier a été changé en ",
+	"start x coordinate"							: "début coordonnée x",
+	"start y coordinate"							: "début coordonnée y",
 	"height"											: "hauteur",
 	"width"											: "longueur",
 	"angle"											: "angle",
 	"opacity"										: "opacité",
-	"diagonal length"							: "diagonal length", // not translated yet
-	"Watermarking is disabled."			: "Watermarking is disabled.", // not translated yet
-	"No watermarks were found or all watermarks are to big for the target image."		: "No watermarks were found or all watermarks are to big for the target image.", // not translated yet
+	"diagonal length"							: "longueur diagonale",
+	"Watermarking is disabled."			: "Filigranes désactivés.",
+	"No watermarks were found or all watermarks are to big for the target image."		: "Aucun filigrane trouvé ou tous les filigranes sont trop grands pour cette image.",
 	"Please delete all files/folders inside the folder you wish to delete first."				: "Veuillez tout d'abord supprimer tous les fichiers et répertoires contenus",
 	"Invalid folder name, please choose another folder name."									: "Nom de répertoire invalide, veuillez choisir un autre nom",
 	"GIF format is not supported, image editing not supported."								: "Format GIF non supporté, édition d'image non supportée",
-	"Please do not close the window while uploading a new image! If you do, the original image gets deleted!" : "Please do not close the window while uploading a new image! If you do, the original image gets deleted!", // not translated yet
-	"Error: Couldn't update editor window.\nAny image that was edited and saved will still be visible as the old version!\nPlease save and reload the editor content." : "Error: Couldn't update editor window.\nAny image that was edited and saved will still be visible as the old version!\nPlease save and reload the editor content." // not translated yet
-};
\ Pas de fin de ligne à la fin du fichier.
+	"Please do not close the window while uploading a new image! If you do, the original image gets deleted!" : "Ne FERMEZ PAS CETTE FENETRE pendant l'envoi d'une nouvelle image sinon l'image originale sera quand même supprimée !",
+	"Error: Couldn't update editor window.\nAny image that was edited and saved will still be visible as the old version!\nPlease save and reload the editor content." : "Erreur: Impossible d'actualiser la fenêtre de l'éditeur.\nL'image qui a été éditée et sauvegardée apparaitra toujours comme non modifiée !\nVeuillez sauvegarder et recharger le contenu de l'éditeur."
+};
diff -u -r /ImageManager_20062020/manager.php ./manager.php
--- /ImageManager_20062020/manager.php	2006-06-20 22:17:32.000000000 +0200
+++ ./manager.php	2006-12-17 15:57:17.000000000 +0100
@@ -1,8 +1,8 @@
-<?
+<?php
 /**
  * The main GUI for the ImageManager.
- * @author $Author: Wei Zhuo $
- * @version $Id: manager.php 26 2004-03-31 02:35:21Z Wei Zhuo $
+ * @author Wei Zhuo
+ * @version $Id: manager.php,v 1.4 2006/12/17 14:57:17 thierrybo Exp $
  * @package ImageManager
  */
 
@@ -24,11 +24,11 @@
 <script type="text/javascript">
 /*<![CDATA[*/
 
-	var thumbdir = "<? echo $IMConfig['thumbnail_dir']; ?>";
-	var base_url = "<? echo $manager->getBaseURL(); ?>";
-	var server_name = "<? echo $IMConfig['server_name']; ?>";
+	var thumbdir = "<?php echo $IMConfig['thumbnail_dir']; ?>";
+	var base_url = "<?php echo $manager->getBaseURL(); ?>";
+	var server_name = "<?php echo $IMConfig['server_name']; ?>";
 
-	window.resizeTo(600, 460);
+	window.resizeTo(900, 500);
 
 	if(window.opener.ImageManager && window.opener.ImageManager.I18N)
 	{
@@ -71,14 +71,14 @@
 	<label for="dirPath">Directory</label>
 	<select name="dir" class="dirWidth" id="dirPath" onchange="updateDir(this)">
 	<option value="/">/</option>
-<? foreach($dirs as $relative=>$fullpath) { ?>
-		<option value="<? echo rawurlencode($relative); ?>"><? echo $relative; ?></option>
-<? } ?>
+<?php foreach($dirs as $relative=>$fullpath) { ?>
+		<option value="<?php echo rawurlencode($relative); ?>"><?php echo $relative; ?></option>
+<?php } ?>
 	</select>
 	<a href="#" onclick="javascript: goUpDir();" title="Directory Up"><img src="img/btnFolderUp.gif" height="15" width="15" alt="Directory Up" /></a>
-<? if($IMConfig['safe_mode'] == false && $IMConfig['allow_new_dir']) { ?>
+<?php if($IMConfig['safe_mode'] == false && $IMConfig['allow_new_dir']) { ?>
 	<a href="#" onclick="newFolder();" title="New Folder"><img src="img/btnFolderNew.gif" height="15" width="15" alt="New Folder" /></a>
-<? } ?>
+<?php } ?>
 	<div id="messages" style="display: none;"><span id="message"></span><img SRC="img/dots.gif" width="22" height="12" alt="..." /></div>
 	<iframe src="images.php" name="imgManager" id="imgManager" class="imageFrame" scrolling="auto" title="Image Selection" frameborder="0"></iframe>
 </div>
@@ -105,7 +105,7 @@
 			<td><input type="text" id="f_horiz" class="smallWidth" value="" /></td>
 		</tr>
 		<tr>
-<? if($IMConfig['allow_upload'] == true) { ?>
+<?php if($IMConfig['allow_upload'] == true) { ?>
 			<td align="right"><label for="upload">Upload</label></td>
 			<td>
 				<table cellpadding="0" cellspacing="0" border="0">
@@ -115,9 +115,9 @@
                   </tr>
                 </table>
 			</td>
-<? } else { ?>
+<?php } else { ?>
 			<td colspan="2"></td>
-<? } ?>
+<?php } ?>
 			<td align="right"><label for="f_align">Align</label></td>
 			<td colspan="2">
 				<select size="1" id="f_align"  title="Positioning of this image">
@@ -155,4 +155,4 @@
 	<input type="hidden" id="f_file" name="f_file" />
 </form>
 </body>
-</html>
\ Pas de fin de ligne à la fin du fichier.
+</html>
diff -u -r /ImageManager_20062020/thumbs.php ./thumbs.php
--- /ImageManager_20062020/thumbs.php	2006-06-20 22:17:32.000000000 +0200
+++ ./thumbs.php	2006-12-16 22:38:13.000000000 +0100
@@ -1,82 +1,82 @@
-<?
+<?php
 /**
  * On the fly Thumbnail generation.
  * Creates thumbnails given by thumbs.php?img=/relative/path/to/image.jpg
  * relative to the base_dir given in config.inc.php
- * @author $Author: Wei Zhuo $
- * @version $Id: thumbs.php 26 2004-03-31 02:35:21Z Wei Zhuo $
+ * @author Wei Zhuo
+ * @version $Id: thumbs.php,v 1.2 2006/12/16 21:38:13 thierrybo Exp $
  * @package ImageManager
  */
 
-require_once('config.inc.php');
-require_once('Classes/ImageManager.php');
-require_once('Classes/Thumbnail.php');
-
-//check for img parameter in the url
-if(!isset($_GET['img']))
-	exit();
-
-
-$manager = new ImageManager($IMConfig);
-
-//get the image and the full path to the image
-$image = rawurldecode($_GET['img']);
-$fullpath = Files::makeFile($manager->getBaseDir(),$image);
-
-//not a file, so exit
-if(!is_file($fullpath))
-	exit();
-
-$imgInfo = @getImageSize($fullpath);
-
-//Not an image, send default thumbnail
-if(!is_array($imgInfo))
-{
-	//show the default image, otherwise we quit!
-	$default = $manager->getDefaultThumb();
-	if($default)
-	{
-		header('Location: '.$default);
-		exit();
-	}
-}
-//if the image is less than the thumbnail dimensions
-//send the original image as thumbnail
-if ($imgInfo[0] <= $IMConfig['thumbnail_width']
- && $imgInfo[1] <= $IMConfig['thumbnail_height'])
- {
-	 header('Location: '.$manager->getFileURL($image));
-	 exit();
- }
-
-//Check for thumbnails
-$thumbnail = $manager->getThumbName($fullpath);
-if(is_file($thumbnail))
-{
-	//if the thumbnail is newer, send it
-	if(filemtime($thumbnail) >= filemtime($fullpath))
-	{
-		header('Location: '.$manager->getThumbURL($image));
-		exit();
-	}
-}
-
-//creating thumbnails
-$thumbnailer = new Thumbnail($IMConfig['thumbnail_width'],$IMConfig['thumbnail_height']);
-$thumbnailer->createThumbnail($fullpath, $thumbnail);
-
-//Check for NEW thumbnails
-if(is_file($thumbnail))
-{
-	//send the new thumbnail
-	header('Location: '.$manager->getThumbURL($image));
-	exit();
-}
-else
-{
-	//show the default image, otherwise we quit!
-	$default = $manager->getDefaultThumb();
+require_once('config.inc.php');
+require_once('Classes/ImageManager.php');
+require_once('Classes/Thumbnail.php');
+
+//check for img parameter in the url
+if(!isset($_GET['img']))
+	exit();
+
+
+$manager = new ImageManager($IMConfig);
+
+//get the image and the full path to the image
+$image = rawurldecode($_GET['img']);
+$fullpath = Files::makeFile($manager->getBaseDir(),$image);
+
+//not a file, so exit
+if(!is_file($fullpath))
+	exit();
+
+$imgInfo = @getImageSize($fullpath);
+
+//Not an image, send default thumbnail
+if(!is_array($imgInfo))
+{
+	//show the default image, otherwise we quit!
+	$default = $manager->getDefaultThumb();
+	if($default)
+	{
+		header('Location: '.$default);
+		exit();
+	}
+}
+//if the image is less than the thumbnail dimensions
+//send the original image as thumbnail
+if ($imgInfo[0] <= $IMConfig['thumbnail_width']
+ && $imgInfo[1] <= $IMConfig['thumbnail_height'])
+ {
+	 header('Location: '.$manager->getFileURL($image));
+	 exit();
+ }
+
+//Check for thumbnails
+$thumbnail = $manager->getThumbName($fullpath);
+if(is_file($thumbnail))
+{
+	//if the thumbnail is newer, send it
+	if(filemtime($thumbnail) >= filemtime($fullpath))
+	{
+		header('Location: '.$manager->getThumbURL($image));
+		exit();
+	}
+}
+
+//creating thumbnails
+$thumbnailer = new Thumbnail($IMConfig['thumbnail_width'],$IMConfig['thumbnail_height']);
+$thumbnailer->createThumbnail($fullpath, $thumbnail);
+
+//Check for NEW thumbnails
+if(is_file($thumbnail))
+{
+	//send the new thumbnail
+	header('Location: '.$manager->getThumbURL($image));
+	exit();
+}
+else
+{
+	//show the default image, otherwise we quit!
+	$default = $manager->getDefaultThumb();
 	if($default)
 		header('Location: '.$default);
 }
-?>
\ Pas de fin de ligne à la fin du fichier.
+?>
