Index: /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/ImageDao.java
===================================================================
--- /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/ImageDao.java	(revision 10715)
+++ /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/ImageDao.java	(revision 10716)
@@ -82,3 +82,10 @@
     public void addSimple(File file, Integer category, String title) throws JiwigoException;
 
+    /**
+     * Deletes an image
+     * @param image the image to delete
+     * @throws JiwigoException
+     */
+    public boolean delete(Image image) throws JiwigoException;
+
 }
Index: /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/impl/CategoryDaoImpl.java
===================================================================
--- /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/impl/CategoryDaoImpl.java	(revision 10715)
+++ /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/impl/CategoryDaoImpl.java	(revision 10716)
@@ -116,9 +116,7 @@
     public boolean delete(Category category) throws JiwigoException {
 	//this document will allow to get pwg_token. it is necessary to delete a category
-	Document docStatus = sessionManager.executeReturnDocument(MethodsEnum.SESSION_STATUS.getLabel());
-	String pwgToken = Tools.getStringValueDom(docStatus.getDocumentElement(), "pwg_token");
-	if (pwgToken.equals("")) {
-	    throw new JiwigoException("Error getting pwg_token. Returned document was : "
-		    + Tools.documentToString(docStatus));
+	String pwgToken = sessionManager.getPwgToken();
+	if (pwgToken == null) {
+	    throw new JiwigoException("Error : received a null pwg_token");
 	}
 	if (LOG.isDebugEnabled()) {
Index: /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/impl/ImageDaoImpl.java
===================================================================
--- /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/impl/ImageDaoImpl.java	(revision 10715)
+++ /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/impl/ImageDaoImpl.java	(revision 10716)
@@ -356,4 +356,32 @@
     }
 
+    /** 
+     * @see fr.mael.jiwigo.dao.ImageDao#delete(fr.mael.jiwigo.om.Image)
+     */
+    public boolean delete(Image image) throws JiwigoException {
+	//this document will allow to get pwg_token. it is necessary to delete an image
+	String pwgToken = sessionManager.getPwgToken();
+	if (pwgToken == null) {
+	    throw new JiwigoException("Error : received a null pwg_token");
+	}
+	if (LOG.isDebugEnabled()) {
+	    LOG.debug("Deletes image " + image.getIdentifier() + " with pwg_token = " + pwgToken);
+	}
+
+	Document doc = sessionManager.executeReturnDocument(MethodsEnum.DELETE_IMAGE.getLabel(), "image_id",
+		String.valueOf(image.getIdentifier()), "pwg_token", pwgToken);
+
+	if (LOG.isDebugEnabled()) {
+	    LOG.debug(Tools.documentToString(doc));
+	}
+	try {
+	    return Tools.checkOk(doc);
+	} catch (FileAlreadyExistsException e) {
+	    e.printStackTrace();
+	}
+	return false;
+
+    }
+
     public SessionManager getSessionManager() {
 	return sessionManager;
@@ -363,3 +391,4 @@
 	this.sessionManager = sessionManager;
     }
+
 }
Index: /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/service/ImageService.java
===================================================================
--- /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/service/ImageService.java	(revision 10715)
+++ /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/service/ImageService.java	(revision 10716)
@@ -40,6 +40,5 @@
     public boolean create(String filePath, Integer idCategory, Integer originalWidth, Integer originalHeight,
 	    Double chunckSize, Integer privacyLevel) throws IOException, NoSuchAlgorithmException,
-	    FileAlreadyExistsException, ProxyAuthenticationException, WrongChunkSizeException,
-	    JiwigoException;
+	    FileAlreadyExistsException, ProxyAuthenticationException, WrongChunkSizeException, JiwigoException;
 
     /**
@@ -74,3 +73,10 @@
     public void addSimple(File file, Integer category, String title) throws JiwigoException;
 
+    /**
+     * Deletes an image
+     * @param image the image to delete
+     * @throws JiwigoException
+     */
+    public boolean delete(Image image) throws JiwigoException;
+
 }
Index: /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/service/impl/ImageServiceImpl.java
===================================================================
--- /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/service/impl/ImageServiceImpl.java	(revision 10715)
+++ /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/service/impl/ImageServiceImpl.java	(revision 10716)
@@ -73,6 +73,5 @@
     public boolean create(String filePath, Integer idCategory, Integer originalWidth, Integer originalHeight,
 	    Double chunckSize, Integer privacyLevel) throws IOException, NoSuchAlgorithmException,
-	    FileAlreadyExistsException, ProxyAuthenticationException, WrongChunkSizeException,
-	    JiwigoException {
+	    FileAlreadyExistsException, ProxyAuthenticationException, WrongChunkSizeException, JiwigoException {
 	File originalFile = new File(filePath);
 	//get the byte array of the original file, to keep metadata
@@ -151,4 +150,13 @@
     }
 
+    public boolean delete(Image image) throws JiwigoException {
+	if (image.getIdentifier() == null) {
+	    throw new JiwigoException("The identifier of the image cannot be null");
+	} else {
+	    return dao.delete(image);
+	}
+
+    }
+
     public ImageDao getDao() {
 	return dao;
Index: /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/enumeration/MethodsEnum.java
===================================================================
--- /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/enumeration/MethodsEnum.java	(revision 10715)
+++ /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/enumeration/MethodsEnum.java	(revision 10716)
@@ -28,5 +28,5 @@
 	    "pwg.images.setInfo"), SEARCH("pwg.images.search"), SET_PRIVACY_LEVEL("pwg.images.setPrivacyLevel"), ADD_SIMPLE(
 	    "pwg.images.addSimple"), ADD_IMAGE("pwg.images.add"), ADD_CHUNK("pwg.images.addChunk"), DELETE_CATEGORY(
-	    "pwg.categories.delete"), SESSION_STATUS("pwg.session.getStatus");
+	    "pwg.categories.delete"), DELETE_IMAGE("pwg.images.delete"), SESSION_STATUS("pwg.session.getStatus");
 
     protected String label;
Index: /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/session/SessionManager.java
===================================================================
--- /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/session/SessionManager.java	(revision 10715)
+++ /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/session/SessionManager.java	(revision 10716)
@@ -127,3 +127,11 @@
      */
     public InputStream getInputStreamFromUrl(String url) throws Exception;
+
+    /**
+     * This method allows to get pwg_token. This string is necessary
+     * to call web service functions like pwg.images.delete and pwg.categories.delete
+     * @return pwg_token
+     */
+    public String getPwgToken() throws JiwigoException;
+
 }
Index: /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/session/impl/SessionManagerImpl.java
===================================================================
--- /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/session/impl/SessionManagerImpl.java	(revision 10715)
+++ /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/session/impl/SessionManagerImpl.java	(revision 10716)
@@ -266,4 +266,17 @@
 
     /**
+     * @see fr.mael.jiwigo.transverse.session.SessionManager#getPwgToken()
+     */
+    public String getPwgToken() throws JiwigoException {
+	Document docStatus = executeReturnDocument(MethodsEnum.SESSION_STATUS.getLabel());
+	String pwgToken = Tools.getStringValueDom(docStatus.getDocumentElement(), "pwg_token");
+	if ("".equals(pwgToken)) {
+	    throw new JiwigoException("Error getting pwg_token. Returned document was : "
+		    + Tools.documentToString(docStatus));
+	}
+	return pwgToken;
+    }
+
+    /**
      * @return the login
      */
