Index: /trunk/ws.php
===================================================================
--- /trunk/ws.php	(revision 2516)
+++ /trunk/ws.php	(revision 2520)
@@ -182,5 +182,6 @@
       'file_sum',
       'thumbnail_content',
-      'thumbnail_sum'
+      'thumbnail_sum',
+      'rank',
       ),
     'POST method only'
Index: /trunk/tools/piwigo_remote.pl
===================================================================
--- /trunk/tools/piwigo_remote.pl	(revision 2519)
+++ /trunk/tools/piwigo_remote.pl	(revision 2520)
@@ -11,5 +11,5 @@
 GetOptions(
     \%opt,
-    qw/action=s file=s thumbnail=s category_id=i name=s/
+    qw/action=s file=s thumbnail=s category_id=i name=s rank=i/
 );
 
@@ -62,4 +62,5 @@
         category_id => $opt{category_id},
         name => $opt{name},
+        rank => defined($opt{rank}) ? $opt{rank} : 1,
     };
 
Index: /trunk/include/ws_functions.inc.php
===================================================================
--- /trunk/include/ws_functions.inc.php	(revision 2516)
+++ /trunk/include/ws_functions.inc.php	(revision 2520)
@@ -829,4 +829,5 @@
   // thumbnail_content
   // thumbnail_sum
+  // rank
 
   // $fh_log = fopen('/tmp/php.log', 'w');
@@ -927,5 +928,6 @@
   $insert = array(
     'category_id' => $params['category_id'],
-    'image_id'=> $image_id,
+    'image_id' => $image_id,
+    'rank' => $params['rank'],
     );
   mass_inserts(
