Index: extensions/jiwigo/trunk/pom.xml
===================================================================
--- extensions/jiwigo/trunk/pom.xml	(revision 6830)
+++ extensions/jiwigo/trunk/pom.xml	(revision 6831)
@@ -35,4 +35,9 @@
 	    <version>1.2.16</version>
 	</dependency>
+	<dependency>
+	    <groupId>org.apache.sanselan</groupId>
+	    <artifactId>sanselan</artifactId>
+	    <version>0.97-incubator</version>
+	</dependency>
   </dependencies>
 </project>
Index: extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/dao/CategoryDao.java
===================================================================
--- extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/dao/CategoryDao.java	(revision 6830)
+++ extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/dao/CategoryDao.java	(revision 6831)
@@ -52,8 +52,4 @@
      */
     private static CategoryDao instance;
-    /**
-     * Cache. non utilisé pour le moment
-     */
-    private List<Category> cache;
 
     /**
@@ -81,18 +77,15 @@
      * @throws IOException 
      */
-    public List<Category> lister(boolean rafraichir, boolean recursive) throws IOException {
-	if (cache == null || rafraichir) {
-	    Document doc = Main.sessionManager.executerReturnDocument(MethodsEnum.LISTER_CATEGORIES.getLabel(),
-		    "recursive", String.valueOf(recursive));
-	    Element element = doc.getRootElement().getChild("categories");
-	    List<Element> listElement = (List<Element>) element.getChildren("category");
-	    ArrayList<Category> categories = new ArrayList<Category>();
-	    for (Element cat : listElement) {
-		Category myCat = new Category(cat);
-		categories.add(myCat);
-	    }
-	    this.cache = categories;
+    public List<Category> lister(boolean recursive) throws IOException {
+	Document doc = Main.sessionManager.executerReturnDocument(MethodsEnum.LISTER_CATEGORIES.getLabel(),
+		"recursive", String.valueOf(recursive));
+	Element element = doc.getRootElement().getChild("categories");
+	List<Element> listElement = (List<Element>) element.getChildren("category");
+	ArrayList<Category> categories = new ArrayList<Category>();
+	for (Element cat : listElement) {
+	    Category myCat = new Category(cat);
+	    categories.add(myCat);
 	}
-	return cache;
+	return categories;
     }
 
Index: extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/dao/ImageDao.java
===================================================================
--- extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/dao/ImageDao.java	(revision 6830)
+++ extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/dao/ImageDao.java	(revision 6831)
@@ -14,5 +14,7 @@
 import fr.mael.jiwigo.om.Image;
 import fr.mael.jiwigo.transverse.enumeration.MethodsEnum;
+import fr.mael.jiwigo.transverse.enumeration.PreferencesEnum;
 import fr.mael.jiwigo.transverse.util.Outil;
+import fr.mael.jiwigo.transverse.util.preferences.PreferencesManagement;
 
 /**
@@ -157,4 +159,5 @@
 	//on convertit la miniature en string base64
 	BASE64Encoder base64 = new BASE64Encoder();
+
 	String thumbnailBase64 = base64.encode(Outil.getBytesFromFile(image.getThumbnail()));
 	//on envoie la miniature et on recupere la reponse
@@ -162,10 +165,23 @@
 		thumbnailBase64, "type", "thumb", "position", "1", "original_sum", Outil.getMD5Checksum(image
 			.getOriginale().getAbsolutePath())));
-	//on convertit le fichier original en string base64
-	String originaleBase64 = base64.encode(Outil.getBytesFromFile(image.getOriginale()));
-	//on envoie l'image originale et on recupere la reponse
-	Document reponseOriginale = (Main.sessionManager.executerReturnDocument("pwg.images.addChunk", "data",
-		originaleBase64, "type", "file", "position", "1", "original_sum", Outil.getMD5Checksum(image
-			.getOriginale().getAbsolutePath())));
+
+	//begin feature:0001827
+	Double doubleChunk = Double.parseDouble(PreferencesManagement.getValue(PreferencesEnum.CHUNK_SIZE.getLabel())) * 1000 * 1024;
+	int chunk = doubleChunk.intValue();
+	ArrayList<File> fichiersAEnvoyer = Outil.splitFile(image.getOriginale(), chunk);
+	boolean echec = false;
+	for (int i = 0; i < fichiersAEnvoyer.size(); i++) {
+	    File fichierAEnvoyer = fichiersAEnvoyer.get(i);
+	    String originaleBase64 = base64.encode(Outil.getBytesFromFile(fichierAEnvoyer));
+	    Document reponseOriginale = (Main.sessionManager.executerReturnDocument("pwg.images.addChunk", "data",
+		    originaleBase64, "type", "file", "position", String.valueOf(i), "original_sum", Outil
+			    .getMD5Checksum(image.getOriginale().getAbsolutePath())));
+	    if (!Outil.checkOk(reponseOriginale)) {
+		echec = true;
+		break;
+	    }
+	}
+	//end
+
 	//on ajoute l'image en base et on recupere la reponse
 	Document reponseAjout = (Main.sessionManager.executerReturnDocument("pwg.images.add", "file_sum", Outil
@@ -173,8 +189,12 @@
 		.getThumbnail().getCanonicalPath()), "position", "1", "original_sum", Outil.getMD5Checksum(image
 		.getOriginale().getAbsolutePath()), "categories", String.valueOf(image.getIdCategory()), "name", image
-		.getName(), "author", image.getAuteur()));
-
+		.getName(), "author", Main.sessionManager.getLogin()));
+	//	System.out.println(Main.sessionManager.executerReturnString("pwg.images.add", "file_sum", Outil
+	//		.getMD5Checksum(image.getOriginale().getAbsolutePath()), "thumbnail_sum", Outil.getMD5Checksum(image
+	//		.getThumbnail().getCanonicalPath()), "position", "1", "original_sum", Outil.getMD5Checksum(image
+	//		.getOriginale().getAbsolutePath()), "categories", String.valueOf(image.getIdCategory()), "name", image
+	//		.getName(), "author", Main.sessionManager.getLogin()));
 	boolean reussite = true;
-	if (!Outil.checkOk(reponseThumb) || !Outil.checkOk(reponseOriginale) || !Outil.checkOk(reponseAjout)) {
+	if (!Outil.checkOk(reponseThumb) || echec || !Outil.checkOk(reponseAjout)) {
 	    reussite = false;
 	}
Index: extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/service/CategoryService.java
===================================================================
--- extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/service/CategoryService.java	(revision 6830)
+++ extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/service/CategoryService.java	(revision 6831)
@@ -73,6 +73,6 @@
      * @throws IOException 
      */
-    public List<Category> lister(boolean rafraichir, boolean recursive) throws IOException {
-	return CategoryDao.getInstance().lister(rafraichir, recursive);
+    public List<Category> lister(boolean recursive) throws IOException {
+	return CategoryDao.getInstance().lister(recursive);
     }
 
@@ -84,5 +84,5 @@
      */
     public List<Category> construireArbre() throws IOException {
-	List<Category> list = CategoryDao.getInstance().lister(false, true);
+	List<Category> list = CategoryDao.getInstance().lister(true);
 	for (Category category : list) {
 	    for (Category category2 : list) {
Index: extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/service/ImageService.java
===================================================================
--- extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/service/ImageService.java	(revision 6830)
+++ extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/service/ImageService.java	(revision 6831)
@@ -5,10 +5,9 @@
 import java.util.List;
 
-import fr.mael.jiwigo.Main;
 import fr.mael.jiwigo.dao.ImageDao;
 import fr.mael.jiwigo.om.Image;
 import fr.mael.jiwigo.transverse.enumeration.PreferencesEnum;
 import fr.mael.jiwigo.transverse.util.ImagesUtil;
-import fr.mael.jiwigo.transverse.util.MetadataExtractor;
+import fr.mael.jiwigo.transverse.util.Outil;
 import fr.mael.jiwigo.transverse.util.preferences.PreferencesManagement;
 
@@ -67,22 +66,43 @@
     }
 
+    /**
+     * Method called to send an image to the server.
+     
+     * @param filePath
+     * @param idCategory
+     * @return
+     * @throws Exception
+     */
     public boolean creer(String filePath, Integer idCategory) throws Exception {
+	//get the byte array of the original file, to keep metadata
+	byte[] bytesFichierOriginal = Outil.getBytesFromFile(new File(filePath));
+
+	//size taken from the user's preferences
 	int widthOriginale = Integer
 		.valueOf(PreferencesManagement.getValue(PreferencesEnum.WIDTH_ORIGINALE.getLabel()));
 	int heightOriginale = Integer.valueOf(PreferencesManagement
 		.getValue(PreferencesEnum.HEIGHT_ORIGINAL.getLabel()));
+	//resize the picture (or not)
 	boolean originaleRedimensionnee = ImagesUtil.scale(filePath, "originale.jpg", widthOriginale, heightOriginale);
+	//create the thumbnail
 	ImagesUtil.scale(filePath, "thumb.jpg", 120, 90);
+	//get the thumbnail
 	File thumbnail = new File(System.getProperty("java.io.tmpdir") + "/thumb.jpg");
 	File originale = null;
 	if (originaleRedimensionnee) {
 	    originale = new File(System.getProperty("java.io.tmpdir") + "/originale.jpg");
+	    //if the original file has been resized, we put the metadata in the resized file
+	    //I use here a try catch because if the original file isn't a jpeg
+	    //the methode Outil.enrich will fail, but the procedure has to continue
+	    try {
+		byte[] fichierEnrichi = Outil.enrich(bytesFichierOriginal, Outil.getBytesFromFile(new File(System
+			.getProperty("java.io.tmpdir")
+			+ "/originale.jpg")));
+		Outil.byteToFile(System.getProperty("java.io.tmpdir") + "/originale.jpg", fichierEnrichi);
+	    } catch (Exception e) {
+	    }
 	} else {
 	    originale = new File(filePath);
-	}
-	MetadataExtractor medataExtractor = new MetadataExtractor(originale.getAbsolutePath());
-	String auteur = medataExtractor.getAuteur();
-	if (auteur == null) {
-	    auteur = Main.sessionManager.getLogin();
+
 	}
 	Image image = new Image();
@@ -90,9 +110,14 @@
 	image.setThumbnail(thumbnail);
 	image.setOriginale(originale);
-	image.setAuteur(auteur);
 	image.setIdCategory(idCategory);
+	//now we call the dao to send the image to the webservice
 	return ImageDao.getInstance().creer(image);
     }
 
+    /**
+     * Deletes the file extension
+     * @param path
+     * @return
+     */
     private String getImageName(String path) {
 	File fichier = new File(path);
Index: extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/session/SessionManager.java
===================================================================
--- extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/session/SessionManager.java	(revision 6830)
+++ extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/session/SessionManager.java	(revision 6831)
@@ -119,4 +119,8 @@
 	    method.addParameter(parametres[i], parametres[i + 1]);
 	}
+	//begin bug:0001833
+	method.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
+	//end
+
 	try {
 	    client.executeMethod(method);
Index: extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/util/MetadataExtractor.java
===================================================================
--- extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/util/MetadataExtractor.java	(revision 6830)
+++ 	(revision )
@@ -1,76 +1,0 @@
-package fr.mael.jiwigo.transverse.util;
-
-import java.io.File;
-
-import com.drew.imaging.jpeg.JpegMetadataReader;
-import com.drew.imaging.jpeg.JpegProcessingException;
-import com.drew.metadata.Directory;
-import com.drew.metadata.Metadata;
-import com.drew.metadata.exif.ExifDirectory;
-
-/**
-   Copyright (c) 2010, Mael
-   All rights reserved.
-
-   Redistribution and use in source and binary forms, with or without
-   modification, are permitted provided that the following conditions are met:
-    * Redistributions of source code must retain the above copyright
-      notice, this list of conditions and the following disclaimer.
-    * Redistributions in binary form must reproduce the above copyright
-      notice, this list of conditions and the following disclaimer in the
-      documentation and/or other materials provided with the distribution.
-    * Neither the name of jiwigo nor the
-      names of its contributors may be used to endorse or promote products
-      derived from this software without specific prior written permission.
-
-   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-   ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-   DISCLAIMED. IN NO EVENT SHALL Mael BE LIABLE FOR ANY
-   DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-   LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-   ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-   
- * @author mael
- * Classe d'extraction des metadonnees exif d'une image
- */
-public class MetadataExtractor {
-    /**
-     * Logger
-     */
-    public static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory
-	    .getLog(MetadataExtractor.class);
-    private String filePath;
-    private String auteur;
-
-    public MetadataExtractor(String filePath) {
-	this.filePath = filePath;
-	File jpegFile = new File(filePath);
-	try {
-	    Metadata metadata = JpegMetadataReader.readMetadata(jpegFile);
-	    Directory exifdir = metadata.getDirectory(ExifDirectory.class);
-	    //	    Directory iptcdir = metadata.getDirectory(IptcDirectory.class);
-	    String winauthor = exifdir.getString(ExifDirectory.TAG_WIN_AUTHOR);
-	    String artist = exifdir.getString(ExifDirectory.TAG_ARTIST);
-	    //String iptcauthor = iptcdir.getString(IptcDirectory.TAG_WRITER);
-	    if (winauthor != null) {
-		this.auteur = winauthor;
-	    }
-	    if (artist != null) {
-		this.auteur = artist;
-	    }
-	} catch (JpegProcessingException e) {
-	}
-    }
-
-    /**
-     * @return the auteur
-     */
-    public String getAuteur() {
-	return auteur;
-    }
-
-}
Index: extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/util/MetadataUtil.java
===================================================================
--- extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/util/MetadataUtil.java	(revision 6831)
+++ extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/util/MetadataUtil.java	(revision 6831)
@@ -0,0 +1,224 @@
+package fr.mael.jiwigo.transverse.util;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.Iterator;
+
+import com.drew.imaging.jpeg.JpegMetadataReader;
+import com.drew.imaging.jpeg.JpegProcessingException;
+import com.drew.metadata.Directory;
+import com.drew.metadata.Metadata;
+import com.drew.metadata.MetadataException;
+import com.drew.metadata.Tag;
+
+public class MetadataUtil {
+    public static HashMap<Integer, String> getIptcMap() {
+	HashMap<Integer, String> tagNameMap = new HashMap<Integer, String>();
+	//	tagNameMap.put(new Integer(512), "Directory Version");
+	tagNameMap.put(new Integer(632), "iptc_Caption_Abstract");
+	tagNameMap.put(new Integer(634), "iptc_Writer_Editor");
+	tagNameMap.put(new Integer(617), "iptc_Headline");
+	tagNameMap.put(new Integer(552), "iptc_Special_Instructions");
+	tagNameMap.put(new Integer(592), "iptc_By_line");
+	tagNameMap.put(new Integer(597), "iptc_By_line_Title");
+	tagNameMap.put(new Integer(622), "iptc_Credit");
+	tagNameMap.put(new Integer(627), "iptc_Source");
+	tagNameMap.put(new Integer(517), "iptc_Object");
+	tagNameMap.put(new Integer(567), "iptc_Date_Created");
+	tagNameMap.put(new Integer(602), "iptc_City");
+	tagNameMap.put(new Integer(607), "iptc_Province_State");
+	tagNameMap.put(new Integer(613), "iptc_Country_Primary_Location_Code");
+	tagNameMap.put(new Integer(615), "iptc_Original_Transmission_Reference");
+	tagNameMap.put(new Integer(527), "iptc_Category");
+	tagNameMap.put(new Integer(532), "iptc_Supplemental_Category");
+	tagNameMap.put(new Integer(522), "iptc_Urgency");
+	tagNameMap.put(new Integer(537), "iptc_Keywords");
+	tagNameMap.put(new Integer(628), "iptc_Copyright_Notice");
+	tagNameMap.put(new Integer(542), "iptc_Release_Date");
+	tagNameMap.put(new Integer(547), "iptc_Release_Time");
+	tagNameMap.put(new Integer(572), "iptc_Time_Created");
+	tagNameMap.put(new Integer(577), "iptc_Originating_Program");
+	return tagNameMap;
+    }
+
+    public static HashMap<Integer, String> getExifMap() {
+	HashMap<Integer, String> tagNameMap = new HashMap<Integer, String>();
+	tagNameMap.put(new Integer(266), "exif_field_FillOrder");
+	tagNameMap.put(new Integer(269), "exif_field_DocumentName");
+	tagNameMap.put(new Integer(4096), "exif_field_RelatedImageFileFormat");
+	tagNameMap.put(new Integer(4097), "exif_field_RelatedImageWidth");
+	tagNameMap.put(new Integer(4098), "exif_field_RelatedImageLength");
+	tagNameMap.put(new Integer(342), "exif_field_TransferRange");
+	tagNameMap.put(new Integer(512), "exif_field_JPEGProc");
+	tagNameMap.put(new Integer(34665), "exif_field_ExifOffset");
+	tagNameMap.put(new Integer(37122), "exif_field_CompressedBitsPerPixel");
+	//	tagNameMap.put(new Integer(37500), "Maker Note");
+	tagNameMap.put(new Integer(40965), "exif_field_InteropOffset");
+	//	tagNameMap.put(new Integer(254), "New Subfile Type");
+	tagNameMap.put(new Integer(255), "exif_field_SubfileType");
+	//	tagNameMap.put(new Integer(256), "Thumbnail Image Width");
+	//	tagNameMap.put(new Integer(257), "Thumbnail Image Height");
+	tagNameMap.put(new Integer(258), "exif_field_BitsPerSample");
+	tagNameMap.put(new Integer(259), "exif_field_Compression");
+	tagNameMap.put(new Integer(262), "exif_field_PhotometricInterpretation");
+	tagNameMap.put(new Integer(263), "exif_field_Thresholding");
+	tagNameMap.put(new Integer(270), "exif_field_ImageDescription");
+	tagNameMap.put(new Integer(271), "exif_field_Make");
+	tagNameMap.put(new Integer(272), "exif_field_Model");
+	tagNameMap.put(new Integer(273), "exif_field_StripOffsets");
+	tagNameMap.put(new Integer(274), "exif_field_Orientation");
+	tagNameMap.put(new Integer(277), "exif_field_SamplesPerPixel");
+	tagNameMap.put(new Integer(278), "exif_field_RowsPerStrip");
+	tagNameMap.put(new Integer(279), "exif_field_StripByteCounts");
+	tagNameMap.put(new Integer(282), "exif_field_XResolution");
+	tagNameMap.put(new Integer(283), "exif_field_YResolution");
+	tagNameMap.put(new Integer(285), "exif_field_PageName");
+	tagNameMap.put(new Integer(284), "exif_field_PlanarConfiguration");
+	tagNameMap.put(new Integer(296), "exif_field_ResolutionUnit");
+	tagNameMap.put(new Integer(301), "exif_field_TransferFunction");
+	tagNameMap.put(new Integer(305), "exif_field_Software");
+	tagNameMap.put(new Integer(306), "exif_field_TakenDate");
+	tagNameMap.put(new Integer(315), "exif_field_Artist");
+	tagNameMap.put(new Integer(317), "exif_field_Predictor");
+	tagNameMap.put(new Integer(318), "exif_field_WhitePoint");
+	tagNameMap.put(new Integer(319), "exif_field_PrimaryChromaticities");
+	tagNameMap.put(new Integer(322), "exif_field_TileWidth");
+	tagNameMap.put(new Integer(323), "exif_field_TileLength");
+	tagNameMap.put(new Integer(324), "exif_field_TileOffsets");
+	tagNameMap.put(new Integer(325), "exif_field_TileByteCounts");
+	tagNameMap.put(new Integer(330), "exif_field_SubIFD");
+	tagNameMap.put(new Integer(347), "exif_field_JPEGTables");
+	tagNameMap.put(new Integer(513), "exif_field_ThumbnailOffset");
+	tagNameMap.put(new Integer(514), "exif_field_ThumbnailLength");
+	//	tagNameMap.put(new Integer(61441), "Thumbnail Data");
+	tagNameMap.put(new Integer(529), "exif_field_YCbCrCoefficients");
+	tagNameMap.put(new Integer(530), "exif_field_YCbCrSubSampling");
+	tagNameMap.put(new Integer(531), "exif_field_YCbCrPositioning");
+	tagNameMap.put(new Integer(532), "exif_field_ReferenceBlackWhite");
+	tagNameMap.put(new Integer(33421), "exif_field_CFARepeatPatternDim");
+	tagNameMap.put(new Integer(33422), "exif_field_CFAPattern2");
+	tagNameMap.put(new Integer(33423), "exif_field_BatteryLevel");
+	tagNameMap.put(new Integer(33432), "exif_field_Copyright");
+	tagNameMap.put(new Integer(33434), "exif_field_ExposureTime");
+	tagNameMap.put(new Integer(33437), "exif_field_FNumber");
+	tagNameMap.put(new Integer(33723), "exif_field_IPTC-NAA");
+	tagNameMap.put(new Integer(34675), "exif_field_ICC_Profile");
+	tagNameMap.put(new Integer(34850), "exif_field_ExposureProgram");
+	tagNameMap.put(new Integer(34852), "exif_field_SpectralSensitivity");
+	tagNameMap.put(new Integer(34853), "exif_field_GPSInfo");
+	tagNameMap.put(new Integer(34855), "exif_field_ISOSpeedRatings");
+	tagNameMap.put(new Integer(34856), "exif_field_Opto-ElectricConvFactor");
+	tagNameMap.put(new Integer(34857), "exif_field_Interlace");
+	tagNameMap.put(new Integer(34858), "exif_field_TimeZoneOffset");
+	tagNameMap.put(new Integer(34859), "exif_field_SelfTimer");
+	tagNameMap.put(new Integer(36864), "exif_field_ExifVersion");
+	tagNameMap.put(new Integer(36867), "exif_field_DateTimeOriginal");
+	//	tagNameMap.put(new Integer(36868), "Date/Time Digitized");
+	tagNameMap.put(new Integer(37121), "exif_field_ComponentsConfiguration");
+	tagNameMap.put(new Integer(37377), "exif_field_ShutterSpeedValue");
+	tagNameMap.put(new Integer(37378), "exif_field_ApertureValue");
+	tagNameMap.put(new Integer(37379), "exif_field_BrightnessValue");
+	tagNameMap.put(new Integer(37380), "exif_field_ExposureBiasValue");
+	tagNameMap.put(new Integer(37381), "exif_field_MaxApertureValue");
+	tagNameMap.put(new Integer(37382), "exif_field_SubjectDistance");
+	tagNameMap.put(new Integer(37383), "exif_field_MeteringMode");
+	tagNameMap.put(new Integer(37384), "exif_field_LightSource");
+	tagNameMap.put(new Integer(37385), "exif_field_Flash");
+	tagNameMap.put(new Integer(37386), "exif_field_FocalLength");
+	tagNameMap.put(new Integer(37387), "exif_field_FlashActivity");
+	tagNameMap.put(new Integer(37388), "exif_field_SpatialFrequencyResponse");
+	tagNameMap.put(new Integer(37389), "exif_field_Noise");
+	tagNameMap.put(new Integer(37393), "exif_field_ImageNumber");
+	tagNameMap.put(new Integer(37394), "exif_field_SecurityClassification");
+	tagNameMap.put(new Integer(37395), "exif_field_ImageHistory");
+	tagNameMap.put(new Integer(37396), "exif_field_SubjectLocation");
+	tagNameMap.put(new Integer(41493), "exif_field_ExposureIndex");
+	tagNameMap.put(new Integer(37398), "exif_field_TIFF-EPStandardID");
+	tagNameMap.put(new Integer(37510), "exif_field_UserComment");
+	tagNameMap.put(new Integer(37520), "exif_field_SubSecTime");
+	tagNameMap.put(new Integer(37521), "exif_field_SubSecTimeOriginal");
+	tagNameMap.put(new Integer(37522), "exif_field_SubSecTimeDigitized");
+	tagNameMap.put(new Integer(40960), "exif_field_FlashpixVersion");
+	tagNameMap.put(new Integer(40961), "exif_field_ColorSpace");
+	tagNameMap.put(new Integer(40962), "exif_field_ExifImageWidth");
+	//	tagNameMap.put(new Integer(40963), "Exif Image Height");
+	tagNameMap.put(new Integer(40964), "exif_field_RelatedSoundFile");
+	tagNameMap.put(new Integer(41483), "exif_field_FlashEnergy");
+	tagNameMap.put(new Integer(41484), "exif_field_SpatialFrequencyResponse");
+	tagNameMap.put(new Integer(41486), "exif_field_FocalPlaneXResolution");
+	tagNameMap.put(new Integer(41487), "exif_field_FocalPlaneYResolution");
+	tagNameMap.put(new Integer(41488), "exif_field_FocalPlaneResolutionUnit");
+	tagNameMap.put(new Integer(41492), "exif_field_SubjectLocation");
+	tagNameMap.put(new Integer(37397), "exif_field_ExposureIndex");
+	tagNameMap.put(new Integer(41495), "exif_field_SensingMethod");
+	tagNameMap.put(new Integer(41728), "exif_field_FileSource");
+	tagNameMap.put(new Integer(41729), "exif_field_SceneType");
+	tagNameMap.put(new Integer(41730), "exif_field_CFAPattern");
+	tagNameMap.put(new Integer(41985), "exif_field_CustomRendered");
+	tagNameMap.put(new Integer(41986), "exif_field_ExposureMode");
+	tagNameMap.put(new Integer(41987), "exif_field_WhiteBalance");
+	tagNameMap.put(new Integer(41988), "exif_field_DigitalZoomRatio");
+	tagNameMap.put(new Integer(41989), "exif_field_FocalLengthIn35mmFormat");
+	tagNameMap.put(new Integer(41990), "exif_field_SceneCaptureType");
+	tagNameMap.put(new Integer(41991), "exif_field_GainControl");
+	tagNameMap.put(new Integer(41992), "exif_field_Contrast");
+	tagNameMap.put(new Integer(41993), "exif_field_Saturation");
+	tagNameMap.put(new Integer(41994), "exif_field_Sharpness");
+	tagNameMap.put(new Integer(41995), "exif_field_DeviceSettingDescription");
+	tagNameMap.put(new Integer(41996), "exif_field_SubjectDistanceRange");
+	//	tagNameMap.put(new Integer(40093), "Windows XP Author");
+	//	tagNameMap.put(new Integer(40092), "Windows XP Comment");
+	//	tagNameMap.put(new Integer(40094), "Windows XP Keywords");
+	//	tagNameMap.put(new Integer(40095), "Windows XP Subject");
+	//	tagNameMap.put(new Integer(40091), "Windows XP Title");
+	tagNameMap.put(new Integer(280), "exif_field_MinSampleValue");
+	tagNameMap.put(new Integer(281), "exif_field_MaxSampleValue");
+	return tagNameMap;
+    }
+
+    public static HashMap<String, String> getTagsHashMap(String fichier) throws JpegProcessingException,
+	    MetadataException {
+	File jpegFile = new File(fichier);
+	Metadata metadata = JpegMetadataReader.readMetadata(jpegFile);
+	Iterator directories = metadata.getDirectoryIterator();
+	HashMap<String, String> mapTags = new HashMap<String, String>();
+	while (directories.hasNext()) {
+	    Directory directory = (Directory) directories.next();
+	    Iterator tags = directory.getTagIterator();
+	    if (directory.getName().equals("Exif") || directory.getName().equals("Iptc")) {
+		while (tags.hasNext()) {
+		    Tag tag = (Tag) tags.next();
+		    if (tag.getDirectoryName().equals("Exif")) {
+			for (Integer key : MetadataUtil.getExifMap().keySet()) {
+			    if (tag.getTagType() == key) {
+				mapTags.put(MetadataUtil.getExifMap().get(key), tag.getDescription());
+			    }
+			}
+		    } else {
+			for (Integer key : MetadataUtil.getIptcMap().keySet()) {
+			    if (tag.getTagType() == key) {
+				mapTags.put(MetadataUtil.getIptcMap().get(key), tag.getDescription());
+			    }
+			}
+		    }
+		}
+	    }
+	}
+	return mapTags;
+    }
+
+    public static void main(String[] args) {
+	try {
+	    HashMap<String, String> map = getTagsHashMap("/home/mael/Images/exif.JPG");
+	    for (String key : getTagsHashMap("/home/mael/Images/exif.JPG").keySet()) {
+		System.out.println(key + " -> " + map.get(key));
+	    }
+	} catch (JpegProcessingException e) {
+	    // TODO Auto-generated catch block
+	    e.printStackTrace();
+	} catch (MetadataException e) {
+	    // TODO Auto-generated catch block
+	    e.printStackTrace();
+	}
+    }
+}
Index: extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/util/Outil.java
===================================================================
--- extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/util/Outil.java	(revision 6830)
+++ extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/util/Outil.java	(revision 6831)
@@ -2,7 +2,10 @@
 
 import java.io.BufferedInputStream;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
 import java.io.DataInputStream;
 import java.io.File;
 import java.io.FileInputStream;
+import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
@@ -14,5 +17,14 @@
 import java.net.URLClassLoader;
 import java.security.MessageDigest;
-
+import java.util.ArrayList;
+
+import org.apache.sanselan.Sanselan;
+import org.apache.sanselan.common.IImageMetadata;
+import org.apache.sanselan.formats.jpeg.JpegImageMetadata;
+import org.apache.sanselan.formats.jpeg.JpegPhotoshopMetadata;
+import org.apache.sanselan.formats.jpeg.exifRewrite.ExifRewriter;
+import org.apache.sanselan.formats.jpeg.iptc.JpegIptcRewriter;
+import org.apache.sanselan.formats.jpeg.iptc.PhotoshopApp13Data;
+import org.apache.sanselan.formats.tiff.write.TiffOutputSet;
 import org.jdom.Document;
 import org.jdom.JDOMException;
@@ -209,3 +221,76 @@
 	return result.toString();
     }
+
+    /**
+     * Function that splits a file 
+     * @param fichier the file to split
+     * @param size the size of the resulting chunks
+     * @return the list of files
+     * @throws IOException
+     */
+    //feature:0001827
+    public static ArrayList<File> splitFile(File fichier, int size) throws IOException {
+	FileInputStream fis = new FileInputStream(fichier);
+	byte buffer[] = new byte[size];
+	ArrayList<File> listFichiers = new ArrayList<File>();
+	int count = 0;
+	while (true) {
+	    int i = fis.read(buffer, 0, size);
+	    if (i == -1)
+		break;
+	    File file = new File(System.getProperty("java.io.tmpdir") + "/tempcut" + count);
+	    listFichiers.add(file);
+	    FileOutputStream fos = new FileOutputStream(file);
+	    fos.write(buffer, 0, i);
+	    fos.flush();
+	    fos.close();
+
+	    ++count;
+	}
+	return listFichiers;
+    }
+
+    /**
+     * Function used to put the exif and iptc metadata from one image to another
+     * @param enriched original image where the metadata comes from
+     * @param naked image where to put metadata
+     * @return enriched image
+     * @throws Exception
+     */
+    public static byte[] enrich(byte[] enriched, byte[] naked) throws Exception {
+
+	// read IPTC metadata from the original enriched image
+	IImageMetadata metadata = Sanselan.getMetadata(enriched);
+	JpegImageMetadata jpegMetadata = (JpegImageMetadata) metadata;
+	JpegPhotoshopMetadata photoshopMetadata = jpegMetadata.getPhotoshop();
+	if (photoshopMetadata == null) {
+	    return naked;
+	}
+
+	PhotoshopApp13Data data = photoshopMetadata.photoshopApp13Data;
+
+	// read the EXIF metadata from the parsed JPEG metadata
+	TiffOutputSet outputSet = jpegMetadata.getExif().getOutputSet();
+
+	// enrich the naked byte[] with EXIF metadata
+	ExifRewriter writer = new ExifRewriter();
+	ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+	writer.updateExifMetadataLossless(naked, outputStream, outputSet);
+
+	// enrich the partially clothed byte[] with IPTC metadata
+	InputStream src = new ByteArrayInputStream(outputStream.toByteArray());
+	ByteArrayOutputStream dest = new ByteArrayOutputStream();
+	new JpegIptcRewriter().writeIPTC(src, dest, data);
+
+	// return the fully clothed image as a byte[]
+	return dest.toByteArray();
+    }
+
+    public static void byteToFile(String fichier, byte[] bytes) throws IOException {
+	FileOutputStream fos = new FileOutputStream(fichier);
+	fos.write(bytes);
+	fos.flush();
+	fos.close();
+
+    }
 }
Index: extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/browser/BrowserFrame.java
===================================================================
--- extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/browser/BrowserFrame.java	(revision 6831)
+++ extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/browser/BrowserFrame.java	(revision 6831)
@@ -0,0 +1,374 @@
+package fr.mael.jiwigo.ui.browser;
+
+import java.awt.AWTEvent;
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.Toolkit;
+import java.awt.event.AWTEventListener;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyEvent;
+import java.awt.image.BufferedImage;
+import java.awt.print.PrinterException;
+import java.awt.print.PrinterJob;
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+
+import javax.imageio.ImageIO;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JFileChooser;
+import javax.swing.JFrame;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JPanel;
+import javax.swing.JRootPane;
+import javax.swing.JScrollPane;
+
+import fr.mael.jiwigo.om.Image;
+import fr.mael.jiwigo.transverse.util.ImagesUtil;
+import fr.mael.jiwigo.transverse.util.Messages;
+import fr.mael.jiwigo.transverse.util.Outil;
+import fr.mael.jiwigo.ui.ImagesManagement;
+import fr.mael.jiwigo.ui.comments.CommentsDialog;
+
+/**
+ *    
+   Copyright (c) 2010, Mael
+   All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions are met:
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+    * Neither the name of jiwigo nor the
+      names of its contributors may be used to endorse or promote products
+      derived from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+   ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+   DISCLAIMED. IN NO EVENT SHALL Mael BE LIABLE FOR ANY
+   DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+   LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+   ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+   
+ * @author mael
+ * 
+ * Frame de navigation dans les images
+ *
+ */
+public class BrowserFrame extends JFrame implements ActionListener {
+    /**
+     * Logger
+     */
+    public static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory
+	    .getLog(BrowserFrame.class);
+    /**
+     * bouton pour passer à l'image suivante
+     */
+    private JButton next = new JButton();
+    /**
+     * bouton pour passer à l'image précédente
+     */
+    private JButton previous = new JButton();
+    /**
+     * rotation de l'image vers la gauche
+     */
+    private JButton rotateLeft = new JButton();
+    /**
+     * rotation de l'image vers la droite
+     */
+    private JButton rotateRight = new JButton();
+    /**
+     * sauvegarde de l'image
+     */
+    private JButton save = new JButton();
+    /**
+     * affichage des commentaire de l'image
+     */
+    private JButton comment = new JButton();
+    /**
+     * panel contenant tous les boutons précédents
+     */
+    private JPanel panelBoutons;
+
+    /**
+     * Panel qui contient l'image
+     */
+    private BrowserImagePanel imagePanel;
+
+    /**
+     * Menus
+     */
+    private JMenuBar menuBar;
+    private JMenu menuFichier, menuAffichage, menuImage;
+    private JMenuItem menuItemSave, menuItemPrint, menuItemClose, menuItemZoomPlus;
+    private JMenuItem menuItemZoomMoins, menuItemNormal, menuItemFlipH, menuItemFlipV;
+    private JMenuItem menuItemRotationG, menuItemRotationD;
+
+    /**
+     * Listener général. Permet d'ajouter les écouteurs sur les touches
+     * pour la navigation entres les différentes images grace aux touches
+     * droite et gauche.
+     * Je n'ai pas trouvé mieux que de faire ce listener général.
+     * Il est instancié et ajouté à la création de la frame, et retiré lorsqu'on la quitte
+     */
+    private AWTEventListener generalListener;
+
+    public BrowserFrame(Image image) {
+	this.setIconImage(java.awt.Toolkit.getDefaultToolkit().getImage(Outil.getURL("fr/mael/jiwigo/img/icon.png")));
+	this.setTitle(Messages.getMessage("titleBrowser"));
+	panelBoutons = new JPanel(new FlowLayout());
+	//ajout des images sur les boutons
+	next.setIcon(new ImageIcon(Outil.getURL("fr/mael/jiwigo/img/next.png")));
+	previous.setIcon(new ImageIcon(Outil.getURL("fr/mael/jiwigo/img/previous.png")));
+	rotateLeft.setIcon(new ImageIcon(Outil.getURL("fr/mael/jiwigo/img/left.png")));
+	rotateRight.setIcon(new ImageIcon(Outil.getURL("fr/mael/jiwigo/img/right.png")));
+	save.setIcon(new ImageIcon(Outil.getURL("fr/mael/jiwigo/img/save.png")));
+	comment.setIcon(new ImageIcon(Outil.getURL("fr/mael/jiwigo/img/comment.png")));
+	//on rend les boutons invisibles, pour ne voir que l'image
+	next.setFocusPainted(false);
+	next.setBorderPainted(false);
+	next.setContentAreaFilled(false);
+	previous.setFocusPainted(false);
+	previous.setBorderPainted(false);
+	previous.setContentAreaFilled(false);
+	rotateLeft.setFocusPainted(false);
+	rotateLeft.setBorderPainted(false);
+	rotateLeft.setContentAreaFilled(false);
+	rotateRight.setFocusPainted(false);
+	rotateRight.setBorderPainted(false);
+	rotateRight.setContentAreaFilled(false);
+	save.setFocusPainted(false);
+	save.setBorderPainted(false);
+	save.setContentAreaFilled(false);
+	comment.setFocusPainted(false);
+	comment.setBorderPainted(false);
+	comment.setContentAreaFilled(false);
+	//ajout des action listeners
+	comment.addActionListener(this);
+	save.addActionListener(this);
+	rotateRight.addActionListener(this);
+	rotateLeft.addActionListener(this);
+	previous.addActionListener(this);
+	next.addActionListener(this);
+	//ajout des boutons
+	panelBoutons.add(previous);
+	panelBoutons.add(next);
+	panelBoutons.add(rotateLeft);
+	panelBoutons.add(rotateRight);
+	panelBoutons.add(save);
+	panelBoutons.add(comment);
+
+	BufferedImage img;
+	try {
+	    img = ImageIO.read(new URL(ImagesManagement.getCurrentImage().getUrl()));
+	    imagePanel = new BrowserImagePanel(img);
+	} catch (Exception e1) {
+	    LOG.error(Outil.getStackTrace(e1));
+	}
+
+	this.getContentPane().setLayout(new BorderLayout());
+	JScrollPane scrollpane = new JScrollPane(imagePanel);
+	Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
+	this.getRootPane().setWindowDecorationStyle(JRootPane.PLAIN_DIALOG);
+	this.setExtendedState(getExtendedState() | JFrame.MAXIMIZED_BOTH);
+	//	this.setExtendedState(JFrame.ICONIFIED | this.getExtendedState());
+	panelBoutons.add(imagePanel.getSlider());
+	imagePanel.setLayout(new BorderLayout());
+	panelBoutons.setOpaque(false);
+	this.add(scrollpane, BorderLayout.CENTER);
+	this.add(panelBoutons, BorderLayout.SOUTH);
+
+	this.setSize(screenSize);
+	this.setLocationRelativeTo(null);
+	this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
+	setUpMenu();
+	//instanciation du listener general
+	this.generalListener = new AWTEventListener() {
+
+	    public void eventDispatched(AWTEvent event) {
+		KeyEvent ke = (KeyEvent) event;
+		if (ke.getID() == KeyEvent.KEY_PRESSED) {
+		    if (ke.getKeyCode() == KeyEvent.VK_RIGHT) {
+			next.doClick();
+		    } else if (ke.getKeyCode() == KeyEvent.VK_LEFT) {
+			previous.doClick();
+		    }
+		}
+	    }
+	};
+	this.setVisible(true);
+
+	//ajout du listener general
+	//Toolkit.getDefaultToolkit().addAWTEventListener(generalListener, AWTEvent.KEY_EVENT_MASK);
+
+    }
+
+    private void setUpMenu() {
+	menuBar = new JMenuBar();
+
+	menuBar = new JMenuBar();
+	menuFichier = new JMenu(Messages.getMessage("imageBrowser_file"));
+	menuAffichage = new JMenu(Messages.getMessage("imageBrowser_display"));
+	menuImage = new JMenu(Messages.getMessage("imageBrowser_image"));
+	menuBar.add(menuFichier);
+	menuBar.add(menuAffichage);
+	menuBar.add(menuImage);
+	menuItemSave = new JMenuItem(Messages.getMessage("imageBrowser_save"), new ImageIcon(Outil
+		.getURL("fr/mael/jiwigo/img/save_mini.png")));
+	menuItemPrint = new JMenuItem(Messages.getMessage("imageBrowser_print"), new ImageIcon(Outil
+		.getURL("fr/mael/jiwigo/img/print.gif")));
+	menuItemClose = new JMenuItem(Messages.getMessage("imageBrowser_close"), new ImageIcon(Outil
+		.getURL("fr/mael/jiwigo/img/close.png")));
+	menuItemZoomPlus = new JMenuItem(Messages.getMessage("imageBrowser_zoomPlus"), new ImageIcon(Outil
+		.getURL("fr/mael/jiwigo/img/zoom_in.png")));
+	menuItemZoomMoins = new JMenuItem(Messages.getMessage("imageBrowser_zoomMoins"), new ImageIcon(Outil
+		.getURL("fr/mael/jiwigo/img/zoom_out.png")));
+	menuItemNormal = new JMenuItem(Messages.getMessage("imageBrowser_zoomNormal"), new ImageIcon(Outil
+		.getURL("fr/mael/jiwigo/img/zoom_n.png")));
+	menuItemFlipH = new JMenuItem(Messages.getMessage("imageBrowser_flipH"), new ImageIcon(Outil
+		.getURL("fr/mael/jiwigo/img/flip_h.png")));
+	menuItemFlipV = new JMenuItem(Messages.getMessage("imageBrowser_flipV"), new ImageIcon(Outil
+		.getURL("fr/mael/jiwigo/img/flip_v.png")));
+	menuItemRotationG = new JMenuItem(Messages.getMessage("imageBrowser_rotationL"), new ImageIcon(Outil
+		.getURL("fr/mael/jiwigo/img/left.png")));
+	menuItemRotationD = new JMenuItem(Messages.getMessage("imageBrowser_rotationR"), new ImageIcon(Outil
+		.getURL("fr/mael/jiwigo/img/right.png")));
+	menuFichier.add(menuItemSave);
+	menuFichier.addSeparator();
+	menuFichier.add(menuItemPrint);
+	menuFichier.addSeparator();
+	menuFichier.add(menuItemClose);
+	menuAffichage.add(menuItemZoomMoins);
+	menuAffichage.add(menuItemNormal);
+	menuAffichage.add(menuItemZoomPlus);
+	menuImage.add(menuItemFlipH);
+	menuImage.add(menuItemFlipV);
+	menuImage.addSeparator();
+	menuImage.add(menuItemRotationG);
+	menuImage.add(menuItemRotationD);
+	menuBar.add(menuFichier);
+	menuBar.add(menuAffichage);
+	menuBar.add(menuImage);
+	menuItemSave.addActionListener(this);
+	menuItemPrint.addActionListener(this);
+	menuItemClose.addActionListener(this);
+	menuItemZoomPlus.addActionListener(this);
+	menuItemZoomMoins.addActionListener(this);
+	menuItemNormal.addActionListener(this);
+	menuItemFlipH.addActionListener(this);
+	menuItemFlipV.addActionListener(this);
+	menuItemRotationG.addActionListener(this);
+	menuItemRotationD.addActionListener(this);
+	this.setJMenuBar(menuBar);
+
+    }
+
+    @Override
+    public void dispose() {
+	super.dispose();
+	//on enleve le listener general
+	Toolkit.getDefaultToolkit().removeAWTEventListener(generalListener);
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent e) {
+	if (e.getSource().equals(comment)) {
+	    new CommentsDialog(this, ImagesManagement.getCurrentImage().getIdentifiant());
+	} else if (e.getSource().equals(save)) {
+	    //ouverture du dialog de sauvegarde d'une image
+	    JFileChooser chooser = new JFileChooser();
+	    if (JFileChooser.APPROVE_OPTION == chooser.showSaveDialog(null)) {
+		File chosenFile = chooser.getSelectedFile();
+		if (chosenFile.getName().endsWith(".png")) {
+		    try {
+			//sauvegarde de l'image
+			ImagesUtil.writeImageToPNG(chosenFile, imagePanel.getImage());
+		    } catch (IOException ex) {
+			LOG.error(Outil.getStackTrace(ex));
+		    }
+		} else {
+		    try {
+			ImagesUtil.writeImageToPNG(new File(chosenFile.getParentFile(), chosenFile.getName() + ".png"),
+				imagePanel.getImage());
+		    } catch (IOException ex) {
+			LOG.error(Outil.getStackTrace(ex));
+		    }
+		}
+	    }
+	} else if (e.getSource().equals(next)) {
+	    //on appelle d'abord la fonction de l'images panel qui increment l'image courante
+	    ImagesManagement.next();
+	    //on rafraichit le panel qui contient l'image
+	    BufferedImage img;
+	    try {
+		img = ImagesManagement.getCurrentBufferedImage();
+		imagePanel.setImage(img);
+	    } catch (Exception e1) {
+		LOG.error(Outil.getStackTrace(e1));
+	    }
+
+	} else if (e.getSource().equals(previous)) {
+	    //on appelle d'abord la fonction de l'images panel qui décrémente l'image courante
+	    ImagesManagement.previous();
+	    //on rafraichit le panel qui contient l'image
+	    BufferedImage img;
+	    try {
+		img = ImagesManagement.getCurrentBufferedImage();
+		imagePanel.setImage(img);
+	    } catch (Exception e1) {
+		LOG.error(Outil.getStackTrace(e1));
+	    }
+
+	} else if (e.getSource().equals(rotateLeft)) {
+	    imagePanel.rotationGauche();
+	} else if (e.getSource().equals(rotateRight)) {
+	    imagePanel.rotationDroite();
+	} else if (e.getSource().equals(menuItemSave)) {
+	    save.doClick();
+	} else if (e.getSource().equals(menuItemClose)) {
+	    this.dispose();
+	} else if (e.getSource().equals(menuItemZoomPlus)) {
+	    imagePanel.zoomIn();
+	} else if (e.getSource().equals(menuItemZoomMoins)) {
+	    imagePanel.zoomOut();
+	} else if (e.getSource().equals(menuItemFlipH)) {
+	    imagePanel.flipH = !imagePanel.flipH;
+	    imagePanel.repaint();
+	    imagePanel.revalidate();
+	} else if (e.getSource().equals(menuItemFlipV)) {
+	    imagePanel.flipV = !imagePanel.flipV;
+	    imagePanel.repaint();
+	    imagePanel.revalidate();
+	} else if (e.getSource().equals(menuItemRotationD)) {
+	    rotateRight.doClick();
+	} else if (e.getSource().equals(menuItemRotationG)) {
+	    rotateLeft.doClick();
+	} else if (e.getSource().equals(menuItemPrint)) {
+	    PrinterJob pj = PrinterJob.getPrinterJob();
+	    pj.setPrintable(imagePanel);
+	    if (pj.printDialog()) {
+		try {
+		    pj.print();
+		} catch (PrinterException ex) {
+		    ex.printStackTrace();
+		}
+	    }
+	} else if (e.getSource().equals(menuItemNormal)) {
+	    imagePanel.zoomNormal();
+	}
+
+    }
+
+}
Index: extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/browser/BrowserImagePanel.java
===================================================================
--- extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/browser/BrowserImagePanel.java	(revision 6831)
+++ extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/browser/BrowserImagePanel.java	(revision 6831)
@@ -0,0 +1,244 @@
+package fr.mael.jiwigo.ui.browser;
+
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.event.MouseWheelEvent;
+import java.awt.event.MouseWheelListener;
+import java.awt.geom.AffineTransform;
+import java.awt.image.BufferedImage;
+import java.awt.print.PageFormat;
+import java.awt.print.Printable;
+import java.awt.print.PrinterException;
+import java.util.Hashtable;
+
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JSlider;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+
+import fr.mael.jiwigo.transverse.util.ImagesUtil;
+
+/**
+   Copyright (c) 2010, Mael
+   All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions are met:
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+    * Neither the name of jiwigo nor the
+      names of its contributors may be used to endorse or promote products
+      derived from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+   ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+   DISCLAIMED. IN NO EVENT SHALL Mael BE LIABLE FOR ANY
+   DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+   LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+   ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+   
+ * Panel qui affiche une image
+ * @author mael
+ *
+ */
+public class BrowserImagePanel extends JPanel implements MouseWheelListener, Printable {
+    private BufferedImage image;
+    private double scale = 1.0;
+    boolean flipH = false;
+    boolean flipV = false;
+    private int valueSlider = 16;
+
+    /**
+     * Constructeur
+     * @param image
+     */
+    public BrowserImagePanel(BufferedImage image) {
+	this.image = image;
+	this.addMouseWheelListener(this);
+    }
+
+    /* (non-Javadoc)
+     * @see javax.swing.JComponent#paintComponent(java.awt.Graphics)
+     */
+    protected void paintComponent(Graphics g) {
+	super.paintComponent(g);
+	Graphics2D g2 = (Graphics2D) g;
+	g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);
+	double x = (getWidth() - scale * image.getWidth()) / 2;
+	double y = (getHeight() - scale * image.getHeight()) / 2;
+	AffineTransform at = AffineTransform.getTranslateInstance(x, y);
+	if (flipV && !flipH) {
+	    at.scale(scale, -scale);
+	    at.translate(0, -getHeight() / 2);
+	} else if (flipH && !flipV) {
+	    at.scale(-scale, scale);
+	    at.translate(-getWidth() / 2, 0);
+	} else if (flipH && flipV) {
+	    at.scale(-scale, -scale);
+	    at.translate(-getWidth() / 2, -getHeight() / 2);
+	} else {
+	    at.scale(scale, scale);
+	}
+	System.out.println(scale);
+
+	g2.drawRenderedImage(image, at);
+
+    }
+
+    /* (non-Javadoc)
+     * @see javax.swing.JComponent#getPreferredSize()
+     */
+    public Dimension getPreferredSize() {
+	int w = (int) (scale * image.getWidth());
+	int h = (int) (scale * image.getHeight());
+	return new Dimension(w, h);
+    }
+
+    /**
+     * Récupération du slider
+     * @return le slider
+     */
+    public JSlider getSlider() {
+	int min = 1, max = 36, inc = 10;
+	final JSlider slider = new JSlider(min, max, 16);
+	slider.setMajorTickSpacing(5);
+	slider.setMinorTickSpacing(1);
+	slider.setPaintTicks(true);
+	slider.setSnapToTicks(true);
+	slider.setLabelTable(getLabelTable(min, max, inc));
+	slider.setPaintLabels(true);
+	slider.addChangeListener(new ChangeListener() {
+	    public void stateChanged(ChangeEvent e) {
+		int value = slider.getValue();
+		valueSlider = value;
+		scale = (value + 4) / 20.0;
+		revalidate();
+		repaint();
+	    };
+	});
+	return slider;
+    }
+
+    public void zoomIn() {
+
+	scale = (++valueSlider + 4) / 20.0;
+	revalidate();
+	repaint();
+    }
+
+    public void zoomOut() {
+
+	scale = (--valueSlider + 4) / 20.0;
+	revalidate();
+	repaint();
+    }
+
+    public void zoomNormal() {
+
+	scale = 1.0;
+	revalidate();
+	repaint();
+    }
+
+    /**
+     * Label du slider
+     * @param min
+     * @param max
+     * @param inc
+     * @return
+     */
+    private Hashtable getLabelTable(int min, int max, int inc) {
+	Hashtable<Integer, JLabel> table = new Hashtable<Integer, JLabel>();
+	for (int j = min; j <= max; j += inc) {
+	    String s = String.format("%.2f", (j + 4) / 20.0);
+	    table.put(Integer.valueOf(j), new JLabel(s));
+	}
+	return table;
+    }
+
+    /**
+     *  Rotation vers la droite
+     */
+    public void rotationDroite() {
+	setImage(ImagesUtil.rotate(image, Math.PI / 2));
+    }
+
+    /**
+     * Rotation vers la gauche
+     */
+    public void rotationGauche() {
+	setImage(ImagesUtil.rotate(image, -Math.PI / 2));
+    }
+
+    /**
+     * @return the image
+     */
+    public BufferedImage getImage() {
+	return image;
+    }
+
+    /**
+     * @param image the image to set
+     */
+    public void setImage(BufferedImage image) {
+	this.image = image;
+	revalidate();
+	repaint();
+    }
+
+    @Override
+    public void mouseWheelMoved(MouseWheelEvent arg0) {
+	int notches = arg0.getWheelRotation();
+	String message;
+	String newline = "\n";
+	if (notches < 0) {
+	    message = "Mouse wheel moved UP " + -notches + " notch(es)" + newline;
+	} else {
+	    message = "Mouse wheel moved DOWN " + notches + " notch(es)" + newline;
+	}
+	if (arg0.getScrollType() == MouseWheelEvent.WHEEL_UNIT_SCROLL) {
+	    message += "    Scroll amount: " + arg0.getScrollAmount() + " unit increments per notch" + newline;
+	    message += "    Units to scroll: " + arg0.getUnitsToScroll() + " unit increments" + newline;
+	} else { //scroll type == MouseWheelEvent.WHEEL_BLOCK_SCROLL
+	    message += "    Scroll type: WHEEL_BLOCK_SCROLL" + newline;
+	}
+
+    }
+
+    @Override
+    public int print(Graphics arg0, PageFormat arg1, int arg2) throws PrinterException {
+	if (arg2 != 0)
+	    return NO_SUCH_PAGE;
+	Graphics2D g2 = (Graphics2D) arg0;
+	g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);
+	double x = (getWidth() - scale * image.getWidth()) / 2;
+	double y = (getHeight() - scale * image.getHeight()) / 2;
+	AffineTransform at = AffineTransform.getTranslateInstance(x, y);
+	if (flipV && !flipH) {
+	    at.scale(scale, -scale);
+	    at.translate(0, -getHeight() / 2);
+	} else if (flipH && !flipV) {
+	    at.scale(-scale, scale);
+	    at.translate(-getWidth() / 2, 0);
+	} else if (flipH && flipV) {
+	    at.scale(-scale, -scale);
+	    at.translate(-getWidth() / 2, -getHeight() / 2);
+	} else {
+	    at.scale(scale, scale);
+	}
+
+	g2.drawRenderedImage(image, at);
+	return PAGE_EXISTS;
+    }
+
+}
Index: extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/browser/NavigateurFrame.java
===================================================================
--- extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/browser/NavigateurFrame.java	(revision 6830)
+++ 	(revision )
@@ -1,373 +1,0 @@
-package fr.mael.jiwigo.ui.browser;
-
-import java.awt.AWTEvent;
-import java.awt.BorderLayout;
-import java.awt.Dimension;
-import java.awt.FlowLayout;
-import java.awt.Toolkit;
-import java.awt.event.AWTEventListener;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.KeyEvent;
-import java.awt.image.BufferedImage;
-import java.awt.print.PrinterException;
-import java.awt.print.PrinterJob;
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-
-import javax.imageio.ImageIO;
-import javax.swing.ImageIcon;
-import javax.swing.JButton;
-import javax.swing.JFileChooser;
-import javax.swing.JFrame;
-import javax.swing.JMenu;
-import javax.swing.JMenuBar;
-import javax.swing.JMenuItem;
-import javax.swing.JPanel;
-import javax.swing.JRootPane;
-import javax.swing.JScrollPane;
-
-import fr.mael.jiwigo.om.Image;
-import fr.mael.jiwigo.transverse.util.ImagesUtil;
-import fr.mael.jiwigo.transverse.util.Messages;
-import fr.mael.jiwigo.transverse.util.Outil;
-import fr.mael.jiwigo.ui.ImagesManagement;
-import fr.mael.jiwigo.ui.comments.CommentsDialog;
-
-/**
- *    
-   Copyright (c) 2010, Mael
-   All rights reserved.
-
-   Redistribution and use in source and binary forms, with or without
-   modification, are permitted provided that the following conditions are met:
-    * Redistributions of source code must retain the above copyright
-      notice, this list of conditions and the following disclaimer.
-    * Redistributions in binary form must reproduce the above copyright
-      notice, this list of conditions and the following disclaimer in the
-      documentation and/or other materials provided with the distribution.
-    * Neither the name of jiwigo nor the
-      names of its contributors may be used to endorse or promote products
-      derived from this software without specific prior written permission.
-
-   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-   ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-   DISCLAIMED. IN NO EVENT SHALL Mael BE LIABLE FOR ANY
-   DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-   LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-   ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-   
- * @author mael
- * 
- * Frame de navigation dans les images
- *
- */
-public class NavigateurFrame extends JFrame implements ActionListener {
-    /**
-     * Logger
-     */
-    public static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory
-	    .getLog(NavigateurFrame.class);
-    /**
-     * bouton pour passer à l'image suivante
-     */
-    private JButton next = new JButton();
-    /**
-     * bouton pour passer à l'image précédente
-     */
-    private JButton previous = new JButton();
-    /**
-     * rotation de l'image vers la gauche
-     */
-    private JButton rotateLeft = new JButton();
-    /**
-     * rotation de l'image vers la droite
-     */
-    private JButton rotateRight = new JButton();
-    /**
-     * sauvegarde de l'image
-     */
-    private JButton save = new JButton();
-    /**
-     * affichage des commentaire de l'image
-     */
-    private JButton comment = new JButton();
-    /**
-     * panel contenant tous les boutons précédents
-     */
-    private JPanel panelBoutons;
-
-    /**
-     * Panel qui contient l'image
-     */
-    private NavigateurImagePanel imagePanel;
-
-    /**
-     * Menus
-     */
-    private JMenuBar menuBar;
-    private JMenu menuFichier, menuAffichage, menuImage;
-    private JMenuItem menuItemSave, menuItemPrint, menuItemClose, menuItemZoomPlus;
-    private JMenuItem menuItemZoomMoins, menuItemNormal, menuItemFlipH, menuItemFlipV;
-    private JMenuItem menuItemRotationG, menuItemRotationD;
-
-    /**
-     * Listener général. Permet d'ajouter les écouteurs sur les touches
-     * pour la navigation entres les différentes images grace aux touches
-     * droite et gauche.
-     * Je n'ai pas trouvé mieux que de faire ce listener général.
-     * Il est instancié et ajouté à la création de la frame, et retiré lorsqu'on la quitte
-     */
-    private AWTEventListener generalListener;
-
-    public NavigateurFrame(Image image) {
-	this.setIconImage(java.awt.Toolkit.getDefaultToolkit().getImage(Outil.getURL("fr/mael/jiwigo/img/icon.png")));
-	this.setTitle(Messages.getMessage("titleBrowser"));
-	panelBoutons = new JPanel(new FlowLayout());
-	//ajout des images sur les boutons
-	next.setIcon(new ImageIcon(Outil.getURL("fr/mael/jiwigo/img/next.png")));
-	previous.setIcon(new ImageIcon(Outil.getURL("fr/mael/jiwigo/img/previous.png")));
-	rotateLeft.setIcon(new ImageIcon(Outil.getURL("fr/mael/jiwigo/img/left.png")));
-	rotateRight.setIcon(new ImageIcon(Outil.getURL("fr/mael/jiwigo/img/right.png")));
-	save.setIcon(new ImageIcon(Outil.getURL("fr/mael/jiwigo/img/save.png")));
-	comment.setIcon(new ImageIcon(Outil.getURL("fr/mael/jiwigo/img/comment.png")));
-	//on rend les boutons invisibles, pour ne voir que l'image
-	next.setFocusPainted(false);
-	next.setBorderPainted(false);
-	next.setContentAreaFilled(false);
-	previous.setFocusPainted(false);
-	previous.setBorderPainted(false);
-	previous.setContentAreaFilled(false);
-	rotateLeft.setFocusPainted(false);
-	rotateLeft.setBorderPainted(false);
-	rotateLeft.setContentAreaFilled(false);
-	rotateRight.setFocusPainted(false);
-	rotateRight.setBorderPainted(false);
-	rotateRight.setContentAreaFilled(false);
-	save.setFocusPainted(false);
-	save.setBorderPainted(false);
-	save.setContentAreaFilled(false);
-	comment.setFocusPainted(false);
-	comment.setBorderPainted(false);
-	comment.setContentAreaFilled(false);
-	//ajout des action listeners
-	comment.addActionListener(this);
-	save.addActionListener(this);
-	rotateRight.addActionListener(this);
-	rotateLeft.addActionListener(this);
-	previous.addActionListener(this);
-	next.addActionListener(this);
-	//ajout des boutons
-	panelBoutons.add(previous);
-	panelBoutons.add(next);
-	panelBoutons.add(rotateLeft);
-	panelBoutons.add(rotateRight);
-	panelBoutons.add(save);
-	panelBoutons.add(comment);
-
-	BufferedImage img;
-	try {
-	    img = ImageIO.read(new URL(ImagesManagement.getCurrentImage().getUrl()));
-	    imagePanel = new NavigateurImagePanel(img);
-	} catch (Exception e1) {
-	    LOG.error(Outil.getStackTrace(e1));
-	}
-
-	this.getContentPane().setLayout(new BorderLayout());
-	JScrollPane scrollpane = new JScrollPane(imagePanel);
-	Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
-	this.getRootPane().setWindowDecorationStyle(JRootPane.PLAIN_DIALOG);
-	this.setExtendedState(JFrame.MAXIMIZED_BOTH);
-	this.setExtendedState(JFrame.ICONIFIED | this.getExtendedState());
-	panelBoutons.add(imagePanel.getSlider());
-	imagePanel.setLayout(new BorderLayout());
-	panelBoutons.setOpaque(false);
-	this.add(scrollpane, BorderLayout.CENTER);
-	this.add(panelBoutons, BorderLayout.SOUTH);
-
-	this.setSize(screenSize);
-	this.setLocationRelativeTo(null);
-	this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
-	this.setVisible(true);
-	//instanciation du listener general
-	this.generalListener = new AWTEventListener() {
-
-	    public void eventDispatched(AWTEvent event) {
-		KeyEvent ke = (KeyEvent) event;
-		if (ke.getID() == KeyEvent.KEY_PRESSED) {
-		    if (ke.getKeyCode() == KeyEvent.VK_RIGHT) {
-			next.doClick();
-		    } else if (ke.getKeyCode() == KeyEvent.VK_LEFT) {
-			previous.doClick();
-		    }
-		}
-	    }
-	};
-	//ajout du listener general
-	//Toolkit.getDefaultToolkit().addAWTEventListener(generalListener, AWTEvent.KEY_EVENT_MASK);
-	setUpMenu();
-
-    }
-
-    private void setUpMenu() {
-	menuBar = new JMenuBar();
-
-	menuBar = new JMenuBar();
-	menuFichier = new JMenu(Messages.getMessage("imageBrowser_file"));
-	menuAffichage = new JMenu(Messages.getMessage("imageBrowser_display"));
-	menuImage = new JMenu(Messages.getMessage("imageBrowser_image"));
-	menuBar.add(menuFichier);
-	menuBar.add(menuAffichage);
-	menuBar.add(menuImage);
-	menuItemSave = new JMenuItem(Messages.getMessage("imageBrowser_save"), new ImageIcon(Outil
-		.getURL("fr/mael/jiwigo/img/save_mini.png")));
-	menuItemPrint = new JMenuItem(Messages.getMessage("imageBrowser_print"), new ImageIcon(Outil
-		.getURL("fr/mael/jiwigo/img/print.gif")));
-	menuItemClose = new JMenuItem(Messages.getMessage("imageBrowser_close"), new ImageIcon(Outil
-		.getURL("fr/mael/jiwigo/img/close.png")));
-	menuItemZoomPlus = new JMenuItem(Messages.getMessage("imageBrowser_zoomPlus"), new ImageIcon(Outil
-		.getURL("fr/mael/jiwigo/img/zoom_in.png")));
-	menuItemZoomMoins = new JMenuItem(Messages.getMessage("imageBrowser_zoomMoins"), new ImageIcon(Outil
-		.getURL("fr/mael/jiwigo/img/zoom_out.png")));
-	menuItemNormal = new JMenuItem(Messages.getMessage("imageBrowser_zoomNormal"), new ImageIcon(Outil
-		.getURL("fr/mael/jiwigo/img/zoom_n.png")));
-	menuItemFlipH = new JMenuItem(Messages.getMessage("imageBrowser_flipH"), new ImageIcon(Outil
-		.getURL("fr/mael/jiwigo/img/flip_h.png")));
-	menuItemFlipV = new JMenuItem(Messages.getMessage("imageBrowser_flipV"), new ImageIcon(Outil
-		.getURL("fr/mael/jiwigo/img/flip_v.png")));
-	menuItemRotationG = new JMenuItem(Messages.getMessage("imageBrowser_rotationL"), new ImageIcon(Outil
-		.getURL("fr/mael/jiwigo/img/left.png")));
-	menuItemRotationD = new JMenuItem(Messages.getMessage("imageBrowser_rotationR"), new ImageIcon(Outil
-		.getURL("fr/mael/jiwigo/img/right.png")));
-	menuFichier.add(menuItemSave);
-	menuFichier.addSeparator();
-	menuFichier.add(menuItemPrint);
-	menuFichier.addSeparator();
-	menuFichier.add(menuItemClose);
-	menuAffichage.add(menuItemZoomMoins);
-	menuAffichage.add(menuItemNormal);
-	menuAffichage.add(menuItemZoomPlus);
-	menuImage.add(menuItemFlipH);
-	menuImage.add(menuItemFlipV);
-	menuImage.addSeparator();
-	menuImage.add(menuItemRotationG);
-	menuImage.add(menuItemRotationD);
-	menuBar.add(menuFichier);
-	menuBar.add(menuAffichage);
-	menuBar.add(menuImage);
-	menuItemSave.addActionListener(this);
-	menuItemPrint.addActionListener(this);
-	menuItemClose.addActionListener(this);
-	menuItemZoomPlus.addActionListener(this);
-	menuItemZoomMoins.addActionListener(this);
-	menuItemNormal.addActionListener(this);
-	menuItemFlipH.addActionListener(this);
-	menuItemFlipV.addActionListener(this);
-	menuItemRotationG.addActionListener(this);
-	menuItemRotationD.addActionListener(this);
-	this.setJMenuBar(menuBar);
-
-    }
-
-    @Override
-    public void dispose() {
-	super.dispose();
-	//on enleve le listener general
-	Toolkit.getDefaultToolkit().removeAWTEventListener(generalListener);
-    }
-
-    @Override
-    public void actionPerformed(ActionEvent e) {
-	if (e.getSource().equals(comment)) {
-	    new CommentsDialog(this, ImagesManagement.getCurrentImage().getIdentifiant());
-	} else if (e.getSource().equals(save)) {
-	    //ouverture du dialog de sauvegarde d'une image
-	    JFileChooser chooser = new JFileChooser();
-	    if (JFileChooser.APPROVE_OPTION == chooser.showSaveDialog(null)) {
-		File chosenFile = chooser.getSelectedFile();
-		if (chosenFile.getName().endsWith(".png")) {
-		    try {
-			//sauvegarde de l'image
-			ImagesUtil.writeImageToPNG(chosenFile, imagePanel.getImage());
-		    } catch (IOException ex) {
-			LOG.error(Outil.getStackTrace(ex));
-		    }
-		} else {
-		    try {
-			ImagesUtil.writeImageToPNG(new File(chosenFile.getParentFile(), chosenFile.getName() + ".png"),
-				imagePanel.getImage());
-		    } catch (IOException ex) {
-			LOG.error(Outil.getStackTrace(ex));
-		    }
-		}
-	    }
-	} else if (e.getSource().equals(next)) {
-	    //on appelle d'abord la fonction de l'images panel qui increment l'image courante
-	    ImagesManagement.next();
-	    //on rafraichit le panel qui contient l'image
-	    BufferedImage img;
-	    try {
-		img = ImagesManagement.getCurrentBufferedImage();
-		imagePanel.setImage(img);
-	    } catch (Exception e1) {
-		LOG.error(Outil.getStackTrace(e1));
-	    }
-
-	} else if (e.getSource().equals(previous)) {
-	    //on appelle d'abord la fonction de l'images panel qui décrémente l'image courante
-	    ImagesManagement.previous();
-	    //on rafraichit le panel qui contient l'image
-	    BufferedImage img;
-	    try {
-		img = ImagesManagement.getCurrentBufferedImage();
-		imagePanel.setImage(img);
-	    } catch (Exception e1) {
-		LOG.error(Outil.getStackTrace(e1));
-	    }
-
-	} else if (e.getSource().equals(rotateLeft)) {
-	    imagePanel.rotationGauche();
-	} else if (e.getSource().equals(rotateRight)) {
-	    imagePanel.rotationDroite();
-	} else if (e.getSource().equals(menuItemSave)) {
-	    save.doClick();
-	} else if (e.getSource().equals(menuItemClose)) {
-	    this.dispose();
-	} else if (e.getSource().equals(menuItemZoomPlus)) {
-	    imagePanel.zoomIn();
-	} else if (e.getSource().equals(menuItemZoomMoins)) {
-	    imagePanel.zoomOut();
-	} else if (e.getSource().equals(menuItemFlipH)) {
-	    imagePanel.flipH = !imagePanel.flipH;
-	    imagePanel.repaint();
-	    imagePanel.revalidate();
-	} else if (e.getSource().equals(menuItemFlipV)) {
-	    imagePanel.flipV = !imagePanel.flipV;
-	    imagePanel.repaint();
-	    imagePanel.revalidate();
-	} else if (e.getSource().equals(menuItemRotationD)) {
-	    rotateRight.doClick();
-	} else if (e.getSource().equals(menuItemRotationG)) {
-	    rotateLeft.doClick();
-	} else if (e.getSource().equals(menuItemPrint)) {
-	    PrinterJob pj = PrinterJob.getPrinterJob();
-	    pj.setPrintable(imagePanel);
-	    if (pj.printDialog()) {
-		try {
-		    pj.print();
-		} catch (PrinterException ex) {
-		    ex.printStackTrace();
-		}
-	    }
-	} else if (e.getSource().equals(menuItemNormal)) {
-	    imagePanel.zoomNormal();
-	}
-
-    }
-
-}
Index: extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/browser/NavigateurImagePanel.java
===================================================================
--- extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/browser/NavigateurImagePanel.java	(revision 6830)
+++ 	(revision )
@@ -1,244 +1,0 @@
-package fr.mael.jiwigo.ui.browser;
-
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.Graphics2D;
-import java.awt.RenderingHints;
-import java.awt.event.MouseWheelEvent;
-import java.awt.event.MouseWheelListener;
-import java.awt.geom.AffineTransform;
-import java.awt.image.BufferedImage;
-import java.awt.print.PageFormat;
-import java.awt.print.Printable;
-import java.awt.print.PrinterException;
-import java.util.Hashtable;
-
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JSlider;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-
-import fr.mael.jiwigo.transverse.util.ImagesUtil;
-
-/**
-   Copyright (c) 2010, Mael
-   All rights reserved.
-
-   Redistribution and use in source and binary forms, with or without
-   modification, are permitted provided that the following conditions are met:
-    * Redistributions of source code must retain the above copyright
-      notice, this list of conditions and the following disclaimer.
-    * Redistributions in binary form must reproduce the above copyright
-      notice, this list of conditions and the following disclaimer in the
-      documentation and/or other materials provided with the distribution.
-    * Neither the name of jiwigo nor the
-      names of its contributors may be used to endorse or promote products
-      derived from this software without specific prior written permission.
-
-   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-   ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-   DISCLAIMED. IN NO EVENT SHALL Mael BE LIABLE FOR ANY
-   DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-   LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-   ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-   
- * Panel qui affiche une image
- * @author mael
- *
- */
-public class NavigateurImagePanel extends JPanel implements MouseWheelListener, Printable {
-    private BufferedImage image;
-    private double scale = 1.0;
-    boolean flipH = false;
-    boolean flipV = false;
-    private int valueSlider = 16;
-
-    /**
-     * Constructeur
-     * @param image
-     */
-    public NavigateurImagePanel(BufferedImage image) {
-	this.image = image;
-	this.addMouseWheelListener(this);
-    }
-
-    /* (non-Javadoc)
-     * @see javax.swing.JComponent#paintComponent(java.awt.Graphics)
-     */
-    protected void paintComponent(Graphics g) {
-	super.paintComponent(g);
-	Graphics2D g2 = (Graphics2D) g;
-	g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);
-	double x = (getWidth() - scale * image.getWidth()) / 2;
-	double y = (getHeight() - scale * image.getHeight()) / 2;
-	AffineTransform at = AffineTransform.getTranslateInstance(x, y);
-	if (flipV && !flipH) {
-	    at.scale(scale, -scale);
-	    at.translate(0, -getHeight() / 2);
-	} else if (flipH && !flipV) {
-	    at.scale(-scale, scale);
-	    at.translate(-getWidth() / 2, 0);
-	} else if (flipH && flipV) {
-	    at.scale(-scale, -scale);
-	    at.translate(-getWidth() / 2, -getHeight() / 2);
-	} else {
-	    at.scale(scale, scale);
-	}
-	System.out.println(scale);
-
-	g2.drawRenderedImage(image, at);
-
-    }
-
-    /* (non-Javadoc)
-     * @see javax.swing.JComponent#getPreferredSize()
-     */
-    public Dimension getPreferredSize() {
-	int w = (int) (scale * image.getWidth());
-	int h = (int) (scale * image.getHeight());
-	return new Dimension(w, h);
-    }
-
-    /**
-     * Récupération du slider
-     * @return le slider
-     */
-    public JSlider getSlider() {
-	int min = 1, max = 36, inc = 10;
-	final JSlider slider = new JSlider(min, max, 16);
-	slider.setMajorTickSpacing(5);
-	slider.setMinorTickSpacing(1);
-	slider.setPaintTicks(true);
-	slider.setSnapToTicks(true);
-	slider.setLabelTable(getLabelTable(min, max, inc));
-	slider.setPaintLabels(true);
-	slider.addChangeListener(new ChangeListener() {
-	    public void stateChanged(ChangeEvent e) {
-		int value = slider.getValue();
-		valueSlider = value;
-		scale = (value + 4) / 20.0;
-		revalidate();
-		repaint();
-	    };
-	});
-	return slider;
-    }
-
-    public void zoomIn() {
-
-	scale = (++valueSlider + 4) / 20.0;
-	revalidate();
-	repaint();
-    }
-
-    public void zoomOut() {
-
-	scale = (--valueSlider + 4) / 20.0;
-	revalidate();
-	repaint();
-    }
-
-    public void zoomNormal() {
-
-	scale = 1.0;
-	revalidate();
-	repaint();
-    }
-
-    /**
-     * Label du slider
-     * @param min
-     * @param max
-     * @param inc
-     * @return
-     */
-    private Hashtable getLabelTable(int min, int max, int inc) {
-	Hashtable<Integer, JLabel> table = new Hashtable<Integer, JLabel>();
-	for (int j = min; j <= max; j += inc) {
-	    String s = String.format("%.2f", (j + 4) / 20.0);
-	    table.put(Integer.valueOf(j), new JLabel(s));
-	}
-	return table;
-    }
-
-    /**
-     *  Rotation vers la droite
-     */
-    public void rotationDroite() {
-	setImage(ImagesUtil.rotate(image, Math.PI / 2));
-    }
-
-    /**
-     * Rotation vers la gauche
-     */
-    public void rotationGauche() {
-	setImage(ImagesUtil.rotate(image, -Math.PI / 2));
-    }
-
-    /**
-     * @return the image
-     */
-    public BufferedImage getImage() {
-	return image;
-    }
-
-    /**
-     * @param image the image to set
-     */
-    public void setImage(BufferedImage image) {
-	this.image = image;
-	revalidate();
-	repaint();
-    }
-
-    @Override
-    public void mouseWheelMoved(MouseWheelEvent arg0) {
-	int notches = arg0.getWheelRotation();
-	String message;
-	String newline = "\n";
-	if (notches < 0) {
-	    message = "Mouse wheel moved UP " + -notches + " notch(es)" + newline;
-	} else {
-	    message = "Mouse wheel moved DOWN " + notches + " notch(es)" + newline;
-	}
-	if (arg0.getScrollType() == MouseWheelEvent.WHEEL_UNIT_SCROLL) {
-	    message += "    Scroll amount: " + arg0.getScrollAmount() + " unit increments per notch" + newline;
-	    message += "    Units to scroll: " + arg0.getUnitsToScroll() + " unit increments" + newline;
-	} else { //scroll type == MouseWheelEvent.WHEEL_BLOCK_SCROLL
-	    message += "    Scroll type: WHEEL_BLOCK_SCROLL" + newline;
-	}
-
-    }
-
-    @Override
-    public int print(Graphics arg0, PageFormat arg1, int arg2) throws PrinterException {
-	if (arg2 != 0)
-	    return NO_SUCH_PAGE;
-	Graphics2D g2 = (Graphics2D) arg0;
-	g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);
-	double x = (getWidth() - scale * image.getWidth()) / 2;
-	double y = (getHeight() - scale * image.getHeight()) / 2;
-	AffineTransform at = AffineTransform.getTranslateInstance(x, y);
-	if (flipV && !flipH) {
-	    at.scale(scale, -scale);
-	    at.translate(0, -getHeight() / 2);
-	} else if (flipH && !flipV) {
-	    at.scale(-scale, scale);
-	    at.translate(-getWidth() / 2, 0);
-	} else if (flipH && flipV) {
-	    at.scale(-scale, -scale);
-	    at.translate(-getWidth() / 2, -getHeight() / 2);
-	} else {
-	    at.scale(scale, scale);
-	}
-
-	g2.drawRenderedImage(image, at);
-	return PAGE_EXISTS;
-    }
-
-}
Index: extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/mainframe/CategoriesTree.java
===================================================================
--- extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/mainframe/CategoriesTree.java	(revision 6830)
+++ extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/mainframe/CategoriesTree.java	(revision 6831)
@@ -106,8 +106,10 @@
      */
     public void setUpUi() {
+	//begin bug:0001830
 	root.removeAllChildren();
 	createNodes(root);
-	DefaultTreeModel model = (DefaultTreeModel) tree.getModel();
-	model.nodeStructureChanged(root);
+	((DefaultTreeModel) tree.getModel()).reload();
+	//end
+
     }
 
@@ -183,4 +185,7 @@
 	int selRow = tree.getRowForLocation(e.getX(), e.getY());
 	TreePath selPath = tree.getPathForLocation(e.getX(), e.getY());
+	//begin bug:0001832
+	tree.setSelectionRow(selRow);
+	//end
 	if (selRow != -1) {
 	    if (e.getButton() == 3) {
Index: extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/mainframe/MainFrame.java
===================================================================
--- extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/mainframe/MainFrame.java	(revision 6830)
+++ extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/mainframe/MainFrame.java	(revision 6831)
@@ -3,7 +3,12 @@
 import java.awt.BorderLayout;
 import java.awt.FlowLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
 
 import javax.swing.JFrame;
 import javax.swing.JLabel;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
@@ -42,5 +47,5 @@
  * Frame principale
  */
-public class MainFrame extends JFrame {
+public class MainFrame extends JFrame implements ActionListener {
     /**
      * Logger
@@ -60,5 +65,5 @@
      * Panel contenant les miniatures de la catégorie courante
      */
-    public static MiniaturesCategoryPanel imagesPanel;
+    public static ThumbnailCategoryPanel imagesPanel;
     /**
      *  Scrollpane contenant le panel ci dessus
@@ -69,4 +74,19 @@
      */
     private JLabel labelMessage;
+
+    /**
+     * Barre de menu
+     */
+    private JMenuBar jMenuBar;
+
+    /**
+     * Menu d'édition
+     */
+    private JMenu jMenuEdition;
+
+    /**
+     * menu des preferences
+     */
+    private JMenuItem jMenuItemPreferences;
 
     /**
@@ -92,9 +112,10 @@
 	this.setIconImage(java.awt.Toolkit.getDefaultToolkit().getImage(Outil.getURL("fr/mael/jiwigo/img/icon.png")));
 	this.setLayout(new BorderLayout());
+	jMenuBar = new JMenuBar();
 	labelMessage = new JLabel(Messages.getMessage("welcomeMessage"));
 	splitPane = new JSplitPane();
 	categoriesTree = new CategoriesTree();
 	splitPane.setLeftComponent(categoriesTree);
-	imagesPanel = new MiniaturesCategoryPanel(null);
+	imagesPanel = new ThumbnailCategoryPanel(null);
 	scrollPaneImagesPanel = new JScrollPane(imagesPanel, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
 		JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
@@ -104,4 +125,12 @@
 	JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT));
 	panel.add(labelMessage);
+
+	jMenuEdition = new JMenu(Messages.getMessage("mainFrame_editionMenu"));
+	jMenuBar.add(jMenuEdition);
+	jMenuItemPreferences = new JMenuItem(Messages.getMessage("mainFrame_preferencesMenu"));
+	jMenuItemPreferences.addActionListener(this);
+	jMenuEdition.add(jMenuItemPreferences);
+
+	this.setJMenuBar(jMenuBar);
 	this.add(panel, BorderLayout.SOUTH);
 	this.pack();
@@ -134,3 +163,11 @@
     }
 
+    @Override
+    public void actionPerformed(ActionEvent arg0) {
+	if (arg0.getSource().equals(jMenuItemPreferences)) {
+	    new PreferencesDialog(this);
+	}
+
+    }
+
 }
Index: extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/mainframe/MiniaturePanel.java
===================================================================
--- extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/mainframe/MiniaturePanel.java	(revision 6830)
+++ 	(revision )
@@ -1,116 +1,0 @@
-package fr.mael.jiwigo.ui.mainframe;
-
-import java.awt.Cursor;
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.Graphics2D;
-import java.awt.RenderingHints;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-
-import javax.swing.JLabel;
-
-import fr.mael.jiwigo.om.Image;
-import fr.mael.jiwigo.ui.ImagesManagement;
-import fr.mael.jiwigo.ui.browser.NavigateurFrame;
-
-/**
-   Copyright (c) 2010, Mael
-   All rights reserved.
-
-   Redistribution and use in source and binary forms, with or without
-   modification, are permitted provided that the following conditions are met:
-    * Redistributions of source code must retain the above copyright
-      notice, this list of conditions and the following disclaimer.
-    * Redistributions in binary form must reproduce the above copyright
-      notice, this list of conditions and the following disclaimer in the
-      documentation and/or other materials provided with the distribution.
-    * Neither the name of jiwigo nor the
-      names of its contributors may be used to endorse or promote products
-      derived from this software without specific prior written permission.
-
-   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-   ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-   DISCLAIMED. IN NO EVENT SHALL Mael BE LIABLE FOR ANY
-   DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-   LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-   ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-   
- * @author mael
- * Panel contenant la miniature d'une image.
- * C'est un panel "cliquable", qui permet d'afficher l'image à taille réelle
- */
-public class MiniaturePanel extends JLabel implements MouseListener {
-    /**
-     * Logger
-     */
-    public static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory
-	    .getLog(MiniaturePanel.class);
-    /**
-     * l'image
-     */
-    private Image image;
-
-    /**
-     * Constructeur
-     * @param image l'image
-     * @param imagesPanel le panel
-     */
-    public MiniaturePanel(Image image) {
-	this.image = image;
-	this.addMouseListener(this);
-    }
-
-    protected void paintComponent(Graphics g) {
-	super.paintComponent(g);
-	Graphics2D g2 = (Graphics2D) g;
-	g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);
-	double x = (getWidth() * ImagesManagement.getMiniatureBufferedImage(image).getWidth()) / 2;
-	double y = (getHeight() * ImagesManagement.getMiniatureBufferedImage(image).getHeight()) / 2;
-	g2.drawRenderedImage(ImagesManagement.getMiniatureBufferedImage(image), null);
-    }
-
-    /* (non-Javadoc)
-     * @see javax.swing.JComponent#getPreferredSize()
-     */
-    public Dimension getPreferredSize() {
-	int w = (int) (ImagesManagement.getMiniatureBufferedImage(image).getWidth());
-	int h = (int) (ImagesManagement.getMiniatureBufferedImage(image).getHeight());
-	return new Dimension(w, h);
-    }
-
-    @Override
-    public void mouseClicked(MouseEvent paramMouseEvent) {
-	// on affiche l'image en grand
-	ImagesManagement.setCurrentImage(image);
-	new NavigateurFrame(image);
-
-    }
-
-    @Override
-    public void mouseEntered(MouseEvent paramMouseEvent) {
-	//changement du curseur, pour signifier à l'utilisateur que l'image est cliquable
-	this.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
-    }
-
-    @Override
-    public void mouseExited(MouseEvent paramMouseEvent) {
-    }
-
-    @Override
-    public void mousePressed(MouseEvent paramMouseEvent) {
-	// TODO Auto-generated method stub
-
-    }
-
-    @Override
-    public void mouseReleased(MouseEvent paramMouseEvent) {
-	// TODO Auto-generated method stub
-
-    }
-
-}
Index: extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/mainframe/MiniaturesCategoryPanel.java
===================================================================
--- extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/mainframe/MiniaturesCategoryPanel.java	(revision 6830)
+++ 	(revision )
@@ -1,129 +1,0 @@
-package fr.mael.jiwigo.ui.mainframe;
-
-import java.awt.Dimension;
-import java.awt.FlowLayout;
-
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-
-import fr.mael.jiwigo.om.Image;
-import fr.mael.jiwigo.service.ImageService;
-import fr.mael.jiwigo.transverse.util.Messages;
-import fr.mael.jiwigo.transverse.util.Outil;
-import fr.mael.jiwigo.transverse.util.filedrop.FileDrop;
-import fr.mael.jiwigo.ui.ImagesManagement;
-
-/**
-   Copyright (c) 2010, Mael
-   All rights reserved.
-
-   Redistribution and use in source and binary forms, with or without
-   modification, are permitted provided that the following conditions are met:
-    * Redistributions of source code must retain the above copyright
-      notice, this list of conditions and the following disclaimer.
-    * Redistributions in binary form must reproduce the above copyright
-      notice, this list of conditions and the following disclaimer in the
-      documentation and/or other materials provided with the distribution.
-    * Neither the name of jiwigo nor the
-      names of its contributors may be used to endorse or promote products
-      derived from this software without specific prior written permission.
-
-   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-   ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-   DISCLAIMED. IN NO EVENT SHALL Mael BE LIABLE FOR ANY
-   DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-   LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-   ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-   
- * @author mael
- * Classe qui affiche toutes les miniatures d'une catégorie
- */
-public class MiniaturesCategoryPanel extends JPanel {
-    /**
-     * Logger
-     */
-    public static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory
-	    .getLog(MiniaturesCategoryPanel.class);
-    /**
-     * L'id de la catégorie pour laquelle les miniatures doivent être affichées
-     */
-    private Integer categoryId;
-
-    /**
-     * Constructeur
-     * @param categoryId l'id de la catégorie
-     */
-    public MiniaturesCategoryPanel(Integer categoryId) {
-	this.categoryId = categoryId;
-	this.setLayout(new FlowLayout());
-	this.setPreferredSize(new Dimension(1000, 750));
-	if (categoryId != null) {
-	    rafraichir(categoryId, false);
-	}
-	//gestion du drag'n drop
-	new FileDrop(System.out, this, new FileDrop.Listener() {
-	    public void filesDropped(final java.io.File[] files) {
-		for (int i = 0; i < files.length; i++) {
-		    try {
-			ImageService.getInstance().creer(files[i].getCanonicalPath(), getCategoryId());
-			//on rafraichit
-			rafraichir(getCategoryId(), true);
-		    } catch (Exception e) {
-			LOG.error(Outil.getStackTrace(e));
-			//s'il y a une erreur lors de l'envoi
-			JOptionPane.showMessageDialog(null, Messages.getMessage("sendingError") + files[i].getName(),
-				Messages.getMessage("error"), JOptionPane.ERROR_MESSAGE);
-		    }
-		}
-
-	    }
-	});
-
-    }
-
-    /**
-     * rafraichissement, afin d'afficher les nouvelles images
-     * @param categoryId
-     */
-    public void rafraichir(Integer categoryId, boolean rafraichir) {
-	this.categoryId = categoryId;
-	this.removeAll();
-	try {
-	    ImagesManagement.LIST_IMAGE = ImageService.getInstance().listerParCategory(categoryId, rafraichir);
-	    for (Image image : ImagesManagement.LIST_IMAGE) {
-		try {
-		    //		    MiniatureLabel label = new MiniatureLabel(image, this);
-		    MiniaturePanel panel = new MiniaturePanel(image);
-		    this.add(panel);
-		} catch (Exception e) {
-
-		}
-	    }
-	    this.repaint();
-	    this.revalidate();
-	} catch (Exception e) {
-	    LOG.error(Outil.getStackTrace(e));
-	    JOptionPane.showMessageDialog(null, Messages.getMessage("imagesListingError"),
-		    Messages.getMessage("error"), JOptionPane.ERROR_MESSAGE);
-	}
-    }
-
-    /**
-     * @return the categoryId
-     */
-    public Integer getCategoryId() {
-	return categoryId;
-    }
-
-    /**
-     * @param categoryId the categoryId to set
-     */
-    public void setCategoryId(Integer categoryId) {
-	this.categoryId = categoryId;
-    }
-
-}
Index: extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/mainframe/PreferencesDialog.java
===================================================================
--- extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/mainframe/PreferencesDialog.java	(revision 6831)
+++ extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/mainframe/PreferencesDialog.java	(revision 6831)
@@ -0,0 +1,195 @@
+package fr.mael.jiwigo.ui.mainframe;
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JTabbedPane;
+import javax.swing.JTextField;
+
+import fr.mael.jiwigo.transverse.enumeration.PreferencesEnum;
+import fr.mael.jiwigo.transverse.util.Messages;
+import fr.mael.jiwigo.transverse.util.preferences.PreferencesManagement;
+
+/**
+ * 
+   Copyright (c) 2010, Mael
+   All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions are met:
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+    * Neither the name of jiwigo nor the
+      names of its contributors may be used to endorse or promote products
+      derived from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+   ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+   DISCLAIMED. IN NO EVENT SHALL Mael BE LIABLE FOR ANY
+   DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+   LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+   ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+   
+ * @author mael
+ *
+ */
+public class PreferencesDialog extends JDialog implements ActionListener {
+
+    /**
+     * Logger
+     */
+    public static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory
+	    .getLog(PreferencesDialog.class);
+
+    /**
+     * Les onglets
+     */
+    private JTabbedPane tabPane;
+
+    /**
+     * l'onglet de gestion des preferences des images
+     */
+    private JPanel panelImage;
+
+    /**
+     * largeur des images
+     */
+    private JTextField fieldWidth;
+
+    /**
+     * hauteur des images
+     */
+    private JTextField fieldHeight;
+
+    /**
+     * taille des morceaux
+     */
+    private JTextField fieldChunkSize;
+
+    /**
+     * label
+     */
+    private JLabel labelTaille;
+
+    /**
+     * label
+     */
+    private JLabel labelChunkSize;
+
+    /**
+     * label
+     */
+    private JLabel labelCroix;
+
+    /**
+     * bouton d'enregistrement des preferences
+     */
+    private JButton boutonOk = new JButton("Ok");
+
+    /**
+     * panel contenant les boutons
+     */
+    private JPanel panelBoutons;
+
+    /**
+     * bouton pour annuler 
+     */
+    private JButton boutonAnnuler;
+
+    /**
+     * Constructeur
+     * @param parent frame parent
+     */
+    public PreferencesDialog(JFrame parent) {
+	fieldWidth = new JTextField(PreferencesManagement.getValue(PreferencesEnum.WIDTH_ORIGINALE.getLabel()));
+	fieldHeight = new JTextField(PreferencesManagement.getValue(PreferencesEnum.HEIGHT_ORIGINAL.getLabel()));
+	fieldChunkSize = new JTextField(PreferencesManagement.getValue(PreferencesEnum.CHUNK_SIZE.getLabel()));
+	labelTaille = new JLabel(Messages.getMessage("preferences_imagesSize"));
+	labelCroix = new JLabel("x");
+	labelChunkSize = new JLabel(Messages.getMessage("preferences_chunkSize"));
+	fieldWidth.setPreferredSize(new Dimension(50, 30));
+	fieldHeight.setPreferredSize(new Dimension(50, 30));
+	fieldChunkSize.setPreferredSize(new Dimension(50, 30));
+
+	panelImage = new JPanel(new GridBagLayout());
+	GridBagConstraints c = new GridBagConstraints();
+	c.gridx = 0;
+	c.gridy = 0;
+	c.anchor = GridBagConstraints.WEST;
+	panelImage.add(labelTaille, c);
+	c.gridx++;
+	panelImage.add(fieldWidth, c);
+	c.gridx++;
+	panelImage.add(labelCroix, c);
+	c.gridx++;
+	panelImage.add(fieldHeight, c);
+	c.gridy++;
+	c.gridx = 0;
+	panelImage.add(labelChunkSize, c);
+	c.gridx++;
+	panelImage.add(fieldChunkSize, c);
+
+	boutonAnnuler = new JButton(Messages.getMessage("cancel"));
+	boutonAnnuler.addActionListener(this);
+	boutonOk.addActionListener(this);
+	panelBoutons = new JPanel(new FlowLayout(FlowLayout.RIGHT));
+	panelBoutons.add(boutonOk);
+	panelBoutons.add(boutonAnnuler);
+	boutonOk.setPreferredSize(new Dimension(90, 30));
+	boutonAnnuler.setPreferredSize(new Dimension(90, 30));
+
+	tabPane = new JTabbedPane();
+	tabPane.addTab(Messages.getMessage("preferences_tabImage"), panelImage);
+	this.setLayout(new BorderLayout());
+	this.add(tabPane, BorderLayout.CENTER);
+	this.add(panelBoutons, BorderLayout.SOUTH);
+	this.setSize(new Dimension(400, 300));
+	this.setLocationRelativeTo(null);
+	this.setVisible(true);
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent e) {
+	if (e.getSource().equals(boutonAnnuler)) {
+	    this.dispose();
+	} else if (e.getSource().equals(boutonOk)) {
+	    try {
+		int width = Integer.valueOf(fieldWidth.getText());
+		int height = Integer.valueOf(fieldHeight.getText());
+		double chunk = Double.parseDouble(fieldChunkSize.getText().replace(",", "."));
+		PreferencesManagement.setValue(PreferencesEnum.WIDTH_ORIGINALE.getLabel(), String.valueOf(width));
+		PreferencesManagement.setValue(PreferencesEnum.HEIGHT_ORIGINAL.getLabel(), String.valueOf(height));
+		PreferencesManagement.setValue(PreferencesEnum.CHUNK_SIZE.getLabel(), String.valueOf(chunk));
+		this.dispose();
+	    } catch (NumberFormatException ex) {
+		ex.printStackTrace();
+		JOptionPane.showMessageDialog(this, Messages.getMessage("preferencesCheckValues"), Messages
+			.getMessage("error"), JOptionPane.ERROR_MESSAGE);
+	    } catch (Exception ex) {
+		JOptionPane.showMessageDialog(this, Messages.getMessage("preferencesUnexpectedError"), Messages
+			.getMessage("error"), JOptionPane.ERROR_MESSAGE);
+
+	    }
+
+	}
+
+    }
+}
Index: extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/mainframe/ThumbnailCategoryPanel.java
===================================================================
--- extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/mainframe/ThumbnailCategoryPanel.java	(revision 6831)
+++ extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/mainframe/ThumbnailCategoryPanel.java	(revision 6831)
@@ -0,0 +1,129 @@
+package fr.mael.jiwigo.ui.mainframe;
+
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+
+import fr.mael.jiwigo.om.Image;
+import fr.mael.jiwigo.service.ImageService;
+import fr.mael.jiwigo.transverse.util.Messages;
+import fr.mael.jiwigo.transverse.util.Outil;
+import fr.mael.jiwigo.transverse.util.filedrop.FileDrop;
+import fr.mael.jiwigo.ui.ImagesManagement;
+
+/**
+   Copyright (c) 2010, Mael
+   All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions are met:
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+    * Neither the name of jiwigo nor the
+      names of its contributors may be used to endorse or promote products
+      derived from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+   ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+   DISCLAIMED. IN NO EVENT SHALL Mael BE LIABLE FOR ANY
+   DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+   LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+   ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+   
+ * @author mael
+ * Classe qui affiche toutes les miniatures d'une catégorie
+ */
+public class ThumbnailCategoryPanel extends JPanel {
+    /**
+     * Logger
+     */
+    public static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory
+	    .getLog(ThumbnailCategoryPanel.class);
+    /**
+     * L'id de la catégorie pour laquelle les miniatures doivent être affichées
+     */
+    private Integer categoryId;
+
+    /**
+     * Constructeur
+     * @param categoryId l'id de la catégorie
+     */
+    public ThumbnailCategoryPanel(Integer categoryId) {
+	this.categoryId = categoryId;
+	this.setLayout(new FlowLayout());
+	this.setPreferredSize(new Dimension(1000, 750));
+	if (categoryId != null) {
+	    rafraichir(categoryId, false);
+	}
+	//gestion du drag'n drop
+	new FileDrop(System.out, this, new FileDrop.Listener() {
+	    public void filesDropped(final java.io.File[] files) {
+		for (int i = 0; i < files.length; i++) {
+		    try {
+			ImageService.getInstance().creer(files[i].getCanonicalPath(), getCategoryId());
+			//on rafraichit
+			rafraichir(getCategoryId(), true);
+		    } catch (Exception e) {
+			LOG.error(Outil.getStackTrace(e));
+			//s'il y a une erreur lors de l'envoi
+			JOptionPane.showMessageDialog(null, Messages.getMessage("sendingError") + files[i].getName(),
+				Messages.getMessage("error"), JOptionPane.ERROR_MESSAGE);
+		    }
+		}
+
+	    }
+	});
+
+    }
+
+    /**
+     * rafraichissement, afin d'afficher les nouvelles images
+     * @param categoryId
+     */
+    public void rafraichir(Integer categoryId, boolean rafraichir) {
+	this.categoryId = categoryId;
+	this.removeAll();
+	try {
+	    ImagesManagement.LIST_IMAGE = ImageService.getInstance().listerParCategory(categoryId, rafraichir);
+	    for (Image image : ImagesManagement.LIST_IMAGE) {
+		try {
+		    //		    MiniatureLabel label = new MiniatureLabel(image, this);
+		    ThumbnailPanel panel = new ThumbnailPanel(image);
+		    this.add(panel);
+		} catch (Exception e) {
+
+		}
+	    }
+	    this.repaint();
+	    this.revalidate();
+	} catch (Exception e) {
+	    LOG.error(Outil.getStackTrace(e));
+	    JOptionPane.showMessageDialog(null, Messages.getMessage("imagesListingError"),
+		    Messages.getMessage("error"), JOptionPane.ERROR_MESSAGE);
+	}
+    }
+
+    /**
+     * @return the categoryId
+     */
+    public Integer getCategoryId() {
+	return categoryId;
+    }
+
+    /**
+     * @param categoryId the categoryId to set
+     */
+    public void setCategoryId(Integer categoryId) {
+	this.categoryId = categoryId;
+    }
+
+}
Index: extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/mainframe/ThumbnailPanel.java
===================================================================
--- extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/mainframe/ThumbnailPanel.java	(revision 6831)
+++ extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/mainframe/ThumbnailPanel.java	(revision 6831)
@@ -0,0 +1,120 @@
+package fr.mael.jiwigo.ui.mainframe;
+
+import java.awt.Cursor;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+
+import javax.swing.JLabel;
+
+import fr.mael.jiwigo.om.Image;
+import fr.mael.jiwigo.ui.ImagesManagement;
+import fr.mael.jiwigo.ui.browser.BrowserFrame;
+
+/**
+   Copyright (c) 2010, Mael
+   All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions are met:
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+    * Neither the name of jiwigo nor the
+      names of its contributors may be used to endorse or promote products
+      derived from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+   ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+   DISCLAIMED. IN NO EVENT SHALL Mael BE LIABLE FOR ANY
+   DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+   LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+   ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+   
+ * @author mael
+ * Panel contenant la miniature d'une image.
+ * C'est un panel "cliquable", qui permet d'afficher l'image à taille réelle
+ */
+public class ThumbnailPanel extends JLabel implements MouseListener {
+    /**
+     * Logger
+     */
+    public static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory
+	    .getLog(ThumbnailPanel.class);
+    /**
+     * l'image
+     */
+    private Image image;
+
+    /**
+     * Constructeur
+     * @param image l'image
+     * @param imagesPanel le panel
+     */
+    public ThumbnailPanel(Image image) {
+	this.image = image;
+	this.addMouseListener(this);
+    }
+
+    protected void paintComponent(Graphics g) {
+	super.paintComponent(g);
+	Graphics2D g2 = (Graphics2D) g;
+	g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);
+	double x = (getWidth() * ImagesManagement.getMiniatureBufferedImage(image).getWidth()) / 2;
+	double y = (getHeight() * ImagesManagement.getMiniatureBufferedImage(image).getHeight()) / 2;
+	g2.drawRenderedImage(ImagesManagement.getMiniatureBufferedImage(image), null);
+    }
+
+    /* (non-Javadoc)
+     * @see javax.swing.JComponent#getPreferredSize()
+     */
+    public Dimension getPreferredSize() {
+	int w = (int) (ImagesManagement.getMiniatureBufferedImage(image).getWidth());
+	int h = (int) (ImagesManagement.getMiniatureBufferedImage(image).getHeight());
+	return new Dimension(w, h);
+    }
+
+    @Override
+    public void mouseClicked(MouseEvent paramMouseEvent) {
+	// on affiche l'image en grand
+	ImagesManagement.setCurrentImage(image);
+	try {
+	    new BrowserFrame(image);
+	} catch (Exception e) {
+
+	}
+
+    }
+
+    @Override
+    public void mouseEntered(MouseEvent paramMouseEvent) {
+	//changement du curseur, pour signifier à l'utilisateur que l'image est cliquable
+	this.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
+    }
+
+    @Override
+    public void mouseExited(MouseEvent paramMouseEvent) {
+    }
+
+    @Override
+    public void mousePressed(MouseEvent paramMouseEvent) {
+	// TODO Auto-generated method stub
+
+    }
+
+    @Override
+    public void mouseReleased(MouseEvent paramMouseEvent) {
+	// TODO Auto-generated method stub
+
+    }
+
+}
Index: extensions/jiwigo/trunk/src/main/resources/fr/mael/jiwigo/trad/messages.properties
===================================================================
--- extensions/jiwigo/trunk/src/main/resources/fr/mael/jiwigo/trad/messages.properties	(revision 6831)
+++ extensions/jiwigo/trunk/src/main/resources/fr/mael/jiwigo/trad/messages.properties	(revision 6831)
@@ -0,0 +1,78 @@
+#####################################################
+#################### General ########################
+#####################################################
+error=Error
+welcomeMessage=Welcome to Jiwigo
+version=0.11b
+commentaires=Comments
+loading=Loading...
+titleBrowser=Jiwigo :: Files browser
+cancel=Cancel
+
+#####################################################
+################### Main Frame ######################
+#####################################################
+mainFrame_editionMenu=Edition
+mainFrame_preferencesMenu=Preferences
+
+#####################################################
+################## Preferences ######################
+#####################################################
+preferences_tabImage=Images
+preferences_imagesSize=Images size
+preferences_chunkSize=Chunks size (Mb)
+
+
+#####################################################
+#################### Errors  ########################
+#####################################################
+sendingError=Error sending
+categoryCreationError=Error creating category
+emptyCommentError=Unable to send an empty comment
+addCommentError=Error adding the comment
+treeCreationError=Error creating categories tree
+commentListingError=Error getting comments
+imagesListingError=Error getting images
+configDefaultCreation=Error creating default configuration files
+preferencesCheckValues=Please check the values
+preferencesUnexpectedError=<html>An unexpected error happened. Preferences won't be updated</html>
+
+#####################################################
+#################### Success ########################
+#####################################################
+sendingSuccess=Sending success
+
+#####################################################
+#################### Categories######################
+#####################################################
+categories_add=Add a category
+categories_update=Refresh
+categories_enterName=Fill the category name
+
+
+#####################################################
+############### Connection dialog ###################
+#####################################################
+connexionDialog_urlSite=Site url
+connexionDialog_login=Login
+connexionDialog_pass=Password
+connexionDialog_emptyField=You must fill all field
+connexionDialog_connexionError=<html><center>Error<br/>Check the fields<br/>(The url must contain "http://")</center></html>
+connexionDialog_sauvegarder=<html><center>Sauvegarder les informations.<br/> <u>Attention</u> Les informations sont stockées<br/> en clair sur votre ordinateur.</center></html>
+
+#####################################################
+################ Images browser #####################
+#####################################################
+imageBrowser_file=File
+imageBrowser_display=Display
+imageBrowser_image=Image
+imageBrowser_save=Save as
+imageBrowser_print=Print
+imageBrowser_close=Close
+imageBrowser_zoomPlus=Zoom +
+imageBrowser_zoomMoins=Zoom -
+imageBrowser_zoomNormal=Original size
+imageBrowser_flipH=Horizontal flip
+imageBrowser_flipV=Vertical flip
+imageBrowser_rotationL=Rotate to left
+imageBrowser_rotationR=Rotate to right
Index: extensions/jiwigo/trunk/src/main/resources/fr/mael/jiwigo/trad/messages_fr.properties
===================================================================
--- extensions/jiwigo/trunk/src/main/resources/fr/mael/jiwigo/trad/messages_fr.properties	(revision 6830)
+++ extensions/jiwigo/trunk/src/main/resources/fr/mael/jiwigo/trad/messages_fr.properties	(revision 6831)
@@ -8,4 +8,19 @@
 loading=Chargement...
 titleBrowser=Jiwigo :: Navigateur de fichiers
+cancel=Annuler
+
+#####################################################
+################### Main Frame ######################
+#####################################################
+mainFrame_editionMenu=Edition
+mainFrame_preferencesMenu=Préférences
+
+#####################################################
+################## Preferences ######################
+#####################################################
+preferences_tabImage=Images
+preferences_imagesSize=Taille des images
+preferences_chunkSize=Taille des "morceaux" (en Mo)
+
 
 #####################################################
@@ -20,4 +35,6 @@
 imagesListingError=Erreur lors de la récupération des images
 configDefaultCreation=Erreur lors de la création des fichiers de configuration par défaut
+preferencesCheckValues=Veuillez vérifier les valeurs entrées
+preferencesUnexpectedError=<html>Une erreur inattendue s'est produite. Les préférences ne seront<br/>probablement pas mises à jour</html>
 
 #####################################################
