Index: /extensions/jiwigo/trunk/.classpath
===================================================================
--- /extensions/jiwigo/trunk/.classpath	(revision 9384)
+++ /extensions/jiwigo/trunk/.classpath	(revision 9385)
@@ -14,4 +14,5 @@
   <classpathentry kind="var" path="M2_REPO/com/jhlabs/filters/2.0.235/filters-2.0.235.jar"/>
   <classpathentry kind="var" path="M2_REPO/org/jdom/jdom/1.1/jdom-1.1.jar"/>
+  <classpathentry kind="src" path="/jiwigo-ws-api"/>
   <classpathentry kind="var" path="M2_REPO/junit/junit/4.8.1/junit-4.8.1.jar"/>
   <classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.16/log4j-1.2.16.jar"/>
Index: /extensions/jiwigo/trunk/.project
===================================================================
--- /extensions/jiwigo/trunk/.project	(revision 9384)
+++ /extensions/jiwigo/trunk/.project	(revision 9385)
@@ -2,5 +2,7 @@
   <name>Jiwigo</name>
   <comment>NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
-  <projects/>
+  <projects>
+    <project>jiwigo-ws-api</project>
+  </projects>
   <buildSpec>
     <buildCommand>
Index: /extensions/jiwigo/trunk/pom.xml
===================================================================
--- /extensions/jiwigo/trunk/pom.xml	(revision 9384)
+++ /extensions/jiwigo/trunk/pom.xml	(revision 9385)
@@ -4,10 +4,16 @@
   <artifactId>Jiwigo</artifactId>
   <version>0.13</version>
-  
 
-  
+	<repositories>
+		<repository>
+			<id>mael-repos</id>
+			<name>Mael Repository</name>
+			<url>http://maven.le-guevel.com/artifactory/libs-release-local/</url>
+		</repository>
+	</repositories>
+
   <dependencies>
 
-		
+
 	<dependency>
 	    <groupId>org.jdom</groupId>
@@ -49,5 +55,5 @@
 	    <artifactId>filedrop</artifactId>
 	    <version>1.0</version>
-	</dependency>	
+	</dependency>
 	<dependency>
 	    <groupId>junit</groupId>
@@ -60,22 +66,13 @@
 	    <version>1.6.1</version>
 	</dependency>
-	
+	<dependency>
+	    <groupId>fr.mael.jiwigo</groupId>
+	    <artifactId>jiwigo-ws-api</artifactId>
+	    <version>0.13</version>
+	</dependency>
+
   </dependencies>
-  
+
   <build>
-<!--    <plugins>-->
-<!--      <plugin>-->
-<!--        <groupId>org.apache.maven.plugins</groupId>-->
-<!--        <artifactId>maven-jar-plugin</artifactId>-->
-<!--        <configuration>-->
-<!--          <archive>-->
-<!--            <manifest>-->
-<!--              <addClasspath>true</addClasspath>-->
-<!--              <mainClass>fr.mael.jiwigo.Main</mainClass>-->
-<!--            </manifest>-->
-<!--          </archive>-->
-<!--        </configuration>-->
-<!--      </plugin>-->
-<!--    </plugins>-->
     <plugins>
       <plugin>
Index: tensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/enumeration/CacheEnum.java
===================================================================
--- /extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/enumeration/CacheEnum.java	(revision 9384)
+++ 	(revision )
@@ -1,49 +1,0 @@
-/**
- * 
- */
-package fr.mael.jiwigo.transverse.enumeration;
-
-/**
-   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 enum CacheEnum {
-
-    MAX_IMAGES_IN_IMAGE_DAO(10);
-
-    protected Integer nb;
-
-    /** Constructeur */
-    CacheEnum(Integer pNb) {
-	this.nb = pNb;
-    }
-
-    public Integer getNb() {
-	return this.nb;
-    }
-}
Index: tensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/enumeration/CategoryEnum.java
===================================================================
--- /extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/enumeration/CategoryEnum.java	(revision 9384)
+++ 	(revision )
@@ -1,50 +1,0 @@
-/**
- * 
- */
-package fr.mael.jiwigo.transverse.enumeration;
-
-/**
-   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 enum CategoryEnum {
-
-    ID("id"), NB_IMAGES("nb_images"), NB_TOTAL_IMAGES("total_nb_images"), URL("url"), NAME("name"), CAT_MERES(
-	    "uppercats");
-
-    protected String label;
-
-    /** Constructeur */
-    CategoryEnum(String pLabel) {
-	this.label = pLabel;
-    }
-
-    public String getLabel() {
-	return this.label;
-    }
-}
Index: tensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/enumeration/MethodsEnum.java
===================================================================
--- /extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/enumeration/MethodsEnum.java	(revision 9384)
+++ 	(revision )
@@ -1,53 +1,0 @@
-/**
- * 
- */
-package fr.mael.jiwigo.transverse.enumeration;
-
-/**
-   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.
-   
- * Lists the methods of the webservice
- * @author mael
- *
- */
-public enum MethodsEnum {
-
-    LOGIN("pwg.session.login"), LISTER_CATEGORIES("pwg.categories.getList"), LISTER_IMAGES("pwg.categories.getImages"), GET_INFO(
-	    "pwg.images.getInfo"), AJOUTER_CATEGORIE("pwg.categories.add"), AJOUTER_COMMENTAIRE("pwg.images.addComment"), LISTER_TAGS(
-	    "pwg.tags.getList"), TAGS_ADMIN_LIST("pwg.tags.getAdminList"), ADD_TAG("pwg.tags.add"), SET_INFO(
-	    "pwg.images.setInfo"), SEARCH("pwg.images.search"), SET_PRIVACY_LEVEL("pwg.images.setPrivacyLevel");
-
-    protected String label;
-
-    /** Constructeur */
-    MethodsEnum(String pLabel) {
-	this.label = pLabel;
-    }
-
-    public String getLabel() {
-	return this.label;
-    }
-}
Index: tensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/enumeration/TagEnum.java
===================================================================
--- /extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/enumeration/TagEnum.java	(revision 9384)
+++ 	(revision )
@@ -1,49 +1,0 @@
-/**
- * 
- */
-package fr.mael.jiwigo.transverse.enumeration;
-
-/**
-   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 enum TagEnum {
-
-    ID("id"), NAME("name");
-
-    protected String label;
-
-    /** Constructeur */
-    TagEnum(String pLabel) {
-	this.label = pLabel;
-    }
-
-    public String getLabel() {
-	return this.label;
-    }
-}
Index: tensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/util/ImagesUtil.java
===================================================================
--- /extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/util/ImagesUtil.java	(revision 9384)
+++ 	(revision )
@@ -1,238 +1,0 @@
-package fr.mael.jiwigo.transverse.util;
-
-import java.awt.Graphics;
-import java.awt.Graphics2D;
-import java.awt.GraphicsConfiguration;
-import java.awt.GraphicsDevice;
-import java.awt.GraphicsEnvironment;
-import java.awt.HeadlessException;
-import java.awt.Image;
-import java.awt.RenderingHints;
-import java.awt.Transparency;
-import java.awt.image.BufferedImage;
-import java.awt.image.ColorModel;
-import java.awt.image.PixelGrabber;
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Iterator;
-
-import javax.imageio.IIOImage;
-import javax.imageio.ImageIO;
-import javax.imageio.ImageWriteParam;
-import javax.imageio.ImageWriter;
-import javax.imageio.stream.FileImageOutputStream;
-import javax.swing.ImageIcon;
-
-/**
-   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 ImagesUtil {
-    /**
-     * Logger
-     */
-    public static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory
-	    .getLog(ImagesUtil.class);
-
-    /**
-     * rotates an image
-     * @param image the image to rotate
-     * @param angle the angle of rotation
-     * @return the rotated image
-     */
-    public static BufferedImage rotate(BufferedImage image, double angle) {
-	GraphicsConfiguration gc = getDefaultConfiguration();
-	double sin = Math.abs(Math.sin(angle)), cos = Math.abs(Math.cos(angle));
-	int w = image.getWidth(), h = image.getHeight();
-	int neww = (int) Math.floor(w * cos + h * sin), newh = (int) Math.floor(h * cos + w * sin);
-	int transparency = image.getColorModel().getTransparency();
-	BufferedImage result = gc.createCompatibleImage(neww, newh, transparency);
-	Graphics2D g = result.createGraphics();
-	g.translate((neww - w) / 2, (newh - h) / 2);
-	g.rotate(angle, w / 2, h / 2);
-	g.drawRenderedImage(image, null);
-	return result;
-    }
-
-    /**
-     * @return
-     */
-    public static GraphicsConfiguration getDefaultConfiguration() {
-	GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
-	GraphicsDevice gd = ge.getDefaultScreenDevice();
-	return gd.getDefaultConfiguration();
-    }
-
-    /**
-     * Writes an image in a file
-     * @param file the file
-     * @param bufferedImage the image
-     * @throws IOException
-     */
-    public static void writeImageToPNG(File file, BufferedImage bufferedImage) throws IOException {
-	ImageIO.write(bufferedImage, "png", file);
-    }
-
-    /**
-     * scales an image
-     * @param filePath the path to the file of the image
-     * @param tempName the name of the resulting file
-     * @param width the width
-     * @param height the height
-     * @return true if successful
-     * @throws Exception
-     */
-    public static boolean scale(String filePath, String tempName, int width, int height) throws Exception {
-	File file = new File(filePath);
-	InputStream imageStream = new BufferedInputStream(new FileInputStream(filePath));
-	Image image = (Image) ImageIO.read(imageStream);
-
-	double thumbRatio = (double) width / (double) height;
-	int imageWidth = image.getWidth(null);
-	int imageHeight = image.getHeight(null);
-	if (imageWidth < width || imageHeight < height) {
-	    return false;
-	}
-	double imageRatio = (double) imageWidth / (double) imageHeight;
-	if (thumbRatio < imageRatio) {
-	    height = (int) (width / imageRatio);
-	} else {
-	    width = (int) (height * imageRatio);
-	}
-	BufferedImage thumbImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
-	Graphics2D graphics2D = thumbImage.createGraphics();
-	graphics2D.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
-	graphics2D.drawImage(image, 0, 0, width, height, null);
-
-	//	ImageIO.write(thumbImage, "jpg", new FileOutputStream(System.getProperty("java.io.tmpdir") + "/" + tempName));
-	saveImage(System.getProperty("java.io.tmpdir") + "/" + tempName, thumbImage);
-	return true;
-
-    }
-
-    /**
-     * Save an image
-     * @param fileName the name of the file
-     * @param img the img
-     * @throws FileNotFoundException
-     * @throws IOException
-     */
-    private static void saveImage(String fileName, BufferedImage img) throws FileNotFoundException, IOException {
-	Iterator iter = ImageIO.getImageWritersByFormatName("jpeg");
-	ImageWriter writer = (ImageWriter) iter.next();
-	ImageWriteParam iwp = writer.getDefaultWriteParam();
-	iwp.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
-	iwp.setCompressionQuality(1);
-	File outputfile = new File(fileName);
-	FileImageOutputStream output = new FileImageOutputStream(outputfile);
-	writer.setOutput(output);
-	IIOImage outimage = new IIOImage(img, null, null);
-	writer.write(null, outimage, iwp);
-	writer.dispose();
-    }
-
-    // This method returns a buffered image with the contents of an image
-    public static BufferedImage toBufferedImage(Image image) {
-	if (image instanceof BufferedImage) {
-	    return (BufferedImage) image;
-	}
-
-	// This code ensures that all the pixels in the image are loaded
-	image = new ImageIcon(image).getImage();
-
-	// Determine if the image has transparent pixels; for this method's
-	// implementation, see Determining If an Image Has Transparent Pixels
-	boolean hasAlpha = hasAlpha(image);
-
-	// Create a buffered image with a format that's compatible with the screen
-	BufferedImage bimage = null;
-	GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
-	try {
-	    // Determine the type of transparency of the new buffered image
-	    int transparency = Transparency.OPAQUE;
-	    if (hasAlpha) {
-		transparency = Transparency.BITMASK;
-	    }
-
-	    // Create the buffered image
-	    GraphicsDevice gs = ge.getDefaultScreenDevice();
-	    GraphicsConfiguration gc = gs.getDefaultConfiguration();
-	    bimage = gc.createCompatibleImage(image.getWidth(null), image.getHeight(null), transparency);
-	} catch (HeadlessException e) {
-	    // The system does not have a screen
-	}
-
-	if (bimage == null) {
-	    // Create a buffered image using the default color model
-	    int type = BufferedImage.TYPE_INT_RGB;
-	    if (hasAlpha) {
-		type = BufferedImage.TYPE_INT_ARGB;
-	    }
-	    bimage = new BufferedImage(image.getWidth(null), image.getHeight(null), type);
-	}
-
-	// Copy image to buffered image
-	Graphics g = bimage.createGraphics();
-
-	// Paint the image onto the buffered image
-	g.drawImage(image, 0, 0, null);
-	g.dispose();
-
-	return bimage;
-    }
-
-    /**
-     *  This method returns true if the specified image has transparent pixels
-     * @param image the image to check
-     * @return true or false
-     */
-    public static boolean hasAlpha(Image image) {
-	// If buffered image, the color model is readily available
-	if (image instanceof BufferedImage) {
-	    BufferedImage bimage = (BufferedImage) image;
-	    return bimage.getColorModel().hasAlpha();
-	}
-
-	// Use a pixel grabber to retrieve the image's color model;
-	// grabbing a single pixel is usually sufficient
-	PixelGrabber pg = new PixelGrabber(image, 0, 0, 1, 1, false);
-	try {
-	    pg.grabPixels();
-	} catch (InterruptedException e) {
-	}
-
-	// Get the image's color model
-	ColorModel cm = pg.getColorModel();
-	return cm.hasAlpha();
-    }
-
-}
Index: tensions/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 9384)
+++ 	(revision )
@@ -1,224 +1,0 @@
-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: tensions/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 9384)
+++ 	(revision )
@@ -1,302 +1,0 @@
-package fr.mael.jiwigo.transverse.util;
-
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.PrintWriter;
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.io.Writer;
-import java.net.URL;
-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;
-import org.jdom.input.SAXBuilder;
-import org.jdom.output.XMLOutputter;
-
-/**
-   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 Outil {
-    /**
-     * Logger
-     */
-    public static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory.getLog(Outil.class);
-
-    /**
-     * Transformation of an inpustream into string.<br/>
-     * useful to read the result of the webservice
-     * @param input the stream
-     * @return the string
-     * @throws IOException
-     */
-    public static String readInputStreamAsString(InputStream input) throws IOException {
-	StringWriter writer = new StringWriter();
-	InputStreamReader streamReader = new InputStreamReader(input);
-	BufferedReader buffer = new BufferedReader(streamReader);
-	String line = "";
-	while (null != (line = buffer.readLine())) {
-	    writer.write(line);
-	}
-	return writer.toString();
-    }
-
-    /**
-     * String to document
-     * @param string the string
-     * @return the corresponding document
-     * @throws JDOMException
-     * @throws IOException
-     */
-    public static Document stringToDocument(String string) throws JDOMException, IOException {
-	SAXBuilder sb = new SAXBuilder();
-	Document doc = sb.build(new StringReader(string));
-	return doc;
-
-    }
-
-    /**
-     * Inputstream to document
-     * @param input the inputStream
-     * @return the document
-     * @throws JDOMException
-     * @throws IOException
-     */
-    public static Document readInputStreamAsDocument(InputStream input) throws JDOMException, IOException {
-	return stringToDocument(readInputStreamAsString(input));
-    }
-
-    /**
-     * Document to string
-     * @param doc the document to transform
-     * @return the string
-     */
-    public static String documentToString(Document doc) {
-	return new XMLOutputter().outputString(doc);
-
-    }
-
-    /**
-     * Function that gets the url of a file
-     * Useful to get the images that are in the jar
-     * @param fileName the path of the file
-     * @return the url of the file
-     */
-    public static URL getURL(String fileName) {
-	URLClassLoader urlLoader = (URLClassLoader) Outil.class.getClassLoader();
-	URL fileLocation = urlLoader.findResource(fileName);
-	return fileLocation;
-    }
-
-    /**
-     * gets the md5 sum of a file
-     * @param filename the path of the file
-     * @return the checksum
-     * @throws Exception
-     */
-    public static String getMD5Checksum(String filename) throws Exception {
-	byte[] b = createChecksum(filename);
-	String result = "";
-	for (int i = 0; i < b.length; i++) {
-	    result += Integer.toString((b[i] & 0xff) + 0x100, 16).substring(1);
-	}
-	return result;
-    }
-
-    /**
-     * Creation of the checksum of a file
-     * @param filename the path of the file
-     * @return the checksum as array byte
-     * @throws Exception
-     */
-    private static byte[] createChecksum(String filename) throws Exception {
-	InputStream fis = new FileInputStream(filename);
-
-	byte[] buffer = new byte[1024];
-	MessageDigest complete = MessageDigest.getInstance("MD5");
-	int numRead;
-	do {
-	    numRead = fis.read(buffer);
-	    if (numRead > 0) {
-		complete.update(buffer, 0, numRead);
-	    }
-	} while (numRead != -1);
-	fis.close();
-	return complete.digest();
-    }
-
-    /**
-     * File to array bytes
-     * @param file the file
-     * @return the array bytes
-     * @throws IOException
-     */
-    public static byte[] getBytesFromFile(File file) throws IOException {
-	InputStream is = new FileInputStream(file);
-	long length = file.length();
-
-	byte[] bytes = new byte[(int) length];
-	int offset = 0;
-	int numRead = 0;
-	while (offset < bytes.length && (numRead = is.read(bytes, offset, bytes.length - offset)) >= 0) {
-	    offset += numRead;
-	}
-
-	if (offset < bytes.length) {
-	    throw new IOException("Could not completely read file " + file.getName());
-	}
-	is.close();
-	return bytes;
-    }
-
-    /**
-     * Function that checks if the webservice response is ok
-     * @param doc the document from the webservice
-     * @return true if ok
-     */
-    public static boolean checkOk(Document doc) {
-	if (doc.getRootElement().getAttributeValue("stat").equals("ok")) {
-	    return true;
-	} else {
-	    LOG.error("Resultat : " + doc.getRootElement().getAttributeValue("stat") + "\nDocument retourné : \n"
-		    + Outil.documentToString(doc));
-	    return false;
-	}
-
-    }
-
-    /**
-     * Exception to string
-     * @param aThrowable exception
-     * @return l'exception en string
-     */
-    public static String getStackTrace(Throwable aThrowable) {
-	final Writer result = new StringWriter();
-	final PrintWriter printWriter = new PrintWriter(result);
-	aThrowable.printStackTrace(printWriter);
-	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();
-    }
-
-    /**
-     * Bytes to file
-     * @param fichier the file path
-     * @param bytes the array bytes
-     * @throws IOException
-     */
-    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/comments/CommentsDialog.java
===================================================================
--- /extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/comments/CommentsDialog.java	(revision 9384)
+++ /extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/comments/CommentsDialog.java	(revision 9385)
@@ -52,5 +52,5 @@
    (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
  * dialog that displays the comments of an image and allows to add one
@@ -89,5 +89,5 @@
 
     /**
-     * Scrollpane  
+     * Scrollpane
      */
     private JScrollPane scrollPaneArea;
@@ -123,5 +123,5 @@
 	this.getContentPane().removeAll();
 	try {
-	    List<Comment> commentsForImage = CommentService.getInstance().lister(imageId);
+	    List<Comment> commentsForImage = CommentService.getInstance(Main.sessionManager).lister(imageId);
 	    GridBagConstraints c = new GridBagConstraints();
 	    c.insets = new Insets(3, 3, 3, 3);
@@ -167,5 +167,6 @@
 	    boolean reussite = true;
 	    try {
-		reussite = CommentService.getInstance().creer(text, this.imageId, Main.sessionManager.getLogin());
+		reussite = CommentService.getInstance(Main.sessionManager).creer(text, this.imageId,
+			Main.sessionManager.getLogin());
 	    } catch (IOException e) {
 		reussite = false;
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 9384)
+++ /extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/mainframe/CategoriesTree.java	(revision 9385)
@@ -22,4 +22,5 @@
 import javax.swing.tree.TreeSelectionModel;
 
+import fr.mael.jiwigo.Main;
 import fr.mael.jiwigo.om.Category;
 import fr.mael.jiwigo.service.CategoryService;
@@ -52,5 +53,5 @@
    (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
  * Arbre des catégories
@@ -133,10 +134,10 @@
     /**
      * creation of the nodes
-     * @param root the root 
+     * @param root the root
      */
     private void createNodes(DefaultMutableTreeNode root) {
 	DefaultMutableTreeNode category = null;
 	try {
-	    List<Category> list = CategoryService.getInstance().makeTree();
+	    List<Category> list = CategoryService.getInstance(Main.sessionManager).makeTree();
 	    for (Category cat : list) {
 		if (cat.getCategoriesMeres().size() == 0) {
@@ -228,5 +229,6 @@
 		if (selectedCategory != null) {
 		    //try to create a category
-		    if (CategoryService.getInstance().creer(nomcategorie, selectedCategory.getIdentifiant())) {
+		    if (CategoryService.getInstance(Main.sessionManager).creer(nomcategorie,
+			    selectedCategory.getIdentifiant())) {
 			setUpUi();
 		    } else {
@@ -236,5 +238,5 @@
 		    }
 		} else {
-		    if (CategoryService.getInstance().creer(nomcategorie)) {
+		    if (CategoryService.getInstance(Main.sessionManager).creer(nomcategorie)) {
 			setUpUi();
 		    } else {
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 9384)
+++ /extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/mainframe/ThumbnailCategoryPanel.java	(revision 9385)
@@ -10,11 +10,14 @@
 import javax.swing.JPanel;
 
+import fr.mael.jiwigo.Main;
 import fr.mael.jiwigo.om.Category;
 import fr.mael.jiwigo.om.Image;
 import fr.mael.jiwigo.service.ImageService;
 import fr.mael.jiwigo.transverse.ImagesManagement;
+import fr.mael.jiwigo.transverse.enumeration.PreferencesEnum;
 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.transverse.util.preferences.PreferencesManagement;
 import fr.mael.jiwigo.ui.layout.VerticalLayout;
 
@@ -44,5 +47,5 @@
    (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
  * Class that display the thumbnails of a category
@@ -134,5 +137,6 @@
 	try {
 	    MainFrame.getInstance().setMessage(Messages.getMessage("thumbviewer_loading"));
-	    imagesManagement.setListImage(ImageService.getInstance().listerParCategory(categoryId, rafraichir));
+	    imagesManagement.setListImage(ImageService.getInstance(Main.sessionManager).listerParCategory(categoryId,
+		    rafraichir));
 	    addThumbnails();
 	    this.repaint();
@@ -155,5 +159,6 @@
 	JPanel panelh = new JPanel(new FlowLayout());
 	try {
-	    imagesManagement.setListImage(ImageService.getInstance().listerParCategory(categoryId, false));
+	    imagesManagement.setListImage(ImageService.getInstance(Main.sessionManager).listerParCategory(categoryId,
+		    false));
 	} catch (IOException e1) {
 	    e1.printStackTrace();
@@ -229,6 +234,13 @@
 		int nbProgressBar = ((i + 1) * 100) / files.length;
 		try {
-
-		    ImageService.getInstance().creer(files[i].getCanonicalPath(), categoryId);
+		    Integer widthOriginal = Integer.valueOf(PreferencesManagement
+			    .getValue(PreferencesEnum.WIDTH_ORIGINALE.getLabel()));
+		    Integer heightOriginal = Integer.valueOf(PreferencesManagement
+			    .getValue(PreferencesEnum.HEIGHT_ORIGINAL.getLabel()));
+		    Double chunkSize = Double.valueOf(PreferencesManagement.getValue(PreferencesEnum.CHUNK_SIZE
+			    .getLabel()));
+
+		    ImageService.getInstance(Main.sessionManager).creer(files[i].getCanonicalPath(), categoryId,
+			    widthOriginal, heightOriginal, chunkSize, imagesManagement.getPrivacyLevel());
 		    MainFrame.getInstance()
 			    .setMessage(files[i].getName() + " " + Messages.getMessage("sendingSuccess"));
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 9384)
+++ /extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/mainframe/ThumbnailPanel.java	(revision 9385)
@@ -26,4 +26,5 @@
 import javax.swing.ListSelectionModel;
 
+import fr.mael.jiwigo.Main;
 import fr.mael.jiwigo.om.Image;
 import fr.mael.jiwigo.om.Tag;
@@ -60,5 +61,5 @@
    (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 that contains the thumbnail of an image
@@ -172,9 +173,9 @@
 	    try {
 		//getting the list of tags
-		List<Tag> tagsDispo = TagService.getInstance().lister();
+		List<Tag> tagsDispo = TagService.getInstance(Main.sessionManager).lister();
 		//list to array (cause fucking JList does not support Lists)
 		Tag[] tableauTagDispo = (Tag[]) tagsDispo.toArray(new Tag[tagsDispo.size()]);
 		//getting the image's tags to preselect them
-		List<Tag> tagsDeLimage = TagService.getInstance().tagsForImage(image);
+		List<Tag> tagsDeLimage = TagService.getInstance(Main.sessionManager).tagsForImage(image);
 		listTags = new JList(tableauTagDispo);
 		//multiple selection is allowed
@@ -220,5 +221,5 @@
 	    tagIds.deleteCharAt(tagIds.lastIndexOf(","));
 	    try {
-		if (!ImageService.getInstance().addTags(image, tagIds.toString())) {
+		if (!ImageService.getInstance(Main.sessionManager).addTags(image, tagIds.toString())) {
 		    JOptionPane.showMessageDialog(this, Messages.getMessage("addingTagsError"), Messages
 			    .getMessage("error"), JOptionPane.ERROR_MESSAGE);
Index: /extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/mainframe/ThumbnailSearchPanel.java
===================================================================
--- /extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/mainframe/ThumbnailSearchPanel.java	(revision 9384)
+++ /extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/mainframe/ThumbnailSearchPanel.java	(revision 9385)
@@ -6,4 +6,5 @@
 import javax.swing.JPanel;
 
+import fr.mael.jiwigo.Main;
 import fr.mael.jiwigo.om.Category;
 import fr.mael.jiwigo.om.Image;
@@ -39,5 +40,5 @@
    (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
@@ -89,5 +90,6 @@
 	try {
 	    MainFrame.getInstance().setMessage(Messages.getMessage("thumbviewer_loading"));
-	    ImagesManagement.getInstance().setListImage(ImageService.getInstance().search(queryString));
+	    ImagesManagement.getInstance().setListImage(
+		    ImageService.getInstance(Main.sessionManager).search(queryString));
 	    for (Image image : ImagesManagement.getInstance().getListImage()) {
 		try {
Index: /extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/mainframe/thread/ThreadPhotoSending.java
===================================================================
--- /extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/mainframe/thread/ThreadPhotoSending.java	(revision 9384)
+++ /extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/mainframe/thread/ThreadPhotoSending.java	(revision 9385)
@@ -5,6 +5,10 @@
 import javax.swing.JOptionPane;
 
+import fr.mael.jiwigo.Main;
 import fr.mael.jiwigo.service.ImageService;
+import fr.mael.jiwigo.transverse.ImagesManagement;
+import fr.mael.jiwigo.transverse.enumeration.PreferencesEnum;
 import fr.mael.jiwigo.transverse.util.Messages;
+import fr.mael.jiwigo.transverse.util.preferences.PreferencesManagement;
 import fr.mael.jiwigo.ui.mainframe.MainFrame;
 import fr.mael.jiwigo.ui.mainframe.ThumbnailCategoryPanel;
@@ -53,7 +57,15 @@
 	    int nbProgressBar = ((i + 1) * 100) / files.length;
 	    try {
+		Integer widthOriginal = Integer.valueOf(PreferencesManagement.getValue(PreferencesEnum.WIDTH_ORIGINALE
+			.getLabel()));
+		Integer heightOriginal = Integer.valueOf(PreferencesManagement.getValue(PreferencesEnum.HEIGHT_ORIGINAL
+			.getLabel()));
+		Double chunkSize = Double
+			.valueOf(PreferencesManagement.getValue(PreferencesEnum.CHUNK_SIZE.getLabel()));
 		MainFrame.getInstance().setAdditionalMessage(
 			Messages.getMessage("file") + " " + (i + 1) + "/" + files.length + " : ");
-		ImageService.getInstance().creer(files[i].getCanonicalPath(), thumbPanel.getCategoryId());
+		ImageService.getInstance(Main.sessionManager).creer(files[i].getCanonicalPath(),
+			thumbPanel.getCategoryId(), widthOriginal, heightOriginal, chunkSize,
+			ImagesManagement.getInstance().getPrivacyLevel());
 		MainFrame.getInstance().setMessage(files[i].getName() + " " + Messages.getMessage("sendingSuccess"));
 	    } catch (Exception e) {
Index: /extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/search/DialogChooseCategory.java
===================================================================
--- /extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/search/DialogChooseCategory.java	(revision 9384)
+++ /extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/search/DialogChooseCategory.java	(revision 9385)
@@ -14,11 +14,15 @@
 import javax.swing.JLabel;
 
+import fr.mael.jiwigo.Main;
 import fr.mael.jiwigo.om.Category;
 import fr.mael.jiwigo.service.CategoryService;
 import fr.mael.jiwigo.service.ImageService;
+import fr.mael.jiwigo.transverse.ImagesManagement;
+import fr.mael.jiwigo.transverse.enumeration.PreferencesEnum;
+import fr.mael.jiwigo.transverse.util.preferences.PreferencesManagement;
 import fr.mael.jiwigo.ui.mainframe.MainFrame;
 
 /**
- * 
+ *
    Copyright (c) 2010, Mael
    All rights reserved.
@@ -45,7 +49,7 @@
    (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
- * Renderer used to display the category list with a hierarchy 
+ * Renderer used to display the category list with a hierarchy
  *
  */
@@ -83,5 +87,5 @@
 	comboCategories.setRenderer(new ComboCategoryRenderer());
 	try {
-	    categories = CategoryService.getInstance().makeTree();
+	    categories = CategoryService.getInstance(Main.sessionManager).makeTree();
 	    createCategoriesTree();
 	} catch (IOException e) {
@@ -147,5 +151,13 @@
 	    for (File file : filesToSend) {
 		try {
-		    ImageService.getInstance().creer(file.getAbsolutePath(), category.getIdentifiant());
+		    Integer widthOriginal = Integer.valueOf(PreferencesManagement
+			    .getValue(PreferencesEnum.WIDTH_ORIGINALE.getLabel()));
+		    Integer heightOriginal = Integer.valueOf(PreferencesManagement
+			    .getValue(PreferencesEnum.HEIGHT_ORIGINAL.getLabel()));
+		    Double chunkSize = Double.valueOf(PreferencesManagement.getValue(PreferencesEnum.CHUNK_SIZE
+			    .getLabel()));
+		    ImageService.getInstance(Main.sessionManager).creer(file.getAbsolutePath(),
+			    category.getIdentifiant(), widthOriginal, heightOriginal, chunkSize,
+			    ImagesManagement.getInstance().getPrivacyLevel());
 		} catch (Exception e) {
 		    e.printStackTrace();
Index: /extensions/jiwigo/trunk/src/main/resources/temp.xml
===================================================================
--- /extensions/jiwigo/trunk/src/main/resources/temp.xml	(revision 9384)
+++ /extensions/jiwigo/trunk/src/main/resources/temp.xml	(revision 9385)
@@ -1,36 +1,38 @@
-<?xml version="1.0" encoding="utf-8" ?>
 <rsp stat="ok">
-	<image id="83" file="SNC00223.jpg" date_available="2010-08-24 21:44:09"
-		date_creation="0000-00-00" tn_ext="jpg" author="Danièle" hit="3"
-		filesize="205" width="640" height="480" date_metadata_update="2010-08-24"
-		level="0" md5sum="a0bdd501070f75fce94e7007d5dfbd8c"
-		tn_url="http://www.le-guevel.com/piwigo/upload/2010/08/24/thumbnail/TN-20100824214409-8fb71afd.jpg"
-		element_url="http://www.le-guevel.com/piwigo/upload/2010/08/24/20100824214409-8fb71afd.jpg">
-		<name>SNC00223</name>
+	<image id="20" file="20100919131731-692df26f.jpg" date_available="2010-09-19 13:17:31"
+		tn_ext="jpg" author="mael" hit="0" filesize="48" width="450" height="475"
+		date_metadata_update="2010-09-19" level="0"
+		md5sum="692df26f3800cc1aab00421d7c29ff4c"
+		tn_url="http://mael.piwigo.com/uploads/y/c/a/ycajh4petv/2010/09/19/thumbnail/TN-20100919131731-692df26f.jpg"
+		element_url="http://mael.piwigo.com/uploads/y/c/a/ycajh4petv/2010/09/19/20100919131731-692df26f.jpg">
+		<name>10</name>
 		<rates count="0" average="" />
 		<categories>
-			<category id="25"
-				url="http://www.le-guevel.com/piwigo/index.php?/category/25"
-				page_url="http://www.le-guevel.com/piwigo/picture.php?/83/category/25">
-				<name>Gouesnach</name>
-				<uppercats>21,25</uppercats>
-				<global_rank>2.2</global_rank>
+			<category id="3"
+				url="http://mael.piwigo.com/index?/category/3-test_de_test_do_not_delete"
+				page_url="http://mael.piwigo.com/picture?/20/category/3-test_de_test_do_not_delete">
+				<name>test de test do not delete</name>
+				<uppercats>1,3</uppercats>
+				<global_rank>1.1</global_rank>
 			</category>
 		</categories>
-		<tags />
-		<comment_post author="admin"
-			key="1283118169:7e9b8049cd926362bb217d7b3316d10b" />
+		<tags>
+			<tag id="1" name="Tag1" url_name="tag1"
+				url="http://mael.piwigo.com/index?/tags/1-tag1" page_url="http://mael.piwigo.com/picture?/20/tags/1-tag1" />
+		</tags>
+		<comment_post author="mael"
+			key="1284919810:82b32b18c9b16d34295f586cd88855f3" />
 		<comments page="0" per_page="10" count="3" nb_comments="3">
-			<comment id="1" date="2010-08-28 21:41:04">
-				<author>admin</author>
-				<content>Test d'un commentaire</content>
+			<comment id="1" date="2010-09-19 15:12:22">
+				<author>mael</author>
+				<content>comment test</content>
 			</comment>
-			<comment id="2" date="2010-08-28 22:06:43">
-				<author>admin</author>
-				<content>Test d'un commentaire 2</content>
+			<comment id="2" date="2010-09-19 15:13:26">
+				<author>mael</author>
+				<content>comment test</content>
 			</comment>
-			<comment id="3" date="2010-08-28 22:29:22">
-				<author>admin</author>
-				<content>Test d'un commentaire 3</content>
+			<comment id="3" date="2010-09-19 15:14:33">
+				<author>mael</author>
+				<content>comment test</content>
 			</comment>
 		</comments>
Index: /extensions/jiwigo/trunk/src/test/java/fr/mael/jiwigo/service/CategoryServiceTest.java
===================================================================
--- /extensions/jiwigo/trunk/src/test/java/fr/mael/jiwigo/service/CategoryServiceTest.java	(revision 9384)
+++ /extensions/jiwigo/trunk/src/test/java/fr/mael/jiwigo/service/CategoryServiceTest.java	(revision 9385)
@@ -8,4 +8,5 @@
 import org.junit.Test;
 
+import fr.mael.jiwigo.Main;
 import fr.mael.jiwigo.TestBase;
 import fr.mael.jiwigo.dao.CategoryDao;
@@ -22,6 +23,6 @@
     public void ListerTest() {
 	try {
-	    CategoryDao.getInstance().lister(true);
-	    CategoryDao.getInstance().lister(false);
+	    CategoryDao.getInstance(Main.sessionManager).lister(true);
+	    CategoryDao.getInstance(Main.sessionManager).lister(false);
 	} catch (IOException e) {
 	    e.printStackTrace();
@@ -35,5 +36,5 @@
     public void creerTest() {
 	Date date = new Date();
-	Assert.assertSame(true, CategoryService.getInstance().creer("Category" + date.getTime()));
+	Assert.assertSame(true, CategoryService.getInstance(Main.sessionManager).creer("Category" + date.getTime()));
     }
 
Index: /extensions/jiwigo/trunk/src/test/java/fr/mael/jiwigo/service/ServicesTest.java
===================================================================
--- /extensions/jiwigo/trunk/src/test/java/fr/mael/jiwigo/service/ServicesTest.java	(revision 9384)
+++ /extensions/jiwigo/trunk/src/test/java/fr/mael/jiwigo/service/ServicesTest.java	(revision 9385)
@@ -5,4 +5,5 @@
 import org.junit.Test;
 
+import fr.mael.jiwigo.Main;
 import fr.mael.jiwigo.TestBase;
 import fr.mael.jiwigo.om.Category;
@@ -18,5 +19,5 @@
     public void testCreer() throws Exception {
 	Category cat = null;
-	for (Category category : CategoryService.getInstance().lister(true)) {
+	for (Category category : CategoryService.getInstance(Main.sessionManager).lister(true)) {
 	    if (category.getIdentifiant().equals(3)) {
 		cat = category;
@@ -24,8 +25,10 @@
 	    }
 	}
-	Image image = ImageService.getInstance().listerParCategory(cat.getIdentifiant(), true).get(0);
-	int firstCount = CommentService.getInstance().lister(image.getIdentifiant()).size();
-	CommentService.getInstance().creer("comment test", image.getIdentifiant(), "none");
-	Assert.assertSame(firstCount + 1, CommentService.getInstance().lister(image.getIdentifiant()).size());
+	Image image = ImageService.getInstance(Main.sessionManager).listerParCategory(cat.getIdentifiant(), true)
+		.get(0);
+	int firstCount = CommentService.getInstance(Main.sessionManager).lister(image.getIdentifiant()).size();
+	CommentService.getInstance(Main.sessionManager).creer("comment test", image.getIdentifiant(), "none");
+	Assert.assertSame(firstCount + 1, CommentService.getInstance(Main.sessionManager)
+		.lister(image.getIdentifiant()).size());
     }
 }
Index: /extensions/jiwigo/trunk/src/test/java/fr/mael/jiwigo/service/TagServiceTest.java
===================================================================
--- /extensions/jiwigo/trunk/src/test/java/fr/mael/jiwigo/service/TagServiceTest.java	(revision 9384)
+++ /extensions/jiwigo/trunk/src/test/java/fr/mael/jiwigo/service/TagServiceTest.java	(revision 9385)
@@ -8,4 +8,5 @@
 import org.junit.Test;
 
+import fr.mael.jiwigo.Main;
 import fr.mael.jiwigo.TestBase;
 import fr.mael.jiwigo.dao.TagDao;
@@ -23,5 +24,5 @@
     public void ListerTest() {
 	try {
-	    TagDao.getInstance().lister();
+	    TagDao.getInstance(Main.sessionManager).lister();
 	} catch (IOException e) {
 	    e.printStackTrace();
@@ -36,5 +37,5 @@
 	Date date = new Date();
 	try {
-	    Assert.assertSame(true, TagService.getInstance().creer("Tag" + date.getTime()));
+	    Assert.assertSame(true, TagService.getInstance(Main.sessionManager).creer("Tag" + date.getTime()));
 	} catch (IOException e) {
 	    // TODO Auto-generated catch block
