Index: /extensions/PiwigoLib/PiwigoLib/DTO/PwgConfidentLevelEnum.cs
===================================================================
--- /extensions/PiwigoLib/PiwigoLib/DTO/PwgConfidentLevelEnum.cs	(revision 11890)
+++ /extensions/PiwigoLib/PiwigoLib/DTO/PwgConfidentLevelEnum.cs	(revision 11890)
@@ -0,0 +1,23 @@
+﻿using System;
+using System.Xml.Serialization;
+
+namespace Com.Piwigo.Lib.DTO
+{
+
+    [Serializable()]
+    [XmlRoot(ElementName = "PwgConfidentLevelEnum")]
+    public enum PwgConfidentLevelEnum : int
+    {
+        //0 (—-), 1 (Contacts), 2 (Friends), 4 (Family), 8 (Admins)
+        [XmlEnum("all")]
+        All = 0,
+        [XmlEnum("contacts")]
+        Contacts = 1,
+        [XmlEnum("friends")]
+        Friends = 2,
+        [XmlEnum("family")]
+        Family = 4,
+        [XmlEnum("admins")]
+        Admins = 8
+    }
+}
Index: /extensions/PiwigoLib/PiwigoLib/DTO/PwgFileTypeEnum.cs
===================================================================
--- /extensions/PiwigoLib/PiwigoLib/DTO/PwgFileTypeEnum.cs	(revision 11890)
+++ /extensions/PiwigoLib/PiwigoLib/DTO/PwgFileTypeEnum.cs	(revision 11890)
@@ -0,0 +1,20 @@
+﻿using System;
+using System.Xml.Serialization;
+
+namespace Com.Piwigo.Lib.DTO
+{
+
+    [Serializable()]
+    [XmlRoot(ElementName = "PwgFileTypeEnum")]
+    public enum PwgFileTypeEnum : int
+    {
+        [XmlEnum("unknow")]
+        Unknow = 0,
+        [XmlEnum("thumb")]
+        Thumb = 1,
+        [XmlEnum("file")]
+        LowRes = 2,
+        [XmlEnum("high")]
+        HighDef = 3
+    }
+}
Index: /extensions/PiwigoLib/PiwigoLib/DTO/PwgImage.cs
===================================================================
--- /extensions/PiwigoLib/PiwigoLib/DTO/PwgImage.cs	(revision 11889)
+++ /extensions/PiwigoLib/PiwigoLib/DTO/PwgImage.cs	(revision 11890)
@@ -42,9 +42,9 @@
         public String Author { get; set; }
         public Int64  ImageFileSize { get; set; }
-        public DateTime DateupdateMetaData { get; set; }
+        public DateTime DateUpdateMetaData { get; set; }
         public Boolean  hasHighDef { get; set; }
         public Int64 HighDefFileSize { get; set; }
         public Int32 ConfidentialLevel { get; set; }
-        public String mdSum { get; set; }
+        public String md5Sum { get; set; }
         public Int32 UserIdAddedBy { get; set; }
         public String Name { get; set; }
@@ -71,13 +71,13 @@
     public class PwgComment
     {
-        public Int32 Id { get; set; }
+        public Int32    Id          { get; set; }
         public DateTime CommentDate { get; set; }
-        public String Author { get; set; }
-        public String Content { get; set; }
+        public String   Author      { get; set; }
+        public String   Content     { get; set; }
     }
 
     public class PwgImageRate
     {
-        public Int32 Count { get; set; }
+        public Int32  Count { get; set; }
         public Double Average { get; set; }
         public Double Stdev { get; set; }
Index: /extensions/PiwigoLib/PiwigoLib/IService/IPwgImagesService.cs
===================================================================
--- /extensions/PiwigoLib/PiwigoLib/IService/IPwgImagesService.cs	(revision 11889)
+++ /extensions/PiwigoLib/PiwigoLib/IService/IPwgImagesService.cs	(revision 11890)
@@ -9,4 +9,6 @@
         Boolean DeleteImage(Int32 imageId, String SecurityToken);
         Com.Piwigo.Lib.DTO.PwgImageInfo getImageInfo(Int32 imageId, Int32? commentPage, Int32? commentsPerPage);
+        Boolean addImage(System.IO.FileInfo highResFile, System.IO.FileInfo lowResFile, System.IO.FileInfo thumbFile, String imageName, String imageAuthor, DateTime creationDate,
+            String authorComment, System.Collections.Generic.List<String> lstCategories, System.Collections.Generic.List<String> lstTags, Com.Piwigo.Lib.DTO.PwgConfidentLevelEnum? confidentLevel);
     }
 }
Index: /extensions/PiwigoLib/PiwigoLib/PiwigoLib.csproj
===================================================================
--- /extensions/PiwigoLib/PiwigoLib/PiwigoLib.csproj	(revision 11889)
+++ /extensions/PiwigoLib/PiwigoLib/PiwigoLib.csproj	(revision 11890)
@@ -51,4 +51,6 @@
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="DTO\PwgConfidentLevelEnum.cs" />
+    <Compile Include="DTO\PwgFileTypeEnum.cs" />
     <Compile Include="DTO\PwgCategoryPhotoDeletionModeEnum.cs" />
     <Compile Include="DTO\PwgCategory.cs" />
@@ -59,4 +61,5 @@
     <Compile Include="DTO\PwgSession.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="Proxy\Helper\PwgBase64Helper.cs" />
     <Compile Include="Proxy\PwgImagesProxy.cs" />
     <Compile Include="Proxy\PwgCategoriesProxy.cs" />
Index: /extensions/PiwigoLib/PiwigoLib/Proxy/Helper/PwgBase64Helper.cs
===================================================================
--- /extensions/PiwigoLib/PiwigoLib/Proxy/Helper/PwgBase64Helper.cs	(revision 11890)
+++ /extensions/PiwigoLib/PiwigoLib/Proxy/Helper/PwgBase64Helper.cs	(revision 11890)
@@ -0,0 +1,41 @@
+﻿using System;
+using System.Text;
+using System.Security.Cryptography;
+using System.IO;
+
+namespace Com.Piwigo.Lib.Proxy.Helper
+{
+    internal static class PwgBase64Helper
+    {
+        internal static string base64Encode(byte[] encData_byte)
+        {
+            try
+            {
+                string encodedData = Convert.ToBase64String(encData_byte);
+                return encodedData;
+            }
+            catch (Exception e)
+            {
+                throw new Exception("Error in PwgBase64Helper : " + e.Message,e);
+            }
+        }
+
+        internal static string GetphpMd5Sum(FileStream s)
+        {
+            MD5 md5 = new MD5CryptoServiceProvider();
+            byte[] hash = md5.ComputeHash(s);
+            // Build the final string by converting each byte
+            // into hex and appending it to a StringBuilder
+            string ret = "";
+            foreach (byte a in hash) {
+                if (a<16)
+                ret += "0" + a.ToString ("x");
+                else
+                ret += a.ToString ("x");
+            }
+
+            // And return it
+            return ret;
+        }
+    }
+}
Index: /extensions/PiwigoLib/PiwigoLib/Proxy/PwgImagesProxy.cs
===================================================================
--- /extensions/PiwigoLib/PiwigoLib/Proxy/PwgImagesProxy.cs	(revision 11889)
+++ /extensions/PiwigoLib/PiwigoLib/Proxy/PwgImagesProxy.cs	(revision 11890)
@@ -15,14 +15,14 @@
 
         /*
-         * pwg.images.add
-         * pwg.images.addChunk
+         * pwg.images.add                   pwg_images_add
+         * pwg.images.addChunk              pwg_images_addChunk
          * pwg.images.addComment
          * pwg.images.addFile               
-         * pwg.images.addSimple            pwg_images_addSimple
+         * pwg.images.addSimple             pwg_images_addSimple
          * pwg.images.checkFiles
          * pwg.images.checkUpload
-         * pwg.images.delete               pwg_images_delete 
+         * pwg.images.delete                pwg_images_delete 
          * pwg.images.exist
-         * pwg.images.getInfo
+         * pwg.images.getInfo               pwg_images_getInfos
          * pwg.images.rate                  pwg_images_rate
          * pwg.images.regenerateThumbnail
@@ -31,4 +31,74 @@
          * pwg.images.setPrivacyLevel
  * */
+
+        static internal PwgBaseProxyReponse pwg_images_add(String fileGuid, String thunbGuid, String HighresGuid, 
+            String imageGuid,  String imageFilename, String imageName, String imageAuthor, DateTime creationDate,  
+            String authorComment,List<String> lstCategories, List<String> lstTags, PwgConfidentLevelEnum? confidentLevel)
+        {
+            PwgBaseProxyReponse response = null;
+            try
+            {            
+                StringBuilder data = new StringBuilder();
+                data.Append("method=pwg.images.add");
+                Boolean firstOcc = false;
+                PwgProxyReponseHelper.buildQueryFromValue<String>(fileGuid, "file_sum", ref firstOcc, data);
+                PwgProxyReponseHelper.buildQueryFromValue<String>(thunbGuid, "thumbnail_sum", ref firstOcc, data);
+                PwgProxyReponseHelper.buildQueryFromValue<String>(HighresGuid, "high_sum", ref firstOcc, data);
+                PwgProxyReponseHelper.buildQueryFromValue<String>(imageGuid, "original_sum", ref firstOcc, data);
+                PwgProxyReponseHelper.buildQueryFromValue<String>(imageFilename, "original_filename", ref firstOcc, data);
+                PwgProxyReponseHelper.buildQueryFromValue<String>(imageName, "name", ref firstOcc, data);
+                PwgProxyReponseHelper.buildQueryFromValue<String>(imageAuthor, "author", ref firstOcc, data);
+                PwgProxyReponseHelper.buildQueryFromValue<String>(authorComment, "comment", ref firstOcc, data);
+                PwgProxyReponseHelper.buildQueryFromArray<String>(lstCategories, "categories", ref firstOcc, data);
+                PwgProxyReponseHelper.buildQueryFromArray<String>(lstTags, "tag_ids", ref firstOcc, data);
+                PwgProxyReponseHelper.buildQueryFromValue<Int32>((int?)confidentLevel, "level", ref firstOcc, data);
+                PwgProxyReponseHelper.buildQueryFromValue<DateTime>(creationDate, "date_creation", ref firstOcc, data);
+
+                response = PwgGenericProxy<PwgBaseProxyReponse>.Post(
+                    PwgConfigProxy.PwgServeurUri,
+                    data.ToString());
+            }
+            catch (Exception ex)
+            {
+                throw new PwgProxyException("pwg_images_rate", ex);
+            }
+
+            return response;
+        }
+
+       /// <summary>
+       /// pwg.images.addChunk
+       /// </summary>
+       /// <param name="strb64Data"></param>
+       /// <param name="uniqueId"></param>
+       /// <param name="fileType"></param>
+       /// <param name="?"></param>
+       /// <param name="chunckNumber"></param>
+       /// <returns></returns>
+        static internal PwgBaseProxyReponse pwg_images_addChunk(String strb64Data, String uniqueId, PwgFileTypeEnum fileType, Int32 chunckNumber )
+        {
+            PwgBaseProxyReponse response = null;
+            try
+            {
+               
+                StringBuilder data = new StringBuilder();
+                data.Append("method=pwg.images.addChunk");
+                Boolean firstOcc = false;
+                PwgProxyReponseHelper.buildQueryFromValue<String>(strb64Data, "data", ref firstOcc, data);
+                PwgProxyReponseHelper.buildQueryFromValue<String>(uniqueId, "original_sum", ref firstOcc, data);
+                PwgProxyReponseHelper.buildQueryFromValue<PwgFileTypeEnum>(fileType, "type", ref firstOcc, data);
+                PwgProxyReponseHelper.buildQueryFromValue<Int32>(chunckNumber, "position", ref firstOcc, data);
+
+                response = PwgGenericProxy<PwgBaseProxyReponse>.Post(
+                    PwgConfigProxy.PwgServeurUri,
+                    data.ToString());
+            }
+            catch (Exception ex)
+            {
+                throw new PwgProxyException("pwg_images_rate", ex);
+            }
+
+            return response;
+        }
 
         /// <summary>
Index: /extensions/PiwigoLib/PiwigoLib/Proxy/Response/PwgImagesProxyResponse.cs
===================================================================
--- /extensions/PiwigoLib/PiwigoLib/Proxy/Response/PwgImagesProxyResponse.cs	(revision 11889)
+++ /extensions/PiwigoLib/PiwigoLib/Proxy/Response/PwgImagesProxyResponse.cs	(revision 11890)
@@ -29,4 +29,5 @@
         public String Stdev { get; set; }
     }
+     
 
     [Serializable()]
@@ -62,5 +63,4 @@
         [XmlArrayItem("category")]
         public PwgCategoryProxyResponse[] Categories { get; set; }
-
     }
 
@@ -75,27 +75,6 @@
     [Serializable()]
     [XmlRoot(ElementName = "image")]
-    public class PwgImageInfoImageProxyResponse 
+    public class PwgImageInfoImageProxyResponse : PwgImageProxyResponse
     {
-        [XmlAttribute(AttributeName = "id")]
-        public Int32 Id { get; set; }
-        [XmlAttribute(AttributeName = "width")]
-        public Int32 Width { get; set; }
-        [XmlAttribute(AttributeName = "height")]
-        public Int32 Height { get; set; }
-        [XmlAttribute(AttributeName = "file")]
-        public String File { get; set; }
-        [XmlAttribute(AttributeName = "tn_url")]
-        public String UrlThunb { get; set; }
-        [XmlAttribute(AttributeName = "element_url")]
-        public String UrlElement { get; set; }
-        [XmlAttribute(AttributeName = "high_url")]
-        public String UrlHighDef { get; set; }
-        [XmlAttribute(AttributeName = "hit")]
-        public Int64 Counter { get; set; }
-        [XmlAttribute(AttributeName = "date_creation")]
-        public String CreatingDate { get; set; }
-        [XmlAttribute(AttributeName = "date_available")]
-        public String AvailableDate { get; set; }
-        [XmlAttribute(AttributeName = "tn_ext")]
         public String ExtThumbail { get; set; }
         [XmlAttribute(AttributeName = "author")]
@@ -112,5 +91,5 @@
         public Int32 ConfidentialLevel { get; set; }
         [XmlAttribute(AttributeName = "md5sum")]
-        public String mdSum { get; set; }
+        public String md5Sum { get; set; }
         [XmlAttribute(AttributeName = "added_by")]
         public Int32 UserIdAddedBy { get; set; }
@@ -118,12 +97,4 @@
         [XmlElement("name")]
         public String Name { get; set; }
-
-        [XmlArray("tags")]
-        [XmlArrayItem("tag")]
-        public PwgTagProxyResponse[] Tags { get; set; }
-
-        [XmlArray("categories")]
-        [XmlArrayItem("category")]
-        public PwgCategoryProxyResponse[] Categories { get; set; }
 
         [XmlElement("rates")]
@@ -134,5 +105,5 @@
 
         [XmlElement("comment_post")]
-        public PwgPostCommentSecurityInfo PostCommenSecurityData { get; set; }
+        public PwgPostCommentSecurityInfo PostCommentSecurityData { get; set; }
     }
 
Index: /extensions/PiwigoLib/PiwigoLib/Service/PwgImagesService.cs
===================================================================
--- /extensions/PiwigoLib/PiwigoLib/Service/PwgImagesService.cs	(revision 11889)
+++ /extensions/PiwigoLib/PiwigoLib/Service/PwgImagesService.cs	(revision 11890)
@@ -82,4 +82,101 @@
         }
 
+        public Boolean addImage(FileInfo highResFile, FileInfo lowResFile, FileInfo thumbFile, String imageName, String imageAuthor, DateTime creationDate,
+            String authorComment, List<String> lstCategories, List<String> lstTags, PwgConfidentLevelEnum? confidentLevel)
+        {
+            Boolean returnValue = false;
+
+            try
+            {
+                String fileGuid =  uploadImageByChunk(lowResFile, PwgFileTypeEnum.LowRes);
+                String thunbGuid = uploadImageByChunk(thumbFile, PwgFileTypeEnum.Thumb);
+                String HighresGuid = uploadImageByChunk(highResFile, PwgFileTypeEnum.HighDef);
+                String imageGuid = (highResFile != null ? HighresGuid : fileGuid);  //Guid.NewGuid().ToString();
+                String imageFilename = (highResFile != null ? highResFile.Name : lowResFile.Name);
+
+                PwgBaseProxyReponse response = PwgImagesProxy.pwg_images_add( fileGuid, thunbGuid, HighresGuid, 
+                                                    imageGuid,  imageFilename, imageName, imageAuthor, creationDate,  
+                                                    authorComment, lstCategories, lstTags, confidentLevel);
+
+                if (response.Retour != PwgBaseProxyReponseRetourEnum.Ok)
+                {
+                    if (response.Erreur != null)
+                    {
+                        throw new PwgServiceException("addImage, the server has return the error.",
+                            response.Erreur.Code,
+                            response.Erreur.Message);
+                    }
+                    else
+                    {
+                        throw new PwgServiceException("addImage : a error occurs during server process.");
+                    }
+                }
+                else
+                {
+                    returnValue = true;
+                }
+            }
+            catch (PwgProxyException ex)
+            {
+                throw new PwgServiceException("addImage : a error is raised by proxy.", ex);
+            }
+            return returnValue;
+        }
+
+        public String uploadImageByChunk(FileInfo imageFile, PwgFileTypeEnum fileType)
+        {
+            byte[] buffer = new byte[5000];
+            string strGuid = String.Empty; ;
+            int read;
+            int chunkNumber = 1;
+
+            try
+            {
+                if (imageFile != null)
+                {
+                    FileStream fs = File.OpenRead(imageFile.FullName);
+                    strGuid = Com.Piwigo.Lib.Proxy.Helper.PwgBase64Helper.GetphpMd5Sum(fs);
+                    
+                    fs.Seek(0, SeekOrigin.Begin);
+                    while ((read = fs.Read(buffer, 0, buffer.Length)) > 0)
+                    {
+                        String strB64Data = Com.Piwigo.Lib.Proxy.Helper.PwgBase64Helper.base64Encode(buffer);
+                        PwgBaseProxyReponse response = PwgImagesProxy.pwg_images_addChunk(strB64Data, strGuid, fileType, chunkNumber);
+
+                        chunkNumber += 1;
+
+                        if (response.Retour != PwgBaseProxyReponseRetourEnum.Ok)
+                        {
+                            if (response.Erreur != null)
+                            {
+                                throw new PwgServiceException("uploadImageByChunk, the server has return the error.",
+                                    response.Erreur.Code,
+                                    response.Erreur.Message);
+                            }
+                            else
+                            {
+                                throw new PwgServiceException("uploadImageByChunk : a error occurs during server process.");
+                            }
+                        }
+                    }
+                }
+                else
+                {
+                    strGuid = String.Empty;
+                }
+            }
+            catch (PwgProxyException ex)
+            {
+                throw new PwgServiceException("uploadImageByChunk : a error is raised by proxy.", ex);
+            }
+            return strGuid;
+        }
+
+        /// <summary>
+        /// Delete a image
+        /// </summary>
+        /// <param name="imageId"></param>
+        /// <param name="SecurityToken"></param>
+        /// <returns></returns>
         public Boolean DeleteImage(Int32 imageId, String SecurityToken)
         {
@@ -139,5 +236,5 @@
                 else
                 {
-                    //returnValue = ConvertProxyResponseToDTO(response);
+                    returnValue = ConvertProxyResponseToDTO(response.ImageInfo);
                 }
             }
@@ -148,4 +245,5 @@
             return returnValue;
         }        
+
         /// <summary>
         /// private: convert response to dto object
@@ -234,4 +332,131 @@
                 }
             }
+        }
+
+        /// <summary>
+        /// private: convert response to dto object
+        /// </summary>
+        /// <param name="response"></param>
+        /// <param name="session"></param>
+        internal static PwgImageInfo ConvertProxyResponseToDTO(PwgImageInfoImageProxyResponse response)
+        {
+            PwgImageInfo returnValue = null;
+
+            try
+            {
+                PwgImage pwgImg = ConvertProxyResponseToDTO(response as PwgImageProxyResponse as PwgImageProxyResponse);
+                returnValue = new PwgImageInfo(){   Id           = pwgImg.Id,
+                                                    Width        = pwgImg.Width,
+                                                    Height       = pwgImg.Height,
+                                                    File         = pwgImg.File ,
+                                                    UrlThunb     = pwgImg.UrlThunb,
+                                                    UrlElement   = pwgImg.UrlElement,
+                                                    UrlHighDef   = pwgImg.UrlHighDef,
+                                                    Counter      = pwgImg.Counter,
+                                                    CreatingDate = pwgImg.CreatingDate,
+                                                    AvailableDate= pwgImg.AvailableDate,
+                                                    Tags         = pwgImg.Tags,
+                                                    Categories   = pwgImg.Categories};
+
+               returnValue.ExtThumbail       = response.ExtThumbail       ;
+               returnValue.Author            = response.Author            ;
+               returnValue.ImageFileSize     = response.ImageFileSize     ;
+               returnValue.hasHighDef        = response.hasHighDef        ;
+               returnValue.HighDefFileSize   = response.HighDefFileSize   ;
+               returnValue.ConfidentialLevel = response.ConfidentialLevel ;
+               returnValue.md5Sum            = response.md5Sum            ;
+               returnValue.UserIdAddedBy     = response.UserIdAddedBy     ;
+               returnValue.Name              = response.Name              ;
+               
+                if (response.DateUpdateMetaData != null)
+               {
+                   DateTime tryDate;
+                   if (DateTime.TryParse(response.DateUpdateMetaData, out tryDate))
+                   {
+                       returnValue.DateUpdateMetaData = tryDate;
+                   }
+               }
+
+               if (response.ImageRate != null)
+               {
+                    returnValue.ImageRate = ConvertProxyResponseToDTO(response.ImageRate);
+               }
+               if (response.ImageComments != null)
+               {
+                    returnValue.ImageComments = ConvertProxyResponseToDTO(response.ImageComments);
+               }
+               if (response.PostCommentSecurityData != null)
+               {
+                   returnValue.PostCommenSecurityData = ConvertProxyResponseToDTO(response.PostCommentSecurityData);
+               }
+            }
+            catch (Exception ex)
+            {
+                throw new PwgServiceException("ConvertProxyResponseToDTO : a error is raised when converting PwgTagProxyResponse.", ex);
+            }
+
+            return returnValue;
+        }
+
+        /// <summary>
+        /// private: convert response to dto object
+        /// </summary>
+        /// <param name="response"></param>
+        /// <param name="session"></param>
+        internal static PwgPostCommentSecurityInfo ConvertProxyResponseToDTO(PwgPostCommentSecurityInfo response)
+        {
+            PwgPostCommentSecurityInfo returnValue = new PwgPostCommentSecurityInfo();
+
+            returnValue.Author = response.Author;
+            returnValue.AllowPostKey = response.AllowPostKey;
+
+            return returnValue;
+        }
+
+        /// <summary>
+        /// private: convert response to dto object
+        /// </summary>
+        /// <param name="response"></param>
+        /// <param name="session"></param>
+        internal static PwgCommentPage ConvertProxyResponseToDTO(PwgCommentPageProxyResponse response)
+        {
+            PwgCommentPage returnValue = new PwgCommentPage();
+    
+            returnValue.Page = response.Page;
+            returnValue.PerPage = response.PerPage;
+            returnValue.CountOf = response.CountOf;
+            returnValue.TotalCommentNumber = response.TotalCommentNumber;
+
+            //PwgCommentPage inherit List<PwgComment>
+            if (response.Comments != null)
+            {
+                foreach (PwgCommentProxyResponse respComment in response.Comments)
+                {
+                    PwgComment pwgCom = ConvertProxyResponseToDTO(respComment);
+                    if (pwgCom != null)
+                    {
+                        returnValue.Add(pwgCom);
+                    }
+                }
+            }
+
+            return returnValue;
+        }
+
+        /// <summary>
+        /// private: convert response to dto object
+        /// </summary>
+        /// <param name="response"></param>
+        /// <param name="session"></param>
+        internal static PwgComment ConvertProxyResponseToDTO(PwgCommentProxyResponse response)
+        {
+            PwgComment returnValue = new PwgComment();
+
+            returnValue.Id          = response.Id;          
+            returnValue.CommentDate = response.CommentDate;
+            returnValue.Author      = response.Author;
+            returnValue.Content     = response.Content;     
+
+            return returnValue;
         }
 
Index: /extensions/PiwigoLib/TestPiwigoLib/Form1.cs
===================================================================
--- /extensions/PiwigoLib/TestPiwigoLib/Form1.cs	(revision 11889)
+++ /extensions/PiwigoLib/TestPiwigoLib/Form1.cs	(revision 11890)
@@ -46,15 +46,15 @@
                 //List<PwgTag> lstTag = PwgServiceProvider.Instance.PwgTagsService.GetAdminListOfTag();
 
-                //Int32 Page = 0;
-                //Int32 PerPage = 0; 
-                //Int32 Count = 0;
+                Int32 Page = 0;
+                Int32 PerPage = 0;
+                Int32 Count = 0;
 
-                //List<PwgImage> lstImgTag = PwgServiceProvider.Instance.PwgTagsService.GetListOfImagesFormTags(new List<Int32>() { 1, 7 },
-                //    null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
-                //    ref Page, ref PerPage, ref Count);
+                List<PwgImage> lstImgTag = PwgServiceProvider.Instance.PwgTagsService.GetListOfImagesFormTags(new List<Int32>() { 1, 7 },
+                    null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
+                    ref Page, ref PerPage, ref Count);
 
-                //List<PwgImage> lstImgCat = PwgServiceProvider.Instance.PwgCategoriesService.GetListOfImagesFormCategory(1,
-                //    null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
-                //    ref Page, ref PerPage, ref Count);
+                List<PwgImage> lstImgCat = PwgServiceProvider.Instance.PwgCategoriesService.GetListOfImagesFormCategory(1,
+                    null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
+                    ref Page, ref PerPage, ref Count);
 
                 //Console.WriteLine("lstImg : Page " + Page.ToString() + " PerPage " + PerPage);
@@ -74,11 +74,14 @@
                 //lstCat = PwgServiceProvider.Instance.PwgCategoriesService.GetAdminListOfCategory(); 
 
-                //FileInfo fi = new FileInfo("C:\\Users\\bayral\\Downloads\\49133_1636405570_2648232_n.jpg");
-                //PwgImageAdded imgAdd = PwgServiceProvider.Instance.PwgImagesService.addImageByMultiPartForm(fi, null, 1, "benoit", "byarl", "test upload", 0, new List<PwgTag>() { new PwgTag() { Name = "Benoit" }, new PwgTag() { Name = "Noé" } });
+                FileInfo fiBig = new FileInfo("C:\\Users\\bayral\\Downloads\\49133_1636405570_2648232_n.jpg");
+                FileInfo fiThumb = new FileInfo(MakeThumb(fiBig,"C:\\Users\\bayral\\Downloads\\49133_1636405570_2648232_n_thum.jpg",64));
+                FileInfo fiLow = new FileInfo(MakeThumb(fiBig,"C:\\Users\\bayral\\Downloads\\49133_1636405570_2648232_n_low.jpg",256));
 
-                rc = PwgServiceProvider.Instance.PwgImagesService.DeleteImage(319, sess.SecurityToken);
+                //PwgImageAdded imgAdd = PwgServiceProvider.Instance.PwgImagesService.addImageByMultiPartForm(fiBig, null, 1, "benoit", "byarl", "test upload", 0, new List<PwgTag>() { new PwgTag() { Name = "Benoit" }, new PwgTag() { Name = "Noé" } });
+                rc = PwgServiceProvider.Instance.PwgImagesService.addImage(fiBig, fiLow, fiThumb, "Benoit", "bayral", DateTime.Now, "demo", null, null, PwgConfidentLevelEnum.All);
+                //rc = PwgServiceProvider.Instance.PwgImagesService.DeleteImage(319, sess.SecurityToken);
 
-                PwgImageInfo info = PwgServiceProvider.Instance.PwgImagesService.getImageInfo(319, null, null);
-
+                //PwgImageInfo info = PwgServiceProvider.Instance.PwgImagesService.getImageInfo(imgAdd.Id, null, null);
+                
                 //PwgImageRate imgRate = PwgServiceProvider.Instance.PwgImagesService.RateImage(1, 5);
 
@@ -93,4 +96,32 @@
         }
 
+        private string MakeThumb(FileInfo fi, String ext, int size)        
+        {
+        // create an image object, using the filename we just retrieved
+        System.Drawing.Image image = System.Drawing.Image.FromFile(fi.FullName);
+
+        // create the actual thumbnail image
+        System.Drawing.Image thumbnailImage = image.GetThumbnailImage(size, size, new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback), IntPtr.Zero);
+
+        // make a memory stream to work with the image bytes
+        FileStream imageStream = new FileStream(ext, FileMode.OpenOrCreate);
+
+        // put the image into the memory stream
+        thumbnailImage.Save(imageStream, System.Drawing.Imaging.ImageFormat.Jpeg);
+
+        imageStream.Close();
+        return ext;
+        }
+
+        /// <summary>
+        /// Required, but not used
+        /// </summary>
+        /// <returns>true</returns>
+        public bool ThumbnailCallback()
+        {
+            return true;
+        }
+
+
         private void Form1_FormClosing(object sender, FormClosingEventArgs e)
         {
