← Back to team overview

zorba-coders team mailing list archive

[Merge] lp:~zorba-coders/zorba/update3.0_image-module into lp:zorba/image-module

 

Juan Zacarias has proposed merging lp:~zorba-coders/zorba/update3.0_image-module into lp:zorba/image-module.

Commit message:
Updated image module to zorba 3.0 format

JSONification of module parameters

Requested reviews:
  Chris Hillery (ceejatec)
Related bugs:
  Bug #1188049 in Zorba: "Update non-core module "image""
  https://bugs.launchpad.net/zorba/+bug/1188049

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/update3.0_image-module/+merge/179826

Updated image module to zorba 3.0 format

JSONification of module parameters
-- 
https://code.launchpad.net/~zorba-coders/zorba/update3.0_image-module/+merge/179826
Your team Zorba Coders is subscribed to branch lp:zorba/image-module.
=== modified file 'src/CMakeLists.txt'
--- src/CMakeLists.txt	2011-07-26 10:43:30 +0000
+++ src/CMakeLists.txt	2013-08-12 22:55:38 +0000
@@ -1,4 +1,4 @@
-# Copyright 2006-2008 The FLWOR Foundation.
+# Copyright 2006-2010 The FLWOR Foundation.
 # 
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -11,9 +11,76 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
-
-# all external module libraries are generated in the directory
-# of the corresponding .xq file
-MESSAGE(STATUS "Add com")
-ADD_SUBDIRECTORY(com)
-MESSAGE(STATUS "End modules")
+#
+
+########################################################################
+# ImageMagick
+########################################################################
+IF(ZORBA_SUPPRESS_ImageMagick)
+  MESSAGE(STATUS "ZORBA_SUPPRESS_ImageMagick is true - not searching for ImageMagick.")  
+ELSE(ZORBA_SUPPRESS_ImageMagick)
+  MESSAGE (STATUS "Looking for ImageMagick")
+  FIND_PACKAGE(ImageMagick COMPONENTS Magick++ MagickCore MagickWand)
+  
+  IF(ImageMagick_FOUND)
+    MESSAGE(STATUS "Found ImageMagick include dirs ${ImageMagick_INCLUDE_DIRS}")
+    MESSAGE(STATUS "Found ImageMagick libraries ${ImageMagick_LIBRARIES}")  
+    INCLUDE_DIRECTORIES("${ImageMagick_INCLUDE_DIRS}")
+    
+    INCLUDE_DIRECTORIES("image_commons")
+    INCLUDE_DIRECTORIES("image_draw")
+    DECLARE_ZORBA_SCHEMA(FILE image.xsd
+      URI "http://zorba.io/modules/image/image";)
+    DECLARE_ZORBA_MODULE(URI "http://zorba.io/modules/image/basic";
+      VERSION 2.0 FILE "basic.xq"
+      EXTRA_SOURCES image_commons image_draw
+      LINK_LIBRARIES ${ImageMagick_LIBRARIES})
+    DECLARE_ZORBA_MODULE(VERSION 1.0 FILE "manipulation.xq"
+      URI "http://zorba.io/modules/image/manipulation";
+      EXTRA_SOURCES image_commons
+      LINK_LIBRARIES ${ImageMagick_LIBRARIES})
+    DECLARE_ZORBA_MODULE(VERSION 1.0 FILE "paint.xq"
+      URI "http://zorba.io/modules/image/paint";
+      EXTRA_SOURCES image_draw image_commons
+      LINK_LIBRARIES ${ImageMagick_LIBRARIES})
+    DECLARE_ZORBA_MODULE(VERSION 1.0 FILE "animation.xq"
+      URI "http://zorba.io/modules/image/animation";
+      EXTRA_SOURCES image_commons
+      LINK_LIBRARIES ${ImageMagick_LIBRARIES})
+
+    # this could crash because of the ImageMagick version
+    # must be compiled in debug mode
+    SET (KNOWN_CRASHES)
+    IF (WIN32)
+      IF (CMAKE_BUILD_TYPE STREQUAL "Debug")
+        LIST (APPEND KNOWN_CRASHES
+          zorba_image_module/image/basic.xq 867693
+          zorba_image_module/image/basic_convert.xq 867693
+          zorba_image_module/image/basic_create.xq 867693
+          zorba_image_module/image/paint_1.xq 867693
+          zorba_image_module/image/paint_2.xq 867693
+          zorba_image_module/image/paint_3.xq 867693
+          zorba_image_module/image/paint_4.xq 867693
+          zorba_image_module/image/paint_5.xq 867693
+          zorba_image_module/image/paint_6.xq 867693
+          zorba_image_module/image/paint_circles.xq 867693
+          zorba_image_module/image/paint_different_lines.xq 867693
+          zorba_image_module/image/paint_polygon.xq 867693
+          zorba_image_module/image/paint_polyline.xq 867693
+          zorba_image_module/image/paint_rectangles.xq 867693
+          zorba_image_module/image/paint_stroked_polyline.xq 867693
+          zorba_image_module/image/paint_text.xq 867693
+        )
+      ENDIF (CMAKE_BUILD_TYPE STREQUAL "Debug")
+    ENDIF (WIN32)
+
+    ADD_TEST_DIRECTORY ("${PROJECT_SOURCE_DIR}/test" "${KNOWN_CRASHES}")
+    
+  ELSE (ImageMagick_FOUND)
+    MESSAGE(STATUS "Magick++   component found: ${ImageMagick_Magick++_FOUND}")
+    MESSAGE(STATUS "MagickCore component found: ${ImageMagick_MagickCore_FOUND}")
+    MESSAGE(STATUS "MagickWand component found: ${ImageMagick_MagickWand_FOUND}") 
+    MESSAGE(STATUS "If you want to use image handling functionality please install the ImageMagick library containing these 3 components: Magick++, MagickCore, MagickWand.\n Please note that on some OS\n- ImageMagick and\n- libMagick++ (on OpenSuse) or ImageMagick-c++(on Fedora)\n are 2 different packages and you need to install both of them and additionally their development packages.")
+  ENDIF (ImageMagick_FOUND)
+ENDIF(ZORBA_SUPPRESS_ImageMagick)
+MESSAGE(STATUS "") 

=== renamed file 'src/com/zorba-xquery/www/modules/image/animation.xq' => 'src/animation.xq'
--- src/com/zorba-xquery/www/modules/image/animation.xq	2013-08-09 09:37:05 +0000
+++ src/animation.xq	2013-08-12 22:55:38 +0000
@@ -23,38 +23,38 @@
  : @library <a href="http://www.imagemagick.org/Magick++/";>Magick++ C++ Library</a>
  : @project Zorba/Image/Animation
  :)
-module namespace anim = 'http://www.zorba-xquery.com/modules/image/animation';
+module namespace anim = 'http://zorba.io/modules/image/animation';
 
-declare namespace ierr = "http://www.zorba-xquery.com/modules/image/error";;
+declare namespace ierr = "http://zorba.io/modules/image/error";;
 declare namespace ver = "http://zorba.io/options/versioning";;
 declare option ver:module-version "1.0";
 
 (:~
- : Creates an animated GIF image.
- : The resulting animated GIF shows the passed images consecutively. 
- : It has the same width and height as the first passed image.
+ : <p>Creates an animated GIF image.</p>
+ : <p>The resulting animated GIF shows the passed images consecutively.</p> 
+ : <p>It has the same width and height as the first passed image.</p>
  :
  : @param $images the image sequence
  : @param $delay the hundredths of seconds an image is shown
  : @param $iterations the amount of times all images are shown. 0 for infinite.
  : @return the animated GIF
- : @error ierr:IM001 one of the passed images is invalid.
+ : @error ierr:INVALID_IMAGE the passed image is invalid.
  : @example test/Queries/image/animation_create.xq
  :)
 declare function anim:create-animated-gif($images as xs:base64Binary+, $delay as xs:unsignedInt, $iterations as xs:unsignedInt) as xs:base64Binary external; 
 
 
 (:~
- : Creates an animated GIF image with morph effect.
- : The resulting animated GIF shows the passed images consecutively with morph effect between the changes.
- : It has the same width and height as the first passed image.
+ : <p>Creates an animated GIF image with morph effect.</p>
+ : <p>The resulting animated GIF shows the passed images consecutively with morph effect between the changes.</p>
+ : <p>It has the same width and height as the first passed image.</p>
  :
  : @param $images the image sequence
  : @param $delay the hundredths of seconds an image is shown
  : @param $iterations the amount of times all images are shown. 0 for infinite.
  : @param $nr-of-morph-images the number of additionally added images to create the morph effect between two passed images.
  : @return the animated GIF
- : @error ierr:IM001 one of the passed images is invalid.
+ : @error ierr:INVALID_IMAGE the passed image is invalid.
  : @example test/Queries/image/animation_create.xq
  :)
 declare function anim:create-morphed-gif($images as xs:base64Binary+, $delay as xs:unsignedInt, $iterations as xs:unsignedInt, $nr-of-morph-images as xs:unsignedInt) as xs:base64Binary external; 

=== renamed directory 'src/com/zorba-xquery/www/modules/image/animation.xq.src' => 'src/animation.xq.src'
=== modified file 'src/animation.xq.src/animation_module.h'
--- src/com/zorba-xquery/www/modules/image/animation.xq.src/animation_module.h	2011-10-06 08:18:47 +0000
+++ src/animation.xq.src/animation_module.h	2013-08-12 22:55:38 +0000
@@ -33,7 +33,7 @@
  
 
   virtual String
-  getURI() const { return "http://www.zorba-xquery.com/modules/image/animation";; }
+  getURI() const { return "http://zorba.io/modules/image/animation";; }
 
 };
 

=== renamed file 'src/com/zorba-xquery/www/modules/image/basic.xq' => 'src/basic.xq'
--- src/com/zorba-xquery/www/modules/image/basic.xq	2013-08-09 09:37:05 +0000
+++ src/basic.xq	2013-08-12 22:55:38 +0000
@@ -17,7 +17,7 @@
 :)
 
 (:~
- : This module provides function to do the following basic image operations:
+ : <p>This module provides function to do the following basic image operations:
  : <ul>
  :   <li>create empty images</li>
  :   <li>compare images</li>
@@ -25,8 +25,8 @@
  :   <li>convert an image one format to another</li>
  :   <li>retrieve with, height, format, and exif information from an image</li>
  : </ul>
- :
- : The following image formats are supported:
+ : <p/>
+ : <p>The following image formats are supported:
  : <ul>
  :   <li>GIF</li>
  :   <li>JPEG</li>
@@ -34,27 +34,27 @@
  :   <li>TIFF</li>
  :   <li>BMP</li>
  : </ul>
- :
+ : <p/>
  : <p>The errors raised by functions of this module have the namespace
- : <tt>http://www.zorba-xquery.com/modules/image/error</tt> (associated with prefix ierr).</p>
+ : <tt>http://zorba.io/modules/image/error</tt> (associated with prefix ierr).</p>
  :
  : @author Daniel Thomas
  : @library <a href="http://www.imagemagick.org/Magick++/";>Magick++ C++ Library</a>
  : @project Zorba/Image/Basic
  :
  :)
-module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
+module namespace basic = 'http://zorba.io/modules/image/basic';
 
-import schema namespace image = 'http://www.zorba-xquery.com/modules/image/image';
+import schema namespace image = 'http://zorba.io/modules/image/image';
 
 declare namespace err = "http://www.w3.org/2005/xqt-errors";;
-declare namespace ierr = "http://www.zorba-xquery.com/modules/image/error";;
+declare namespace ierr = "http://zorba.io/modules/image/error";;
 declare namespace ver = "http://zorba.io/options/versioning";;
 declare namespace svg = "http://www.w3.org/2000/svg";;
 declare option ver:module-version "2.0";
 
 (:~
- : Returns the width of the passed image.
+ : <p>Returns the width of the passed image.</p>
  : 
  : @param $image the image
  : @return the width in pixels
@@ -64,24 +64,24 @@
 declare function basic:width($image as xs:base64Binary) as xs:unsignedInt external; 
 
 (:~
- : Returns the height of the passed image.
+ : <p>Returns the height of the passed image.</p>
  : 
  : @param $image the image
  : @return the height in pixels
- : @error ierr:IM001 the passed image is invalid.
+ : @error ierr:INVALID_IMAGE the passed image is invalid.
  : @example test/Queries/image/basic_height.xq
  :)
 declare function basic:height($image as xs:base64Binary) as xs:unsignedInt external; 
 
 
 (:~
- : Compresses the passed image. 
- : Compressing means lowering the quality and reducing the size.
+ : <p>Compresses the passed image.</p> 
+ : <p>Compressing means lowering the quality and reducing the size.</p>
  :
  : @param $image the image
  : @param $quality compression level, 0 to 100
  : @return the compressed image 
- : @error ierr:IM001 the passed image is invalid.
+ : @error ierr:INVALID_IMAGE the passed image is invalid.
  : @example test/Queries/image/basic_compress.xq
  :)
 declare function basic:compress($image as xs:base64Binary, $quality as xs:unsignedInt) as xs:base64Binary external; 
@@ -89,12 +89,12 @@
 
 
 (:~
- : Converts an image to another format.
+ : <p>Converts an image to another format.</p>
  :
  : @param $image the source image
  : @param $format the format (see supported formats above) of the resulting image.
  : @return A new image with the same content as the passed image but with the specified file format.
- : @error ierr:IM001 the passed image is invalid.
+ : @error ierr:INVALID_IMAGE the passed image is invalid.
  : @error err:FORG0001 unsupported image format 
  : @example test/Queries/image/basic_convert.xq
  :)
@@ -107,17 +107,17 @@
 
 
 (:~
- : Returns the format of the passed image. 
+ : <p>Returns the format of the passed image.</p> 
  :
  : @param $image the image
  : @return the format 
- : @error ierr:IM001 the passed image is invalid.
+ : @error ierr:INVALID_IMAGE the passed image is invalid.
  : @example test/Queries/image/basic_type.xq
  :)
 declare function basic:format($image as xs:base64Binary) as xs:string external; 
  
 (:~
- : Creates an empty image with background color white.
+ : <p>Creates an empty image with background color white.</p>
  :
  : @param $width the width of the new image
  : @param $height the height of the new image
@@ -133,37 +133,37 @@
 declare %private function basic:create-impl($width as xs:unsignedInt, $height as xs:unsignedInt, $format as xs:string) as xs:base64Binary external; 
 
 (:~
- : Reads exif information from an image.
- : This function works for JPEG and TIFF images only. 
- : It returns empty sequence if no exif information matching the passed tag is found.
+ : <p>Reads exif information from an image.</p>
+ : <p>This function works for JPEG and TIFF images only.</p> 
+ : <p>It returns empty sequence if no exif information matching the passed tag is found.</p>
  :
  : @param $image the image
  : @param $tag the field name we want read (e.g. DateTime).
  : @return exif field content
- : @error ierr:IM001 the passed image is invalid.
+ : @error ierr:INVALID_IMAGE the passed image is invalid.
  : @example test/Queries/image/basic_exif.xq
  :)
 declare function basic:exif($image as xs:base64Binary, $tag as xs:string) as xs:string? external; 
 
 (:~
- : Compares two images.
+ : <p>Compares two images.</p>
  :
  : @param $image1 first image
  : @param $image2 second image
  : @return True if the images are equal.
- : @error ierr:IM001 one of the passed images is invalid.
+ : @error ierr:INVALID_IMAGE one of the passed images is invalid.
  : @example test/Queries/image/basic_equals.xq
  :)
 declare function basic:equals($image1 as xs:base64Binary, $image2 as xs:base64Binary) as xs:boolean external; 
 
 
 (:~
- : Converts an SVG image to a supported image format.
+ : <p>Converts an SVG image to a supported image format.</p>
  :
  : @param $svg the image to convert
  : @param $format target format 
  : @return the resulting image
- : @error ierr:IM001 the passed SVG is invalid.
+ : @error ierr:INVALID_IMAGE the passed SVG is invalid.
  : @example test/Queries/image/basic_svg.xq
  :)
 declare function basic:convert-svg(
@@ -182,12 +182,12 @@
 };
 
 (:~
- : Converts an SVG image to a supported image format.
+ : <p>Converts an SVG image to a supported image format.</p>
  :
  : @param $svg the image to convert as string
  : @param $format target format 
  : @return the resulting image
- : @error ierr:IM001 the passed SVG is invalid.
+ : @error ierr:INVALID_IMAGE the passed SVG is invalid.
  : @example test/Queries/image/basic_svg.xq
  :)
 declare function basic:convert-svg-string(

=== renamed directory 'src/com/zorba-xquery/www/modules/image/basic.xq.src' => 'src/basic.xq.src'
=== modified file 'src/basic.xq.src/basic_module.h'
--- src/com/zorba-xquery/www/modules/image/basic.xq.src/basic_module.h	2011-10-06 08:18:47 +0000
+++ src/basic.xq.src/basic_module.h	2013-08-12 22:55:38 +0000
@@ -33,7 +33,7 @@
  
 
   virtual String
-  getURI() const { return "http://www.zorba-xquery.com/modules/image/basic";; }
+  getURI() const { return "http://zorba.io/modules/image/basic";; }
 
 };
 

=== removed directory 'src/com'
=== removed file 'src/com/CMakeLists.txt'
--- src/com/CMakeLists.txt	2011-10-06 08:18:47 +0000
+++ src/com/CMakeLists.txt	1970-01-01 00:00:00 +0000
@@ -1,17 +0,0 @@
-# Copyright 2006-2008 The FLWOR Foundation.
-# 
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-# 
-# http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# all external module libraries are generated in the directory
-# of the corresponding .xq file
-ADD_SUBDIRECTORY(zorba-xquery)

=== removed directory 'src/com/zorba-xquery'
=== removed file 'src/com/zorba-xquery/CMakeLists.txt'
--- src/com/zorba-xquery/CMakeLists.txt	2011-10-06 08:18:47 +0000
+++ src/com/zorba-xquery/CMakeLists.txt	1970-01-01 00:00:00 +0000
@@ -1,17 +0,0 @@
-# Copyright 2006-2008 The FLWOR Foundation.
-# 
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-# 
-# http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# all external module libraries are generated in the directory
-# of the corresponding .xq file
-ADD_SUBDIRECTORY(www)

=== removed directory 'src/com/zorba-xquery/www'
=== removed file 'src/com/zorba-xquery/www/CMakeLists.txt'
--- src/com/zorba-xquery/www/CMakeLists.txt	2011-10-06 08:18:47 +0000
+++ src/com/zorba-xquery/www/CMakeLists.txt	1970-01-01 00:00:00 +0000
@@ -1,17 +0,0 @@
-# Copyright 2006-2008 The FLWOR Foundation.
-# 
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-# 
-# http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# all external module libraries are generated in the directory
-# of the corresponding .xq file
-ADD_SUBDIRECTORY(modules)

=== removed directory 'src/com/zorba-xquery/www/modules'
=== removed file 'src/com/zorba-xquery/www/modules/CMakeLists.txt'
--- src/com/zorba-xquery/www/modules/CMakeLists.txt	2011-10-06 08:18:47 +0000
+++ src/com/zorba-xquery/www/modules/CMakeLists.txt	1970-01-01 00:00:00 +0000
@@ -1,15 +0,0 @@
-# Copyright 2006-2008 The FLWOR Foundation.
-# 
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-# 
-# http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-ADD_SUBDIRECTORY(image)
\ No newline at end of file

=== removed directory 'src/com/zorba-xquery/www/modules/image'
=== removed file 'src/com/zorba-xquery/www/modules/image/CMakeLists.txt'
--- src/com/zorba-xquery/www/modules/image/CMakeLists.txt	2012-10-29 20:36:25 +0000
+++ src/com/zorba-xquery/www/modules/image/CMakeLists.txt	1970-01-01 00:00:00 +0000
@@ -1,86 +0,0 @@
-# Copyright 2006-2010 The FLWOR Foundation.
-# 
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-# 
-# http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-########################################################################
-# ImageMagick
-########################################################################
-IF(ZORBA_SUPPRESS_ImageMagick)
-  MESSAGE(STATUS "ZORBA_SUPPRESS_ImageMagick is true - not searching for ImageMagick.")  
-ELSE(ZORBA_SUPPRESS_ImageMagick)
-  MESSAGE (STATUS "Looking for ImageMagick")
-  FIND_PACKAGE(ImageMagick COMPONENTS Magick++ MagickCore MagickWand)
-  
-  IF(ImageMagick_FOUND)
-    MESSAGE(STATUS "Found ImageMagick include dirs ${ImageMagick_INCLUDE_DIRS}")
-    MESSAGE(STATUS "Found ImageMagick libraries ${ImageMagick_LIBRARIES}")  
-    INCLUDE_DIRECTORIES("${ImageMagick_INCLUDE_DIRS}")
-    
-    INCLUDE_DIRECTORIES("image_commons")
-    INCLUDE_DIRECTORIES("image_draw")
-    DECLARE_ZORBA_SCHEMA(FILE image.xsd
-      URI "http://www.zorba-xquery.com/modules/image/image";)
-    DECLARE_ZORBA_MODULE(URI "http://www.zorba-xquery.com/modules/image/basic";
-      VERSION 2.0 FILE "basic.xq"
-      EXTRA_SOURCES image_commons image_draw
-      LINK_LIBRARIES ${ImageMagick_LIBRARIES})
-    DECLARE_ZORBA_MODULE(VERSION 1.0 FILE "manipulation.xq"
-      URI "http://www.zorba-xquery.com/modules/image/manipulation";
-      EXTRA_SOURCES image_commons
-      LINK_LIBRARIES ${ImageMagick_LIBRARIES})
-    DECLARE_ZORBA_MODULE(VERSION 1.0 FILE "paint.xq"
-      URI "http://www.zorba-xquery.com/modules/image/paint";
-      EXTRA_SOURCES image_draw image_commons
-      LINK_LIBRARIES ${ImageMagick_LIBRARIES})
-    DECLARE_ZORBA_MODULE(VERSION 1.0 FILE "animation.xq"
-      URI "http://www.zorba-xquery.com/modules/image/animation";
-      EXTRA_SOURCES image_commons
-      LINK_LIBRARIES ${ImageMagick_LIBRARIES})
-
-    # this could crash because of the ImageMagick version
-    # must be compiled in debug mode
-    SET (KNOWN_CRASHES)
-    IF (WIN32)
-      IF (CMAKE_BUILD_TYPE STREQUAL "Debug")
-        LIST (APPEND KNOWN_CRASHES
-          zorba_image_module/image/basic.xq 867693
-          zorba_image_module/image/basic_convert.xq 867693
-          zorba_image_module/image/basic_create.xq 867693
-          zorba_image_module/image/paint_1.xq 867693
-          zorba_image_module/image/paint_2.xq 867693
-          zorba_image_module/image/paint_3.xq 867693
-          zorba_image_module/image/paint_4.xq 867693
-          zorba_image_module/image/paint_5.xq 867693
-          zorba_image_module/image/paint_6.xq 867693
-          zorba_image_module/image/paint_circles.xq 867693
-          zorba_image_module/image/paint_different_lines.xq 867693
-          zorba_image_module/image/paint_polygon.xq 867693
-          zorba_image_module/image/paint_polyline.xq 867693
-          zorba_image_module/image/paint_rectangles.xq 867693
-          zorba_image_module/image/paint_stroked_polyline.xq 867693
-          zorba_image_module/image/paint_text.xq 867693
-        )
-      ENDIF (CMAKE_BUILD_TYPE STREQUAL "Debug")
-    ENDIF (WIN32)
-
-    ADD_TEST_DIRECTORY ("${PROJECT_SOURCE_DIR}/test" "${KNOWN_CRASHES}")
-    
-  ELSE (ImageMagick_FOUND)
-    MESSAGE(STATUS "Magick++   component found: ${ImageMagick_Magick++_FOUND}")
-    MESSAGE(STATUS "MagickCore component found: ${ImageMagick_MagickCore_FOUND}")
-    MESSAGE(STATUS "MagickWand component found: ${ImageMagick_MagickWand_FOUND}") 
-    MESSAGE(STATUS "If you want to use image handling functionality please install the ImageMagick library containing these 3 components: Magick++, MagickCore, MagickWand.\n Please note that on some OS\n- ImageMagick and\n- libMagick++ (on OpenSuse) or ImageMagick-c++(on Fedora)\n are 2 different packages and you need to install both of them and additionally their development packages.")
-  ENDIF (ImageMagick_FOUND)
-ENDIF(ZORBA_SUPPRESS_ImageMagick)
-MESSAGE(STATUS "") 

=== added file 'src/image.jsd'
--- src/image.jsd	1970-01-01 00:00:00 +0000
+++ src/image.jsd	2013-08-12 22:55:38 +0000
@@ -0,0 +1,360 @@
+{
+ "$namespace" : "http://zorba.io/modules/images/";
+ "$types" : [
+  {                    
+    "$name" : "imageFormat",
+    "$about" : "This schema defines the different types used in the modules under:
+                http://zorba.io/modules/images/";, 
+    "$kind" : "atomic",
+    "$baseType" : "string",
+    "$enumarion" : [ "GIF", "PNG", "JPEG", "TIFF", "BMP" ]  
+  },
+  {                    
+    "$name" : "colorType",
+    "$about" : "This type defines how colors should be formatted.",
+    "$kind" : "atomic",
+    "$baseType" : "string",
+    "$length" : 7,
+    "$pattern" : "[#]([A-F0-9]{6})" 
+  },
+  {
+    "$name" : "noiseType",
+    "$about" : "This type defines the different names that are allowed as noise identifiers.",
+    "$kind" : "atomic",
+    "$baseType" : "string",
+    "$enumarion" : [ "UniformNoise", "GaussianNoise", "MultiplicativeGaussianNoise", "ImpulseNoise", "LaplacianNoise", "PoissonNoise" ]  
+  },
+  {
+    "$name" : "compositeOperatorType",
+    "$about" : "This type defines the different operators applicable for overlaying images.
+                OverCompositeOp: The result is the union of the the two image shapes with the composite image obscuring image in the region of overlap. 
+                InCompositeOp: The result is a simply composite image cut by the shape of image. None of the image data of image is included in the result.
+                OutCompositeOp: The resulting image is composite image with the shape of image cut out.
+                AtopCompositeOp: The result is the same shape as image image, with composite image obscuring image there the image shapes overlap. Note that this differs from OverCompositeOp because the portion of composite image outside of image's shape does not appear in the result.
+                XorCompositeOp: The result is the image data from both composite image and image that is outside the overlap region. The overlap region will be blank.
+                PlusCompositeOp: The result is just the sum of the  image data. Output values are cropped to 255 (no overflow). This operation is independent of the matte channels.
+                MinusCompositeOp: The result of composite image - image, with overflow cropped to zero. The matte chanel is ignored (set to 255, full coverage).
+                AddCompositeOp: The result of composite image + image, with overflow wrapping around (mod 256).
+                SubtractCompositeOp: The result of composite image - image, with underflow wrapping around (mod 256). The add and subtract operators can be used to perform reverible transformations.
+                DifferenceCompositeOp: The result of abs(composite image - image). This is useful for comparing two very similar images.
+                BumpmapCompositeOp: The result image shaded by composite image."
+    "$kind" : "atomic",
+    "$baseType" : "string",
+    "$enumarion" : [ "OverCompositeOp", "InCompositeOp", "OutCompositeOp", "AtopCompositeOp", "XorCompositeOp", "PlusCompositeOp", "MinusCompositeOp", "AddCompositeOp", "SubtractCompositeOp", "DifferenceCompositeOp", "BumpmapCompositeOp" ]  
+  },
+  {
+    "$name" : "pointType",
+    "$kind" : "array",
+    "$content" : [ "integer" ],
+    "$minLength" : 2,
+    "$maxLength" : 2
+  },
+  {
+    "$name" : "pointsType",
+    "$kind" : "array",
+    "$content" : [ "pointType" ],
+    "$minLength" : 1
+  },
+  {
+    "$name" : "line",
+    "$kind" : "object",
+    "$content" : {
+      "start" : {
+        "$type" : "pointType"
+      },
+      "end" : {
+        "$type" : "pointType"
+      },
+      "strokeWidth" : {
+        "$type" : "double",
+        "$optional" : true
+      },
+      "strokeColor" : {
+        "$type" : "colorType",
+        "optional" : true
+      },
+      "fillColor" : {
+        "$type" : "colorType",
+        "optional" : true
+      },
+      "antiAliasing" : {
+        "$type" : "boolean",
+        "optional" : true
+      }
+    }
+  },
+  {
+    "$name" : "polyLine",
+    "$kind" : "object"
+    "$content" : {
+      "points" : {
+        "$type" : "pointsType"
+      },
+      "strokeWidth" : {
+        "$type" : "double",
+        "$optional" : true
+      },
+      "strokeColor" : {
+        "$type" : "colorType",
+        "optional" : true
+      },
+      "fillColor" : {
+        "$type" : "colorType",
+        "optional" : true
+      },
+      "antiAliasing" : {
+        "$type" : "boolean",
+        "optional" : true
+      }
+    }
+  },
+  {
+    "$name" : "strokedPolyLine"
+    "$kind" : "object"
+    "$content" : {
+      "points" : {
+        "$type" : "pointsType"
+      },
+      "strokeLength" : {
+        "$type" : "double"
+      },
+      "gapLength" : {
+        "$type" : "double"
+      },
+      "strokeWidth" : {
+        "$type" : "double",
+        "$optional" : true
+      },
+      "strokeColor" : {
+        "$type" : "colorType",
+        "optional" : true
+      },
+      "fillColor" : {
+        "$type" : "colorType",
+        "optional" : true
+      },
+      "antiAliasing" : {
+        "$type" : "boolean",
+        "optional" : true
+      }
+    }
+  },
+  {
+    "$name" : "rectangle",
+    "$kind" : "object",
+    "$content" : {
+      "upperLeft" : {
+        "$type" : "pointType"
+      },
+      "lowerRight" : {
+        "$type" : "pointType"
+      },
+      "strokeWidth" : {
+        "$type" : "double",
+        "$optional" : true
+      },
+      "strokeColor" : {
+        "$type" : "colorType",
+        "optional" : true
+      },
+      "fillColor" : {
+        "$type" : "colorType",
+        "optional" : true
+      },
+      "antiAliasing" : {
+        "$type" : "boolean",
+        "optional" : true
+      }
+    }
+  },
+  {
+    "$name" : "roundedRectangle",
+    "$kind" : "object",
+    "$content" : {
+      "upperLeft" : {
+        "$type" : "pointType"
+      },
+      "lowerRight" : {
+        "$type" : "pointType"
+      },
+      "cornerWidth" : {
+        "$type" : "double"
+      },
+      "cornerHeight" : {
+        "$type" : "double"
+      },
+      "strokeWidth" : {
+        "$type" : "double",
+        "$optional" : true
+      },
+      "strokeColor" : {
+        "$type" : "colorType",
+        "optional" : true
+      },
+      "fillColor" : {
+        "$type" : "colorType",
+        "optional" : true
+      },
+      "antiAliasing" : {
+        "$type" : "boolean",
+        "optional" : true
+      }  
+    }
+  },
+  {
+    "$name" : "circle",
+    "$kind" : "object",
+    "$content" : {
+      "origin" : {
+        "$type" : "pointType"
+      },
+      "radius" : {
+        "$type" : "double"
+      },
+      "strokeWidth" : {
+        "$type" : "double",
+        "$optional" : true
+      },
+      "strokeColor" : {
+        "$type" : "colorType",
+        "optional" : true
+      },
+      "fillColor" : {
+        "$type" : "colorType",
+        "optional" : true
+      },
+      "antiAliasing" : {
+        "$type" : "boolean",
+        "optional" : true
+      }
+    }
+  },
+  {
+    "$name" : "ellipse",
+    "$kind" : "object",
+    "$content" : {
+      "origin" : {
+        "$type" : "pointType"
+      },
+      "radiusX" : {
+        "$type" : "double"
+      },
+      "radiusY" : {
+        "$type" : "double"
+      },
+      "strokeWidth" : {
+        "$type" : "double",
+        "$optional" : true
+      },
+      "strokeColor" : {
+        "$type" : "colorType",
+        "optional" : true
+      },
+      "fillColor" : {
+        "$type" : "colorType",
+        "optional" : true
+      },
+      "antiAliasing" : {
+        "$type" : "boolean",
+        "optional" : true
+      }
+    }
+  },
+  {
+    "$name" : "arc",
+    "$kind" : "object",
+    "$content" : {
+      "origin" : {
+        "$type" : "pointType"
+      },
+      "radiusX" : {
+        "$type" : "double"
+      },
+      "radiusY" : {
+        "$type" : "double"
+      },
+      "startDegrees" : {
+        "$type" : "double"
+      },
+      "endDegrees" : {
+        "$type" : "double"
+      },
+      "strokeWidth" : {
+        "$type" : "double",
+        "$optional" : true
+      },
+      "strokeColor" : {
+        "$type" : "colorType",
+        "optional" : true
+      },
+      "fillColor" : {
+        "$type" : "colorType",
+        "optional" : true
+      },
+      "antiAliasing" : {
+        "$type" : "boolean",
+        "optional" : true
+      }
+    }
+  },
+  {
+    "$name" : "polygon",
+    "$kind" : "object",
+    "$content" : {
+      "points" : {
+        "$kind" : "pointsType"
+      },
+      "strokeWidth" : {
+        "$type" : "double",
+        "$optional" : true
+      },
+      "strokeColor" : {
+        "$type" : "colorType",
+        "optional" : true
+      },
+      "fillColor" : {
+        "$type" : "colorType",
+        "optional" : true
+      },
+      "antiAliasing" : {
+        "$type" : "boolean",
+        "optional" : true
+      }
+    }
+  },
+  {
+    "$name" : "text",
+    "$kind" : "object",
+    "$content" : {
+      "origin" : {
+        "$type" : "pointType"
+      },
+      "text" : {
+        "$type" : "string"
+      },
+      "font" : {
+        "$type" : "string"
+      },
+      "fontSize" : {
+        "$type" : "double"
+      },
+      "strokeWidth" : {
+        "$type" : "double",
+        "$optional" : true
+      },
+      "strokeColor" : {
+        "$type" : "colorType",
+        "optional" : true
+      },
+      "fillColor" : {
+        "$type" : "colorType",
+        "optional" : true
+      },
+      "antiAliasing" : {
+        "$type" : "boolean",
+        "optional" : true
+      }
+    }
+  }             
+ ]
+}
\ No newline at end of file

=== renamed file 'src/com/zorba-xquery/www/modules/image/image.xsd' => 'src/image.xsd'
--- src/com/zorba-xquery/www/modules/image/image.xsd	2011-08-07 00:38:36 +0000
+++ src/image.xsd	2013-08-12 22:55:38 +0000
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <schema 
     xmlns="http://www.w3.org/2001/XMLSchema"; 
-    targetNamespace="http://www.zorba-xquery.com/modules/image/image";
-    xmlns:image="http://www.zorba-xquery.com/modules/image/image";
+    targetNamespace="http://zorba.io/modules/image/image";
+    xmlns:image="http://zorba.io/modules/image/image";
     elementFormDefault="qualified">
 
 <!--
@@ -25,7 +25,7 @@
   <annotation xml:lang="en">
         <documentation>
             This schema defines the different types used in the modules under:
-            http://www.zorba-xquery.com/modules/images/
+            http://zorba.io/modules/images/
         </documentation>
     </annotation>
     

=== renamed directory 'src/com/zorba-xquery/www/modules/image/image_commons' => 'src/image_commons'
=== modified file 'src/image_commons/image_function.cpp'
--- src/com/zorba-xquery/www/modules/image/image_commons/image_function.cpp	2013-07-31 21:49:56 +0000
+++ src/image_commons/image_function.cpp	2013-08-12 22:55:38 +0000
@@ -55,8 +55,8 @@
 ImageFunction::throwImageError(const DynamicContext* aDynamicContext, const char *aMessage) {
   std::stringstream lErrorMessage;
   // constuct error QName
-  String lNamespace = "http://www.zorba-xquery.com/modules/image/error";;
-  String lLocalname = "IM001";
+  String lNamespace = "http://zorba.io/modules/image/error";;
+  String lLocalname = "INVALID_IMAGE";
   Item lQName = ImageModule::getItemFactory()->createQName(lNamespace, "image", lLocalname);
   // if we have zero length image, then tell the user so
   if (std::string(aMessage).find("zero-length") != std::string::npos) {
@@ -70,7 +70,7 @@
 
 void 
 ImageFunction::throwErrorWithQName (const DynamicContext* aDynamicContext, const String& aLocalName, const String& aMessage) {
-   String lNamespace = "http://www.zorba-xquery.com/modules/image/error";;
+   String lNamespace = "http://zorba.io/modules/image/error";;
    Item lQName = ImageModule::getItemFactory()->createQName(lNamespace, "image", aLocalName);
    USER_EXCEPTION(lQName, aMessage); 
 }

=== modified file 'src/image_commons/image_module.h'
--- src/com/zorba-xquery/www/modules/image/image_commons/image_module.h	2012-08-31 22:09:12 +0000
+++ src/image_commons/image_module.h	2013-08-12 22:55:38 +0000
@@ -54,7 +54,7 @@
 
 public:
   virtual String
-     getURI() const { return "http://www.zorba-xquery.com/modules/image/";; }
+     getURI() const { return "http://zorba.io/modules/image/";; }
   
   ImageModule()
   {

=== renamed directory 'src/com/zorba-xquery/www/modules/image/image_draw' => 'src/image_draw'
=== renamed file 'src/com/zorba-xquery/www/modules/image/manipulation.xq' => 'src/manipulation.xq'
--- src/com/zorba-xquery/www/modules/image/manipulation.xq	2013-08-09 09:37:05 +0000
+++ src/manipulation.xq	2013-08-12 22:55:38 +0000
@@ -1,19 +1,3 @@
-(:
- : Copyright 2006-2009 The FLWOR Foundation.
- :
- : Licensed under the Apache License, Version 2.0 (the "License");
- : you may not use this file except in compliance with the License.
- : You may obtain a copy of the License at
- :
- : http://www.apache.org/licenses/LICENSE-2.0
- :
- : Unless required by applicable law or agreed to in writing, software
- : distributed under the License is distributed on an "AS IS" BASIS,
- : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- : See the License for the specific language governing permissions and
- : limitations under the License.
-:)
-
 xquery version "3.0";
 (:
  : Copyright 2006-2009 The FLWOR Foundation.
@@ -33,43 +17,43 @@
 
 
 (:~
- : This module provides functions to handle image manipulations like resizing, zooming, 
- : special effects etc.
+ : <p>This module provides functions to handle image manipulations like resizing, zooming, 
+ : special effects etc.</p>
  :
  : <p>The errors raised by functions of this module have the namespace
- : <tt>http://www.zorba-xquery.com/modules/image/error</tt> (associated with prefix ierr).</p>
+ : <tt>http://zorba.io/modules/image/error</tt> (associated with prefix ierr).</p>
  :
  : @author Daniel Thomas
  : @library <a href="http://www.imagemagick.org/Magick++/";>Magick++ C++ Library</a>
  : @project Zorba/Image/Manipulation
  :
  :)
-module namespace man = 'http://www.zorba-xquery.com/modules/image/manipulation';
+module namespace man = 'http://zorba.io/modules/image/manipulation';
 
-import schema namespace image = 'http://www.zorba-xquery.com/modules/image/image';
+import schema namespace image = 'http://zorba.io/modules/image/image';
 
 declare namespace err = "http://www.w3.org/2005/xqt-errors";;
-declare namespace ierr = "http://www.zorba-xquery.com/modules/image/error";;
+declare namespace ierr = "http://zorba.io/modules/image/error";;
 declare namespace ver = "http://zorba.io/options/versioning";;
 declare option ver:module-version "1.0";
 
 (:~
- : Get a copy of the passed image with changed width and height (without 
- : zooming the image's content). 
- : To change the size of the actual contents of an image, use the zoom function.
- :
- : More in detail: If the new dimensions are greater than the current dimensions 
+ : <p>Get a copy of the passed image with changed width and height (without 
+ : zooming the image's content).</p> 
+ : <p>To change the size of the actual contents of an image, use the zoom function.</p>
+ : <p/>
+ : <p>More in detail: If the new dimensions are greater than the current dimensions 
  : the new image will have the passed image in the upper left corner and the rest 
- : will be filled with the current background color.
- : If the passed dimensions are less than the current dimensions, the new image 
+ : will be filled with the current background color.</p>
+ : <p>If the passed dimensions are less than the current dimensions, the new image 
  : will contain the specified rectangle of the passed image beginning at the upper 
- : left corner.
+ : left corner.</p>
  :
  : @param $image image to resize
  : @param $width new width
  : @param $height new height
  : @return resized copy of the source image
- : @error ierr:IM001 passed image is invalid.
+ : @error ierr:INVALID_IMAGE passed image is invalid.
  : @example test/Queries/image/manipulation_resize.xq
  :)
 declare function man:resize($image as xs:base64Binary, 
@@ -77,34 +61,34 @@
                             $height as xs:unsignedInt) as xs:base64Binary external; 
 
 (:~
- : Zoom the passed image by the specified factor while keeping the ratio between 
- : width and height.
- :
- : A ratio of less than 1 will make the image smaller. 
- : A ratio of less or equal than 0 will not effect the image.
- : Important note: this function does not change the size information stored in the
- : image (e.g. basic:width will not show a different value).
+ : <p>Zoom the passed image by the specified factor while keeping the ratio between 
+ : width and height.</p>
+ : <p/>
+ : <p>A ratio of less than 1 will make the image smaller.</p> 
+ : <p>A ratio of less or equal than 0 will not effect the image.</p>
+ : <p>Important note: this function does not change the size information stored in the
+ : image (e.g. basic:width will not show a different value).</p>
  :
  : @param $image image to resize
  : @param $ratio ratio to zoom width and height by
  : @return A copy of $image with resized content
- : @error ierr:IM001 passed image is invalid
+ : @error ierr:INVALID_IMAGE the passed image is invalid.
  : @example test/Queries/image/manipulation_zoom.xq
  :)
 declare function man:zoom($image as xs:base64Binary, 
                           $ratio as xs:double) as xs:base64Binary external; 
 
 (:~
- : Zoom the passed image to a given new width while keeping the ratio between 
- : width and height. 
- : So, the height is scaled accordingly.
- : Important note: this function does not change the size information stored 
- : in the image (e.g. basic:width will not show a different value).
+ : <p>Zoom the passed image to a given new width while keeping the ratio between 
+ : width and height.</p> 
+ : <p>So, the height is scaled accordingly.</p>
+ : <p>Important note: this function does not change the size information stored 
+ : in the image (e.g. basic:width will not show a different value).</p>
  : 
  : @param $image image to resize
  : @param $width new width for the image in pixels
  : @return A copy of $image with given $width and height changed accordingly
- : @error ierr:IM001 passed image is invalid
+ : @error ierr:INVALID_IMAGE the passed image is invalid.
  : @example test/Queries/image/manipulation_zoom_width.xq
  :)
 declare function man:zoom-by-width($image as xs:base64Binary, 
@@ -112,26 +96,26 @@
 
 
 (:~
- : Zoom the passed image to a given new height while keeping the ratio between 
- : width and height.
- : So, the width is scaled accordingly.
- : Important note: this function does not change the size information stored 
- : in the image (e.g. basic:width will not show a different value).
+ : <p>Zoom the passed image to a given new height while keeping the ratio between 
+ : width and height.</p>
+ : <p>So, the width is scaled accordingly.</p>
+ : <p>Important note: this function does not change the size information stored 
+ : in the image (e.g. basic:width will not show a different value).</p>
  : 
  : @param $image image to resize
  : @param $height new height for the image in pixels
  : @return A copy of $image with given $height and width adjusted accordingly
- : @error ierr:IM001 passed image is invalid
+ : @error ierr:INVALID_IMAGE the passed image is invalid.
  : @example test/Queries/image/manipulation_zoom_height.xq
  :)
 declare function man:zoom-by-height($image as xs:base64Binary, 
                                     $height as xs:unsignedInt) as xs:base64Binary external; 
 
 (:~
- : Copy a part of the source image specified by a rectangle. 
- : If the passed parameters for the sub-image specify a rectangle that isn't 
+ : <p>Copy a part of the source image specified by a rectangle.</p> 
+ : <p>If the passed parameters for the sub-image specify a rectangle that isn't 
  : entirely within the source image only the area that lies within the image 
- : boundaries will be returned.
+ : boundaries will be returned.</p>
  :
  : @param $image the image from which to extract a sub-image
  : @param $left-upper-x is the x value of the upper left corner of the rectangle
@@ -141,7 +125,7 @@
  : @param $width width of the rectangle to cut out
  : @param $height height of the rectangle to cut out
  : @return A new image containing parts of the source image
- : @error ierr:IM001 passed image is invalid
+ : @error ierr:INVALID_IMAGE the passed image is invalid.
  : @example test/Queries/image/manipulation_sub_image.xq
  :)
 declare function man:sub-image($image as xs:base64Binary, 
@@ -151,10 +135,10 @@
                                $height as xs:unsignedInt) as xs:base64Binary external; 
 
 (:~
- : Overlay $image with $overlay-image at the specfied position.
- :
- : The $operator defines the details of the overlay and can have one of the 
- : following values:
+ : <p>Overlay $image with $overlay-image at the specfied position.</p>
+ : <p/>
+ : <p>The $operator defines the details of the overlay and can have one of the 
+ : following values:</p>
  : <ul> 
  :   <li>OverCompositeOp: The result is the union of the two image shapes 
  :       with the overlay image obscuring image in the region of overlap.</li> 
@@ -194,7 +178,7 @@
  : @param $operator defines how the overlay image should be overlayed (see details
  :                  in operator listing above)
  : @return A new image consisting of $image overlayed with $overlay-image.
- : @error ierr:IM001 passed image is invalid
+ : @error ierr:INVALID_IMAGE the passed image is invalid.
  : @error err:FORG0001 unsupported operator
  : @example test/Queries/image/manipulation_overlay.xq
  :)
@@ -218,14 +202,14 @@
   as xs:base64Binary external; 
 
 (:~
- : Copy a part of a source image as new image. 
- : The copied part is all right of $upper-left-x and below $upper-left-y.
+ : <p>Copy a part of a source image as new image.</p> 
+ : <p>The copied part is all right of $upper-left-x and below $upper-left-y.</p>
  : 
  : @param $image source image
  : @param $upper-left-x x position of the upper left corner of the part to copy
  : @param $upper-left-y y position of the upper left corner of the part to copy
  : @return A new image copied from a part of source image
- : @error ierr:IM001 passed image is invalid
+ : @error ierr:INVALID_IMAGE the passed image is invalid.
  : @example test/Queries/image/manipulation_chop.xq
  :)
 declare function man:chop($image as xs:base64Binary, 
@@ -233,14 +217,14 @@
                           $upper-left-y as xs:unsignedInt) as xs:base64Binary external; 
 
 (:~
- : Copy a part of a source image as new image.
- : The copied part is all left of $lower-right-x and above $lower-right-y.
+ : <p>Copy a part of a source image as new image.</p>
+ : <p>The copied part is all left of $lower-right-x and above $lower-right-y.</p>
  : 
  : @param $image source image
  : @param $lower-right-x x position of the lower right corner of the part to copy
  : @param $lower-right-y y position of the lower right corner of the part to copy
  : @return A new image copied from a part of source image
- : @error ierr:IM001 passed image is invalid
+ : @error ierr:INVALID_IMAGE the passed image is invalid.
  : @example test/Queries/image/manipulation_crop.xq
  :)
 declare function man:crop($image as xs:base64Binary, 
@@ -249,16 +233,16 @@
 
 
 (:~
- : Get a new image as rotated copy of a passed source image (rotated by -360 to 
- : 360 degrees).
- : The image is enlarged if this is required for containing the rotated image, 
- : but never shrunk even if the rotation would make a smaller image possible.
+ : <p>Get a new image as rotated copy of a passed source image (rotated by -360 to 
+ : 360 degrees).</p>
+ : <p>The image is enlarged if this is required for containing the rotated image, 
+ : but never shrunk even if the rotation would make a smaller image possible.</p>
  :
  : @param $image source image.
  : @param $angle between -360 to 360 degrees. Other values will be adjusted by 
  :               modulo 360
  : @return A rotated copy of $image
- : @error ierr:IM001 passed image is invalid
+ : @error ierr:INVALID_IMAGE the passed image is invalid.
  : @example test/Queries/image/manipulation_rotate.xq
  :)
 declare function man:rotate($image as xs:base64Binary, 
@@ -266,50 +250,50 @@
 
 
 (:~
- : Set all pixels of the image to the current backround color.
- : In most cases, this will result in all pixels to be set to white.
+ : <p>Set all pixels of the image to the current backround color.</p>
+ : <p>In most cases, this will result in all pixels to be set to white.</p>
  :
  : @param $image image to erase
  : @return A copy of image with all pixels set to the current background color
- : @error ierr:IM001 passed image is invalid
+ : @error ierr:INVALID_IMAGE the passed image is invalid.
  : @example test/Queries/image/manipulation_erase.xq
  :)
 declare function man:erase($image as xs:base64Binary) as xs:base64Binary external; 
 
 (:~
- : Flop an image (horizontal rotation).
+ : <p>Flop an image (horizontal rotation).</p>
  :
  : @param $image source image
  : @return A horizontally rotated copy of $image
- : @error ierr:IM001 passed image is invalid
+ : @error ierr:INVALID_IMAGE the passed image is invalid.
  : @example test/Queries/image/manipulation_flop.xq
  :)
 declare function man:flop($image as xs:base64Binary) as xs:base64Binary external; 
 
 (:~
- : Flip an image (vertical rotation).
+ : <p>Flip an image (vertical rotation).</p>
  :
  : @param $image source image
  : @return A vertically rotated copy of $image
- : @error ierr:IM001 passed image is invalid
+ : @error ierr:INVALID_IMAGE the passed image is invalid.
  : @example test/Queries/image/manipulation_flip.xq
  :)
 declare function man:flip($image as xs:base64Binary) as xs:base64Binary external; 
 
 (:~
- : Trim edges of the image's background color from the image.
+ : <p>Trim edges of the image's background color from the image.</p>
  :
  : @param $image the source image
  : @return A trimmed copy of $image
- : @error ierr:IM001 passed image is invalid
+ : @error ierr:INVALID_IMAGE the passed image is invalid.
  : @example test/Queries/image/manipulation_trim.xq
  :)
 declare function man:trim($image as xs:base64Binary) as xs:base64Binary external; 
 
 (:~
- : Add noise to an image.
- :
- : Allowed noise types are: 
+ : <p>Add noise to an image.</p>
+ : <p/>
+ : <p>Allowed noise types are:</p> 
  : <ul> 
  :  <li>UniformNoise</li>
  :  <li>GaussianNoise</li>
@@ -322,7 +306,7 @@
  : @param $image the source image
  : @param $noise-type specifies the type of noise to add 
  : @return A copy of $image with added noise
- : @error ierr:IM001 passed image is invalid
+ : @error ierr:INVALID_IMAGE the passed image is invalid.
  : @error err:FORG0001 unsupported noise type
  : @example test/Queries/image/manipulation_add_noise.xq
  :)
@@ -336,13 +320,13 @@
   as xs:base64Binary external;
 
 (:~ 
- : Blur an image.
+ : <p>Blur an image.</p>
  : 
  : @param $image the source image
  : @param $radius is the radius of the Gaussian in pixels.
  : @param $sigma is the standard deviation of the Laplacian in pixels.
  : @return A blured copy of $image
- : @error ierr:IM001 passed image is invalid
+ : @error ierr:INVALID_IMAGE the passed image is invalid.
  : @example test/Queries/image/manipulation_blur.xq
  :)
 declare function man:blur($image as xs:base64Binary, 
@@ -350,55 +334,55 @@
                           $sigma as xs:int) as xs:base64Binary external; 
 
 (:~
- : Despeckle an image.
+ : <p>Despeckle an image.</p>
  : 
  : @param $image the source image
  : @return A despeckled copy of $image
- : @error ierr:IM001 passed image is invalid
+ : @error ierr:INVALID_IMAGE the passed image is invalid.
  : @example test/Queries/image/manipulation_despeckle.xq
  :)
 declare function man:despeckle($image as xs:base64Binary) as xs:base64Binary external; 
 
 (:~
- : Enhance an images (minimizes noise).
+ : <p>Enhance an images (minimizes noise).</p>
  : 
  : @param $image the source image
  : @return An enhanced copy of $image.
- : @error ierr:IM001 passed image is invalid
+ : @error ierr:INVALID_IMAGE the passed image is invalid.
  : @example test/Queries/image/manipulation_enhance.xq
  :) 
 declare function man:enhance($image as xs:base64Binary) as xs:base64Binary external; 
 
 (:~
- : Equalize an images (histogramm equalization).
+ : <p>Equalize an images (histogramm equalization).</p>
  : 
  : @param $image the source image
  : @return An equalized copy of $image.
- : @error ierr:IM001 passed image is invalid
+ : @error ierr:INVALID_IMAGE the passed image is invalid.
  : @example test/Queries/image/manipulation_equalize.xq
  :) 
 declare function man:equalize($image as xs:base64Binary) as xs:base64Binary external; 
 
 (:~
- : Highlight edges in an image.
+ : <p>Highlight edges in an image.</p>
  : 
  : @param $image the source image
  : @param $radius radius of the pixel neighborhood (0 for automatic selection)
  : @return An edged copy of $image
- : @error ierr:IM001 passed image is invalid
+ : @error ierr:INVALID_IMAGE the passed image is invalid.
  : @example test/Queries/image/manipulation_edge.xq
  :) 
 declare function man:edge($image as xs:base64Binary, 
                           $radius as xs:unsignedInt) as xs:base64Binary external; 
 
 (:~
- : Apply a charcoal effect to the image (looks like a charcoal sketch).
+ : <p>Apply a charcoal effect to the image (looks like a charcoal sketch).</p>
  :
  : @param $image the source image
  : @param $radius radius of the Gaussian in pixels
  : @param $sigma standard deviation of the Laplacian in pixels
  : @return A charcoaled copy of $image
- : @error ierr:IM001 passed image is invalid
+ : @error ierr:INVALID_IMAGE the passed image is invalid.
  : @example test/Queries/image/manipulation_charcoal.xq
  :)
 declare function man:charcoal($image as xs:base64Binary, 
@@ -406,13 +390,13 @@
                               $sigma as xs:double) as xs:base64Binary external; 
 
 (:~
- : Emboss an images (highlights edges with 3D effect).
+ : <p>Emboss an images (highlights edges with 3D effect).</p>
  : 
  : @param $image the source image
  : @param $radius radius of the Gaussian in pixels
  : @param $sigma standard deviation of the Laplacian in pixels
  : @return An embossed copy of $image
- : @error ierr:IM001 passed image is invalid
+ : @error ierr:INVALID_IMAGE the passed image is invalid.
  : @example test/Queries/image/manipulation_emboss.xq
  :) 
 declare function man:emboss($image as xs:base64Binary, 
@@ -420,23 +404,23 @@
                             $sigma as xs:double) as xs:base64Binary external; 
 
 (:~
- : Apply a solarize effect to the image (similar to the effect seen when 
- : exposing a photographic film to light during the development process).
+ : <p>Apply a solarize effect to the image (similar to the effect seen when 
+ : exposing a photographic film to light during the development process).</p>
  :
  : @param $image the source image
  : @param $factor strength of the solarization (0 to 65535; 65535=100%)
  : @return A solarized copy of $image.
- : @error ierr:IM001 passed image is invalid
+ : @error ierr:INVALID_IMAGE the passed image is invalid.
  : @example test/Queries/image/manipulation_solarize.xq
  :)
 declare function man:solarize($image as xs:base64Binary, 
                               $factor as xs:double) as xs:base64Binary external; 
 
 (:~
- : Make two passed images appear as stereo image when viewed with red-blue glasses.
- : Both images should be same but from a slightly different angle for this to work.
- : Both images should have the same size, if not, the size of the left image will 
- : be taken.
+ : <p>Make two passed images appear as stereo image when viewed with red-blue glasses.</p>
+ : <p>Both images should be same but from a slightly different angle for this to work.</p>
+ : <p>Both images should have the same size, if not, the size of the left image will 
+ : be taken.</p>
  :
  : @param $left-image left image for the stereo image.
  : @param $right-image right image for the stereo image.
@@ -448,15 +432,15 @@
                             $right-image as xs:base64Binary) as xs:base64Binary external; 
 
 (:~
- : Make all pixels of the specfied color transparent.
- :
- : This works correctly only with image types supporting transparency 
- : (e.g GIF or PNG).
+ : <p>Make all pixels of the specfied color transparent.</p>
+ : <p/>
+ : <p>This works correctly only with image types supporting transparency 
+ : (e.g GIF or PNG).</p>
  :
  : @param $image the source image
  : @param $color color to make transparent (e.g. '#FFFFFF')
  : @return A copy of $image with the specified color made transparent.
- : @error ierr:IM001 passed image is invalid
+ : @error ierr:INVALID_IMAGE the passed image is invalid.
  : @error err:FORG0001 unsupported color
  : @example test/Queries/image/manipulation_transparent.xq
  :)
@@ -468,64 +452,64 @@
 declare %private function man:transparent-impl($image as xs:base64Binary, $color as image:colorType) as xs:base64Binary external; 
 
 (:~
- : Swirl an image (image pixels are rotated by degree).
+ : <p>Swirl an image (image pixels are rotated by degree).</p>
  :
  : @param $image the source image
  : @param $degree degree to swirl image pixels
  : @return A swirled copy of $image
- : @error ierr:IM001 passed image is invalid
+ : @error ierr:INVALID_IMAGE the passed image is invalid.
  : @example test/Queries/image/manipulation_swirl.xq
  :)
 declare function man:swirl($image as xs:base64Binary, 
                            $degree as xs:double) as xs:base64Binary external; 
 
 (:~
- : Reduce noise of an image using a noise peak elemination filter.
+ : <p>Reduce noise of an image using a noise peak elemination filter.</p>
  :
  : @param $image the source image
  : @param $order defines how much the noise is reduced
  : @return A copy of $image with reduced noise
- : @error ierr:IM001 passed image is invalid
+ : @error ierr:INVALID_IMAGE the passed image is invalid.
  : @example test/Queries/image/manipulation_reduce_noise.xq
  :)
 declare function man:reduce-noise($image as xs:base64Binary, 
                                   $order as xs:double) as xs:base64Binary external; 
  
 (:~
- : Contrast an image (enhances image intensity differences) by a given value.
+ : <p>Contrast an image (enhances image intensity differences) by a given value.</p>
  : 
  : @param $image the source image
  : @param $sharpen defines how much the image is contrasted.
  : @return A contrasted copy of $image 
- : @error ierr:IM001 passed image is invalid
+ : @error ierr:INVALID_IMAGE the passed image is invalid.
  : @example test/Queries/image/manipulation_contrast.xq
  :)
 declare function man:contrast($image as xs:base64Binary, 
                               $sharpen as xs:double) as xs:base64Binary external;
 
 (:~
- : Gamma correct an image.
- : Gamma values less than zero will erase the image.
+ : <p>Gamma correct an image.</p>
+ : <p>Gamma values less than zero will erase the image.</p>
  : 
  : @param $image the source image
  : @param $gamma-value value for which to gamma correct the image
  : @return A gamma corrected copy of $image
- : @error ierr:IM001 passed image is invalid
+ : @error ierr:INVALID_IMAGE the passed image is invalid.
  : @example test/Queries/image/manipulation_gamma.xq
  :)
 declare function man:gamma($image as xs:base64Binary, 
                            $gamma-value as xs:double) as xs:base64Binary external;
 
 (:~
- : Gamma correct an image for every color channel seperately.
- : Gamma values less than zero for any color will erase the corresponding color.
+ : <p>Gamma correct an image for every color channel seperately.</p>
+ : <p>Gamma values less than zero for any color will erase the corresponding color.</p>
  : 
  : @param $image the source image
  : @param $gamma-red value to gamma correct the red channel of the image
  : @param $gamma-green value to gamma correct the green channel of the image
  : @param $gamma-blue value to gamma correct the blue channel of the image
  : @return A gamma corrected copy of $image
- : @error ierr:IM001 passed image is invalid
+ : @error ierr:INVALID_IMAGE the passed image is invalid.
  : @example test/Queries/image/manipulation_gamma2.xq
  :)
 declare function man:gamma($image as xs:base64Binary, 
@@ -534,32 +518,32 @@
                            $gamma-blue as xs:double) as xs:base64Binary external; 
     
 (:~
- : Apply an implode effect to an image (a sort of special effect).
+ : <p>Apply an implode effect to an image (a sort of special effect).</p>
  : 
  : @param $image the source image
  : @param $factor factor to implode to
  : @return An imploded copy of $image.
- : @error ierr:IM001 passed image is invalid
+ : @error ierr:INVALID_IMAGE the passed image is invalid.
  : @example test/Queries/image/manipulation_implode.xq 
  :)
 declare function man:implode($image as xs:base64Binary, 
                              $factor as xs:double) as xs:base64Binary external; 
 
 (:~
- : Apply an oil paint effect to an image (makes the image look as if it was 
- : an oil paint).
+ : <p>Apply an oil paint effect to an image (makes the image look as if it was 
+ : an oil paint).</p>
  :
  : @param $image the source image
  : @param $radius radius with which to oil paint
  : @return A oil-painted copy of $image
- : @error ierr:IM001 passed image is invalid
+ : @error ierr:INVALID_IMAGE the passed image is invalid.
  : @example test/Queries/image/manipulation_oil_paint.xq
  :)
 declare function man:oil-paint($image as xs:base64Binary, 
                                $radius as xs:double) as xs:base64Binary external; 
  
 (:~
- : Add a $watermark image to $image.
+ : <p>Add a $watermark image to $image.</p>
  : 
  : @param $image the source image
  : @param $watermark the watermark image

=== renamed directory 'src/com/zorba-xquery/www/modules/image/manipulation.xq.src' => 'src/manipulation.xq.src'
=== modified file 'src/manipulation.xq.src/manipulation_module.h'
--- src/com/zorba-xquery/www/modules/image/manipulation.xq.src/manipulation_module.h	2011-10-06 08:18:47 +0000
+++ src/manipulation.xq.src/manipulation_module.h	2013-08-12 22:55:38 +0000
@@ -31,7 +31,7 @@
   
   
   virtual String
-  getURI() const { return "http://www.zorba-xquery.com/modules/image/manipulation";; }
+  getURI() const { return "http://zorba.io/modules/image/manipulation";; }
   
   virtual ExternalFunction*
   getExternalFunction(const String& aLocalname);

=== renamed file 'src/com/zorba-xquery/www/modules/image/paint.xq' => 'src/paint.xq'
--- src/com/zorba-xquery/www/modules/image/paint.xq	2013-08-09 09:37:05 +0000
+++ src/paint.xq	2013-08-12 22:55:38 +0000
@@ -17,9 +17,9 @@
 :)
 
 (:~
- : This module provides a function to extend an image with additional shapes. 
- : 
- : Fully supported image formats are:
+ : <p>This module provides a function to extend an image with additional shapes.</p> 
+ : <p/> 
+ : <p>Fully supported image formats are:</p>
  : <ul>
  :   <li>GIF</li>
  :   <li>JPEG</li>
@@ -29,136 +29,169 @@
  : </ul>
  :
  : <p>The errors raised by functions of this module have the namespace
- : <tt>http://www.zorba-xquery.com/modules/image/error</tt> (associated with prefix ierr).</p>
+ : <tt>http://zorba.io/modules/image/error</tt> (associated with prefix ierr).</p>
  :
  : @author Daniel Thomas
  : @library <a href="http://www.imagemagick.org/Magick++/";>Magick++ C++ Library</a>
  : @project Zorba/Image/Paint
  :
  :)
-module namespace paint = 'http://www.zorba-xquery.com/modules/image/paint';
+module namespace paint = 'http://zorba.io/modules/image/paint';
 
-import schema namespace img = 'http://www.zorba-xquery.com/modules/image/image';
+import schema namespace img = 'http://zorba.io/modules/image/image';
 
 declare namespace err = "http://www.w3.org/2005/xqt-errors";;
-declare namespace ierr = "http://www.zorba-xquery.com/modules/image/error";;
+declare namespace ierr = "http://zorba.io/modules/image/error";;
 declare namespace ver = "http://zorba.io/options/versioning";;
 declare option ver:module-version "1.0";
 
 
 (:~
- : Extends the passed image with a sequence of shapes. 
- : The shapes are passed as a sequence of elements.
- : The possibilities for shape elements are:
+ : <p>Extends the passed image with a sequence of shapes.</p> 
+ : <p>The shapes are passed as a sequence of elements.</p>
+ : <p>The possibilities for shape elements are:</p>
  :    <ul>
  :      <li> line: 
- :        <pre class="brush: xml">
- :          &lt;img:line&gt;
- :            &lt;img:start&gt;&lt;img:x&gt;-20&lt;/img:x&gt;&lt;img:y&gt;-20&lt;/img:y&gt;&lt;/img:start&gt;
- :            &lt;img:end&gt;&lt;img:x&gt;80&lt;/img:x&gt;&lt;img:y&gt;80&lt;/img:y&gt;&lt;/img:end&gt;
- :          &lt;/img:line&gt;</pre>
+ :        <pre class="brush: json">
+ :          { 
+ :            "line" : 
+ :            {      
+ :              "start" : [0, 0],
+ :              "end" : [80, 80] 
+ :            } 
+ :          }
+ :          </pre>
  :      </li> 
  :       <li> polyline: 
- :         <pre class="brush: xml">
- :           &lt;img:polyLine&gt;
- :             &lt;img:point&gt;&lt;img:x&gt;10&lt;/img:x&gt;&lt;img:y&gt;10&lt;/img:y&gt;&lt;/img:point&gt;
- :             &lt;img:point&gt;&lt;img:x&gt;40&lt;/img:x&gt;&lt;img:y&gt;80&lt;/img:y&gt;&lt;/point&gt;
- :             &lt;img:point&gt;&lt;img:x&gt;50&lt;/img:x&gt;&lt;img:y&gt;30&lt;/img:y&gt;&lt;/point&gt;
- :             &lt;img:point&gt;&lt;img:x&gt;200&lt;/img:x&gt;&lt;img:y&gt;200&lt;/img:y&gt;&lt;/point&gt;
- :           &lt;/img:polyLine&gt; 
+ :         <pre class="">
+ :           { 
+ :             "polyLine" : 
+ :             {
+ :               "points" : [ [10, 10], [30, 10], [30, 30], [10, 30] ] 
+ :             } 
+ :           }
  :         </pre>
  :       </li>
  :       <li> stroked polyline: 
  :         <pre class="brush: xml">
- :           &lt;img:strokedPolyLine&gt;
- :             &lt;img:point&gt;&lt;img:x&gt;10&lt;/img:x&gt;&lt;img:y&gt;10&lt;/img:y&gt;&lt;/img:point&gt;
- :             &lt;img:point&gt;&lt;img:x&gt;40&lt;/img:x&gt;&lt;img:y&gt;80&lt;/img:y&gt;&lt;/img:point&gt;
- :             &lt;img:point&gt;&lt;img:x&gt;50&lt;/img:x&gt;&lt;img:y&gt;30&lt;/img:y&gt;&lt;/img:point&gt;
- :             &lt;img:strokeLength&gt;5&lt;/img:strokeLength&gt;&lt;img:gapLength&gt;2&lt;/img:gapLength&gt;
- :           &lt;/img:strokedPolyLine&gt;
+ :           { 
+ :             "strokedPolyLine" : 
+ :             {
+ :               "points" : [ [10, 10], [40, 80], [50, 30] ], 
+ :               "strokeLength" : 10,
+ :               "gapLength" : 2
+ :             } 
+ :           }
  :         </pre>
  :       </li>
  :       <li> rectangle:
  :         <pre class="brush: xml">
- :           &lt;img:rectangle&gt;
- :             &lt;img:upperLeft&gt;&lt;img:x&gt;20&lt;/img:x&gt;&lt;img:y&gt;20&lt;/img:y&gt;&lt;/img:upperLeft&gt;
- :             &lt;img:lowerRight&gt;&lt;img:x&gt;50&lt;/img:x&gt;&lt;img:y&gt;50&lt;/img:y&gt;&lt;/img:lowerRight&gt;
- :           &lt;/img:rectangle&gt;
+ :           { 
+ :             "rectangle" :
+ :             {
+ :               "upperLeft" : [ 20, 20 ],
+ :               "lowerRight" : [ 50, 50 ]
+ :             }
+ :           }
  :         </pre>
  :       </li>
  :       <li> rounded rectangle: 
- :         <pre class="brush: xml">
- :           &lt;img:roundedRectangle&gt;
- :             &lt;img:upperLeft&gt;&lt;img:x&gt;20&lt;/img:x&gt;&lt;img:y&gt;20&lt;/img:y&gt;&lt;/img:upperLeft&gt;
- :             &lt;img:lowerRight&gt;&lt;img:x&gt;50&lt;/img:x&gt;&lt;img:y&gt;50&lt;/img:y&gt;&lt;/img:lowerRight&gt;
- :             &lt;img:cornerWidth&gt;10&lt;/img:cornerWidth&gt;&lt;img:cornerHeight&gt;10&lt;/img:cornerHeight&gt;
- :           &lt;/img:roundedRectangle&gt;
+ :         <pre class="brush: json">
+ :           { "roundedRectangle" :
+ :             {
+ :               "upperLeft" : [ 20, 20 ],
+ :               "lowerRight" : [ 50, 50 ],
+ :               "cornerWidth" : 10,
+ :               "cornerHeight" : 10
+ :             }
+ :           }
  :         </pre>
  :       </li>
  :       <li> circle: 
- :         <pre class="brush: xml">
- :           &lt;img:circle&gt;
- :             &lt;img:origin&gt;&lt;img:x&gt;20&lt;/img:x&gt;&lt;img:y&gt;20&lt;/img:y&gt;&lt;/img:origin&gt;
- :             &lt;img:perimeter&gt;5&lt;/img:perimeter&gt;
- :           &lt;/img:circle&gt;
+ :         <pre class="brush: json">
+ :           { 
+ :             "circle" :
+ :             {
+ :               "origin" : [ 50, 50 ],
+ :               "radius" : 5 
+ :             }
+ :           }
  :         </pre>
  :       </li>
  :       <li> ellipse: 
- :         <pre class="brush: xml">
- :           &lt;img:ellipse&gt;
- :             &lt;img:origin&gt;&lt;img:x&gt;50&lt;/img:x&gt;&lt;img:y&gt;50&lt;/img:y&gt;&lt;/img:origin&gt;
- :             &lt;img:perimeterX&gt;30&lt;/img:perimeterX&gt;&lt;img:perimeterY&gt;20&lt;/img:perimeterY&gt;
- :           &lt;/img:ellipse&gt;
+ :         <pre class="brush: json">
+ :           { 
+ :             "ellipse" :
+ :             {
+ :               "origin" : [ 50, 50 ],
+ :               "radiusX" : 30,
+ :               "radiusY" : 20 
+ :             }
+ :           }
  :         </pre>
  :       </li>
  :       <li> arc: 
- :         <pre class="brush: xml">
- :           &lt;img:arc&gt;
- :             &lt;img:origin&gt;&lt;img:x&gt;50&lt;/img:x&gt;&lt;img:y&gt;50&lt;/img:y&gt;&lt;/img:origin&gt;
- :             &lt;img:perimeterX&gt;10&lt;/img:perimeterX&gt;&lt;img:perimeterY&gt;20&lt;/img:perimeterY&gt;
- :             &lt;img:startDegrees&gt;180&lt;/img:startDegrees&gt;&lt;img:endDegrees&gt;270&lt;/img:endDegrees&gt;
- :           &lt;/img:arc&gt;
+ :         <pre class="brush: json">
+ :           { 
+ :             "arc" :
+ :             {
+ :               "origin" : [ 50, 50 ],
+ :               "radiusX" : 10,
+ :               "radiusY" : 20,
+ :               "startDegrees" : 180,
+ :               "endDegrees" : 270 
+ :             }
+ :           }
  :         </pre>
  :       </li>
  :       <li> polygon: 
- :         <pre class="brush: xml">
- :           &lt;img:polygon&gt;
- :             &lt;img:point&gt;&lt;img:x&gt;10&lt;/img:x&gt;&lt;img:y&gt;10&lt;/img:y&gt;&lt;/img:point&gt;
- :             &lt;img:point&gt;&lt;img:x&gt;40&lt;/img:x&gt;&lt;img:y&gt;80&lt;/img:y&gt;&lt;/img:point&gt;
- :             &lt;img:point&gt;&lt;img:x&gt;50&lt;/img:x&gt;&lt;img:y&gt;30&lt;/img:y&gt;&lt;/img:point&gt;
- :           &lt;/img:polygon&gt;
+ :         <pre class="brush: json">
+ :           { 
+ :             "polygon" : 
+ :             {
+ :               "points" : [ [10, 10], [30, 10], [30, 30] ] 
+ :             } 
+ :           }
  :         </pre>
  :       </li>
  :       <li> text: 
- :         <pre class="brush: xml">
- :           &lt;img:text&gt;
- :             &lt;img:origin&gt;&lt;img:x&gt;20&lt;/img:x&gt;&lt;img:y&gt;20&lt;/img:y&gt;&lt;/img:origin&gt;
- :             &lt;img:text&gt;Hello Zorba&lt;/img:text&gt;&lt;img:font&gt;&lt;/img:font&gt;&lt;img:font-size&gt;12&lt;/img:font-size&gt;
- :           &lt;/img:text&gt;
+ :         <pre class="brush: json">
+ :           { 
+ :             "text" :
+ :             {
+ :               "origin" : [ 50, 50 ],
+ :               "text" : "Hello World!",
+ :               "font" : "Arial",
+ :               "font-size" : 12 
+ :             }
+ :           }
  :         </pre>
  :       </li>
  :     </ul>
- : 
- : Optionally, each of the shape elements can contain elements to define the stroke with, stroke color, fill color, and anti-aliasing.
- : E.g.:
+ : <p/>
+ : <p>Optionally, each of the shape elements can contain elements to define the stroke with, stroke color, fill color, and anti-aliasing.</p>
+ : <p>E.g.:</p>
  : <p>
- :   <pre class="brush: xml">
- :     &lt;img:rectangle&gt;
- :       &lt;img:strokeWidth&gt;5&lt;/img:strokeWidth&gt;
- :       &lt;img:strokeColor&gt;#00AF00&lt;/img:strokeColor&gt;
- :       &lt;img:fillColor&gt;#A10000&lt;/img:fillColor&gt;
- :       &lt;img:antiAliasing&gt;true&lt;/img:antiAliasing&gt;
- :       &lt;img:upperLeft&gt;&lt;img:x&gt;20&lt;/img:x&gt;&lt;img:y&gt;20&lt;/img:y&gt;&lt;/img:upperLeft&gt;
- :       &lt;img:lowerRight&gt;&lt;img:x&gt;50&lt;/img:x&gt;&lt;img:y&gt;50&lt;/img:y&gt;&lt;/img:lowerRight&gt;
- :     &lt;/img:rectangle&gt;
+ :   <pre class="brush: json">
+ :     { 
+ :       "polygon" : 
+ :       {
+ :         "strokeWidth" : 3,
+ :         "strokeColor" : "#FF0000",
+ :         "fillColor" : "#00FF00",
+ :         "antiAliasing" : fn:true(),
+ :         "points" : [ [ 10, 10 ], [ 40, 80 ], [ 50, 30 ] ]
+ :       }
+ :     }
  :   </pre>
  :  </p>
  : 
  : @param $image the passed image
  : @param $shapes the shapes
  : @return image with additional shapes 
- : @error ierr:IM001 the passed image is invalid.
- : @error err:FORG0001 one of the passed shape elements is invalid. 
+ : @error ierr:INVALID_IMAGE the passed image is invalid.
+ : @error err::XPTY0004 empty sequence not allowed.
+ : @error err:FORG0001 one of the passed shape objects is invalid. 
  : @example test/Queries/image/paint_different_lines.xq
  : @example test/Queries/image/paint_polyline.xq
  : @example test/Queries/image/paint_stroked_polyline.xq
@@ -167,10 +200,10 @@
  : @example test/Queries/image/paint_circles.xq
  : @example test/Queries/image/paint_text.xq
  :)
-declare function paint:paint($image as xs:base64Binary, $shapes as element()*) as xs:base64Binary  {
-  
-  paint:paint-impl($image, for $x in $shapes return validate{$x})
+declare function paint:paint($image as xs:base64Binary, $shapes as object()*) as xs:base64Binary  {
+  (: missing json validation :)
+  paint:paint-impl($image, for $x in $shapes return $x)
 };
 
-declare %private function paint:paint-impl($image as xs:base64Binary, $shapes as element(*, img:paintableType)*) as xs:base64Binary external; 
+declare %private function paint:paint-impl($image as xs:base64Binary, $shapes as object()*) as xs:base64Binary external; 
 

=== renamed directory 'src/com/zorba-xquery/www/modules/image/paint.xq.src' => 'src/paint.xq.src'
=== modified file 'src/paint.xq.src/paint.cpp'
--- src/com/zorba-xquery/www/modules/image/paint.xq.src/paint.cpp	2013-06-21 03:28:34 +0000
+++ src/paint.xq.src/paint.cpp	2013-08-12 22:55:38 +0000
@@ -67,87 +67,96 @@
 }
 
 bool
-PaintImplFunction::getCommonValues(Iterator_t& aChildIterator, 
-                                   Item& aLastItemFound, 
+PaintImplFunction::getCommonValues(Item& aObject, 
                                    double* aStrokeWidth, 
                                    std::string& aStrokeColor, 
                                    std::string& aFillColor) const {
-  
   bool lFoundStrokeWidth = false;
   bool lFoundStrokeColor = false;
   bool lFoundFillColor = false;
+  bool lFoundAntialising = false;
   // fill in default values
   *aStrokeWidth = 1;
   aStrokeColor = "#000000";
   aFillColor = "#FFFFFF";
   bool lAntiAliasing = false;
-   
-  aChildIterator->next(aLastItemFound);
-  // we just check through the first four elements
-  for (int i = 0; i < 4; ++i) {
-    Item lNodeName; 
-    aLastItemFound.getNodeName(lNodeName);
-    String lName = lNodeName.getStringValue(); 
-    
-    if (!lFoundStrokeWidth && fn::ends_with(lName,"Width")) {
-      *aStrokeWidth = getDoubleValue(aLastItemFound); 
+
+  //we check for the 4 common objects inside the shapes object value
+  Iterator_t lKeys = aObject.getObjectKeys();
+  Item lKey;
+  lKeys->open();
+  while (lKeys->next(lKey))
+  {
+    String lStrKey = lKey.getStringValue();
+    if (!lFoundStrokeWidth && fn::ends_with(lStrKey, "eWidth"))
+    {
+      Item lValue = aObject.getObjectValue(lStrKey);
+      *aStrokeWidth = getDoubleValue(lValue);
       lFoundStrokeWidth = true;
-      aChildIterator->next(aLastItemFound);
-    } else if (!lFoundStrokeColor && fn::ends_with(lName,"eColor")) {
-      aStrokeColor = aLastItemFound.getStringValue().c_str();
+    }
+    else if (!lFoundStrokeColor && fn::ends_with(lStrKey, "eColor"))
+    {
+      Item lValue = aObject.getObjectValue(lStrKey);
+      aStrokeColor = lValue.getStringValue().c_str();
       lFoundStrokeColor = true;
-      aChildIterator->next(aLastItemFound);
-      if (i < 1) { i = 1; }
-    } else if (!lFoundFillColor && fn::ends_with(lName,"Color")) {
-      aFillColor = aLastItemFound.getStringValue().c_str();
+    }
+    else if (!lFoundFillColor && fn::ends_with(lStrKey, "Color"))
+    {
+      Item lValue = aObject.getObjectValue(lStrKey);
+      aFillColor = lValue.getStringValue().c_str();
       lFoundFillColor = true;
-      aChildIterator->next(aLastItemFound);
-      if (i < 2) { i = 2; }
-    } else if (fn::ends_with(lName,"ing")) {
-      String lAntiAliasingString = aLastItemFound.getStringValue();
-      if (fn::ends_with(lAntiAliasingString,"ue")) {
+    }
+    else if (!lFoundAntialising && fn::ends_with(lStrKey, "ing"))
+    {
+      Item lValue = aObject.getObjectValue(lStrKey);
+      String lAntialisingString = lValue.getStringValue();
+      if (fn::ends_with(lAntialisingString, "ue"))
+      {
         lAntiAliasing = true;
-      } else {
+      } 
+      else
+      {
         lAntiAliasing = false;
-      }  
-      
-      // iterate to next and break
-      aChildIterator->next(aLastItemFound); 
-      break;
-    }  
+      }
+    }
+  }
+  lKeys->close();
     
-  }  
   return lAntiAliasing;
-}  
-
+}
 
 void
 PaintImplFunction::applyShape(Magick::Blob& aBlob, Item& aShape) const {
-    Item lNodeName;
-    aShape.getNodeName(lNodeName);
-    String lName = lNodeName.getStringValue();
-    // removing the uri prefix
-    if (fn::ends_with(lName,"line")) {
-      applyLine(aBlob, aShape);
-    } else if (fn::ends_with(lName,"dPolyLine")) {
-      applyStrokedPolyLine(aBlob, aShape);
-    }  else if (fn::ends_with(lName,"Line")) {
-      applyPolyLine(aBlob, aShape);
-    } else if (fn::ends_with(lName,"rectangle")) {
-      applyRectangle(aBlob, aShape);
-    } else if (fn::ends_with(lName,"gle")) {
-      applyRoundedRectangle(aBlob, aShape);
-    } else if (fn::ends_with(lName,"cle")) {
-      applyCircle(aBlob, aShape);
-    } else if (fn::ends_with(lName,"se")) {
-      applyEllipse(aBlob, aShape);
-    } else if (fn::ends_with(lName,"c")) {
-      applyArc(aBlob, aShape);
-    } else if (fn::ends_with(lName,"n")) {
-      applyPolygon(aBlob, aShape);
-    } else if (fn::ends_with(lName,"t")) {
-      applyText(aBlob, aShape);
+ Iterator_t lObjIter = aShape.getObjectKeys();
+  Item lKey;
+  lObjIter->open();
+  while ( lObjIter->next(lKey) )
+  {
+    String lStrKey = lKey.getStringValue();
+    Item lValue = aShape.getObjectValue(lStrKey);
+    if (fn::ends_with(lStrKey, "line")) {
+      applyLine(aBlob, lValue);
+    } else if (fn::ends_with(lStrKey, "dPolyLine")) {
+      applyStrokedPolyLine(aBlob, lValue);
+    }  else if (fn::ends_with(lStrKey, "Line")) {
+      applyPolyLine(aBlob, lValue);
+    } else if (fn::ends_with(lStrKey,"rectangle")) {
+      applyRectangle(aBlob, lValue);
+    } else if (fn::ends_with(lStrKey, "gle")) {
+      applyRoundedRectangle(aBlob, lValue);
+    } else if (fn::ends_with(lStrKey, "cle")) {
+      applyCircle(aBlob, lValue);
+    } else if (fn::ends_with(lStrKey, "se")) {
+      applyEllipse(aBlob, lValue);
+    } else if (fn::ends_with(lStrKey, "c")) {
+      applyArc(aBlob, lValue);
+    } else if (fn::ends_with(lStrKey, "n")) {
+      applyPolygon(aBlob, lValue);
+    } else if (fn::ends_with(lStrKey, "t")) {
+      applyText(aBlob, lValue);
     }  
+  }
+  lObjIter->close();
 }
 
 
@@ -163,46 +172,27 @@
 
 void
 PaintImplFunction::getDoublesFromPoint(Item& aPoint, double aPointValues[2]) const {
-  Item lXItem, lYItem, lX, lY;
-
-  Iterator_t lPointChildren = aPoint.getChildren();
-  lPointChildren->open(); 
-  lPointChildren->next(lXItem);
-  Iterator_t lXItemIterator = lXItem.getChildren();
-  lXItemIterator->open();
-  lXItemIterator->next(lX);
-  lXItemIterator->close();
-
-  lPointChildren->next(lYItem);
-  Iterator_t lYItemIterator = lYItem.getChildren();
-  lYItemIterator->open();
-  lYItemIterator->next(lY);
-  lYItemIterator->close();
-  lPointChildren->close();
-  
+  Item lX, lY;
+  lX = aPoint.getArrayValue(1);
+  lY = aPoint.getArrayValue(2);
   aPointValues[0] = getDoubleValue(lX);
   aPointValues[1] = getDoubleValue(lY);
-   
 }
 
-
 void 
 PaintImplFunction::applyLine(Magick::Blob& aBlob, Item& aLine) const {
-  Item lStartPoint, lEndPoint;
-  Iterator_t lChildren = aLine.getChildren();
-  lChildren->open();
+ Item lStartPoint, lEndPoint;
   double lStrokeWidth = 0;
   std::string lStrokeColor = "";
   std::string lFillColor = "";
-  bool lAntiAliasing; 
-  // lStartPoint will contain the item of the start point after this operation
-  lAntiAliasing = getCommonValues(lChildren, lStartPoint, &lStrokeWidth, lStrokeColor, lFillColor); 
-  
-  lChildren->next(lEndPoint);
-  lChildren->close(); 
-
+  bool lAntiAliasing;   
   double lFirst[2];
   double lSecond[2];
+
+  // set common values from JSON
+  lAntiAliasing = getCommonValues(aLine, &lStrokeWidth, lStrokeColor, lFillColor);
+  lStartPoint = aLine.getObjectValue("start");
+  lEndPoint = aLine.getObjectValue("end");
   getDoublesFromPoint(lStartPoint, lFirst);
   getDoublesFromPoint(lEndPoint, lSecond);
   double lXValues[2] = {lFirst[0], lSecond[0]};
@@ -217,41 +207,34 @@
 
 void
 PaintImplFunction::applyPolyLine(Magick::Blob& aBlob, Item& aLine) const {
-  Item lFirstPoint;
-  Iterator_t lChildren = aLine.getChildren();
-  lChildren->open();
   double lStrokeWidth = 0; 
   std::string lStrokeColor = "";
   std::string lFillColor = "";
   bool lAntiAliasing;
-
-  lAntiAliasing = getCommonValues(lChildren, lFirstPoint, &lStrokeWidth, lStrokeColor, lFillColor);
- 
   std::vector<double> lXValues;
   std::vector<double> lYValues;
+  double lTempPoint[2];
+  int lSize = 1;
 
-  double lFirst[2];
-  getDoublesFromPoint(lFirstPoint, lFirst);
-  lXValues.push_back(lFirst[0]);
-  lYValues.push_back(lFirst[1]);
-  Item lPoint;
-  int lCounter = 1;
-  while(lChildren->next(lPoint)) {
-    lCounter++;
-    double lPointValues[2];
-    getDoublesFromPoint(lPoint, lPointValues);
-    lXValues.push_back(lPointValues[0]);
-    lYValues.push_back(lPointValues[1]);
+  lAntiAliasing = getCommonValues(aLine, &lStrokeWidth, lStrokeColor, lFillColor);
+   
+  Item lPoints = aLine.getObjectValue("points");
+  lSize = lPoints.getArraySize();
+  for (int i = 1; i <= lSize; i++)
+  {
+    Item lPoint = lPoints.getArrayValue(i);  
+    getDoublesFromPoint(lPoint, lTempPoint);
+    lXValues.push_back(lTempPoint[0]);
+    lYValues.push_back(lTempPoint[1]);
   }
-  lChildren->close();
   
   long lBlobLength = (long) aBlob.length();
-  double* lXValuesArray = new double[lCounter];
-  double* lYValuesArray = new double[lCounter];
-  std::memcpy(lXValuesArray, &lXValues[0], lCounter*sizeof(lXValues[0]));
-  std::memcpy(lYValuesArray, &lYValues[0], lCounter*sizeof(lYValues[0]));
+  double* lXValuesArray = new double[lSize];
+  double* lYValuesArray = new double[lSize];
+  std::memcpy(lXValuesArray, &lXValues[0], lSize*sizeof(lXValues[0]));
+  std::memcpy(lYValuesArray, &lYValues[0], lSize*sizeof(lYValues[0]));
     
-  void * lBlobPointer = DrawPolyLine(aBlob.data(), &lBlobLength, &lXValuesArray[0], &lYValuesArray[0], lCounter, lStrokeColor, lStrokeWidth, lAntiAliasing, NULL, 0);
+  void * lBlobPointer = DrawPolyLine(aBlob.data(), &lBlobLength, &lXValuesArray[0], &lYValuesArray[0], lSize, lStrokeColor, lStrokeWidth, lAntiAliasing, NULL, 0);
   
   delete[] lXValuesArray;
   delete[] lYValuesArray;
@@ -260,59 +243,47 @@
   // now read the blob back into an image to pass it back as encoded string 
   aBlob = lBlobWithPolyLine;
  
-
 }
 
 void
 PaintImplFunction::applyStrokedPolyLine(Magick::Blob& aBlob, Item& aLine) const {
-  Item lFirstPoint;
-  Iterator_t lChildren = aLine.getChildren();
-  lChildren->open();
+ Item lFirstPoint;
   double lStrokeWidth = 0; 
   std::string lStrokeColor = "";
   std::string lFillColor = "";
   bool lAntiAliasing;
-  lAntiAliasing = getCommonValues(lChildren, lFirstPoint, &lStrokeWidth, lStrokeColor, lFillColor);
   std::vector<double> lXValues;
   std::vector<double> lYValues;
-
-  double lFirst[2];
-  getDoublesFromPoint(lFirstPoint, lFirst);
-  lXValues.push_back(lFirst[0]);
-  lYValues.push_back(lFirst[1]);
-  Item lPoint;
-  int lCounter = 1;
-  while(lChildren->next(lPoint)) {
-    // make sure that we aren't reading in the gap length as point
-    if (lCounter >= 3) {
-      Item lNodeName;
-      lPoint.getNodeName(lNodeName);
-      String lName = lNodeName.getStringValue();
-      if (!fn::ends_with(lName,"oint")) {
-        break;
-      }  
-    }  
-    lCounter++;
-    double lPointValues[2];
-    getDoublesFromPoint(lPoint, lPointValues);
-    lXValues.push_back(lPointValues[0]);
-    lYValues.push_back(lPointValues[1]);
-  }
-  // lPoint now contains the strokeLength
+  double lTempPoint[2];
   double lStrokeArray[2];
-  lStrokeArray[0] = getDoubleValue(lPoint); 
-  lChildren->next(lPoint);
-  lStrokeArray[1] = getDoubleValue(lPoint); 
-  lChildren->close();
+  int lSize = 1;
 
+  lAntiAliasing = getCommonValues(aLine, &lStrokeWidth, lStrokeColor, lFillColor);
+  
+  Item lPoints = aLine.getObjectValue("points");
+  lSize = lPoints.getArraySize();
+  for (int i = 1; i <= lSize; i++)
+  {
+    Item lPoint = lPoints.getArrayValue(i);  
+    getDoublesFromPoint(lPoint, lTempPoint);
+    lXValues.push_back(lTempPoint[0]);
+    lYValues.push_back(lTempPoint[1]);
+  }
+  //get stroke length
+  Item lStrokeLength = aLine.getObjectValue("strokeLength");
+  lStrokeArray[0] = getDoubleValue(lStrokeLength);
+  Item lGapLength = aLine.getObjectValue("gapLength");
+  lStrokeArray[1] = getDoubleValue(lGapLength);
+  
+  
   long lBlobLength = (long) aBlob.length();
   
-  double* lXValuesArray = new double[lCounter];
-  double* lYValuesArray = new double[lCounter];
-  memcpy(lXValuesArray, &lXValues[0], lCounter*sizeof(lXValues[0]));
-  memcpy(lYValuesArray, &lYValues[0], lCounter*sizeof(lYValues[0]));
+  double* lXValuesArray = new double[lSize];
+  double* lYValuesArray = new double[lSize];
+  memcpy(lXValuesArray, &lXValues[0], lSize*sizeof(lXValues[0]));
+  memcpy(lYValuesArray, &lYValues[0], lSize*sizeof(lYValues[0]));
   
-  void * lBlobPointer = DrawPolyLine(aBlob.data(), &lBlobLength, &lXValuesArray[0], &lYValuesArray[0], lCounter, lStrokeColor, lStrokeWidth, lAntiAliasing, lStrokeArray, 2);
+  void * lBlobPointer = DrawPolyLine(aBlob.data(), &lBlobLength, &lXValuesArray[0], &lYValuesArray[0], lSize, lStrokeColor, lStrokeWidth, lAntiAliasing, lStrokeArray, 2);
   
   delete[] lXValuesArray;
   delete[] lYValuesArray;
@@ -325,51 +296,49 @@
 
 void              
 PaintImplFunction::applyRectangle(Magick::Blob& aBlob, Item& aRectangle) const {
-  Item lFirstPoint;
-  Iterator_t lChildren = aRectangle.getChildren();
-  lChildren->open();
   double lStrokeWidth = 0; 
   std::string lStrokeColor = "";
   std::string lFillColor = "";
   bool lAntiAliasing;
-  lAntiAliasing = getCommonValues(lChildren, lFirstPoint, &lStrokeWidth, lStrokeColor, lFillColor);
-  // now lFirstPoint contains the upper left corner of this rectangle
   double lUpperLeft[2];
-  getDoublesFromPoint(lFirstPoint, lUpperLeft);
-  lChildren->next(lFirstPoint);
-  lChildren->close();
   double lLowerRight[2];
-  getDoublesFromPoint(lFirstPoint, lLowerRight);
+
+  lAntiAliasing = getCommonValues(aRectangle, &lStrokeWidth, lStrokeColor, lFillColor);
+  Item lUpperLeftItem = aRectangle.getObjectValue("upperLeft");
+  getDoublesFromPoint(lUpperLeftItem, lUpperLeft);
+  Item lLowerRightItem = aRectangle.getObjectValue("lowerRight");
+  getDoublesFromPoint(lLowerRightItem, lLowerRight);
+  
+
   long lBlobLength = (long) aBlob.length();
   void * lBlobPointer = DrawRoundedRect(aBlob.data(), &lBlobLength, lUpperLeft[0], lUpperLeft[1], lLowerRight[0], lLowerRight[1], 0, 0, lStrokeColor, lFillColor, lStrokeWidth, lAntiAliasing);
   Magick::Blob lBlobWithPolyLine(lBlobPointer, lBlobLength);
   // now read the blob back into an image to pass it back as encoded string 
   aBlob = lBlobWithPolyLine;
-
 }
 
 void              
 PaintImplFunction::applyRoundedRectangle(Magick::Blob& aBlob, Item& aRectangle) const {
-  Item lFirstPoint;
-  Iterator_t lChildren = aRectangle.getChildren();
-  lChildren->open();
+   Item lItem;
   double lStrokeWidth = 0; 
   std::string lStrokeColor = "";
   std::string lFillColor = "";
   bool lAntiAliasing;
-  lAntiAliasing = getCommonValues(lChildren, lFirstPoint, &lStrokeWidth, lStrokeColor, lFillColor);
-  // now lFirstPoint contains the upper left corner of this rectangle
   double lUpperLeft[2];
-  getDoublesFromPoint(lFirstPoint, lUpperLeft);
-  lChildren->next(lFirstPoint);
   double lLowerRight[2];
-  getDoublesFromPoint(lFirstPoint, lLowerRight);
-  Item lCorner;
-  lChildren->next(lCorner);
-  double lCornerWidth = getDoubleValue(lCorner);
-  lChildren->next(lCorner);
-  double lCornerHeight = getDoubleValue(lCorner);
-  
+  double lCornerWidth;
+  double lCornerHeight;
+
+  lAntiAliasing = getCommonValues(aRectangle, &lStrokeWidth, lStrokeColor, lFillColor);
+  lItem = aRectangle.getObjectValue("upperLeft");
+  getDoublesFromPoint(lItem, lUpperLeft);
+  lItem = aRectangle.getObjectValue("lowerRight");
+  getDoublesFromPoint(lItem, lLowerRight);
+  lItem = aRectangle.getObjectValue("cornerWidth");
+  lCornerWidth = getDoubleValue(lItem);
+  lItem = aRectangle.getObjectValue("cornerHeight");
+  lCornerHeight = getDoubleValue(lItem);  
+
   long lBlobLength = (long) aBlob.length();
   void * lBlobPointer = DrawRoundedRect(aBlob.data(), &lBlobLength, lUpperLeft[0], lUpperLeft[1], lLowerRight[0], lLowerRight[1], lCornerWidth, lCornerHeight, lStrokeColor, lFillColor, lStrokeWidth, lAntiAliasing);
   Magick::Blob lBlobWithPolyLine(lBlobPointer, lBlobLength);
@@ -380,21 +349,20 @@
 
 void              
 PaintImplFunction::applyCircle(Magick::Blob& aBlob, Item& aCircle) const {
-  Item lFirstPoint;
-  Iterator_t lChildren = aCircle.getChildren();
-  lChildren->open();
-  double lStrokeWidth = 0; 
+ double lStrokeWidth = 0; 
   std::string lStrokeColor = "";
   std::string lFillColor = "";
   bool lAntiAliasing;
-  lAntiAliasing = getCommonValues(lChildren, lFirstPoint, &lStrokeWidth, lStrokeColor, lFillColor);
- 
   double lOriginCoordinates[2];
-  getDoublesFromPoint(lFirstPoint, lOriginCoordinates);
-  Item lPeremeterItem;
-  lChildren->next(lPeremeterItem);
-  double lPeremeter = getDoubleValue(lPeremeterItem); 
-  lChildren->close();
+  Item lItem;
+  double lRadius;
+
+  lAntiAliasing = getCommonValues(aCircle, &lStrokeWidth, lStrokeColor, lFillColor);
+  lItem = aCircle.getObjectValue("origin");
+  getDoublesFromPoint(lItem, lOriginCoordinates);
+  lItem = aCircle.getObjectValue("radius");
+  lRadius = getDoubleValue(lItem);
+  
   Magick::Image lImage(aBlob);
   lImage.strokeAntiAlias(lAntiAliasing);
   lImage.strokeWidth(lStrokeWidth);
@@ -404,32 +372,31 @@
   ImageFunction::getColorFromString(lFillColor.c_str(), lFillColorForMagick);
   lImage.strokeColor(lStrokeColorForMagick);
   lImage.fillColor(lFillColorForMagick);
-  lImage.draw(Magick::DrawableEllipse(lOriginCoordinates[0], lOriginCoordinates[1], lPeremeter, lPeremeter, 0, 360));
+  lImage.draw(Magick::DrawableEllipse(lOriginCoordinates[0], lOriginCoordinates[1], lRadius, lRadius, 0, 360));
   Magick::Blob lBlob;
   lImage.write(&lBlob);
   aBlob = lBlob;
-
 }
 
 void              
 PaintImplFunction::applyEllipse(Magick::Blob& aBlob, Item& aCircle) const {
-  Item lFirstPoint;
-  Iterator_t lChildren = aCircle.getChildren();
-  lChildren->open();
-  double lStrokeWidth = 0; 
+ double lStrokeWidth = 0; 
   std::string lStrokeColor = "";
   std::string lFillColor = "";
   bool lAntiAliasing;
-  lAntiAliasing = getCommonValues(lChildren, lFirstPoint, &lStrokeWidth, lStrokeColor, lFillColor);
- 
+  Item lItem;
   double lOriginCoordinates[2];
-  getDoublesFromPoint(lFirstPoint, lOriginCoordinates);
-  Item lPeremeterItem;
-  lChildren->next(lPeremeterItem);
-  double lPeremeterX = getDoubleValue(lPeremeterItem);
-  lChildren->next(lPeremeterItem);
-  double lPeremeterY = getDoubleValue(lPeremeterItem);
-  lChildren->close();
+  double lRadiusX;
+  double lRadiusY;
+  
+  lAntiAliasing = getCommonValues(aCircle, &lStrokeWidth, lStrokeColor, lFillColor);
+  lItem = aCircle.getObjectValue("origin");
+  getDoublesFromPoint(lItem, lOriginCoordinates);
+  lItem = aCircle.getObjectValue("radiusX");
+  lRadiusX = getDoubleValue(lItem);
+  lItem = aCircle.getObjectValue("radiusY");
+  lRadiusY = getDoubleValue(lItem);
+  
   Magick::Image lImage(aBlob);
   lImage.strokeAntiAlias(lAntiAliasing);
   lImage.strokeWidth(lStrokeWidth);
@@ -439,7 +406,7 @@
   ImageFunction::getColorFromString(lFillColor.c_str(), lFillColorForMagick);
   lImage.strokeColor(lStrokeColorForMagick);
   lImage.fillColor(lFillColorForMagick);
-  lImage.draw(Magick::DrawableEllipse(lOriginCoordinates[0], lOriginCoordinates[1], lPeremeterX, lPeremeterY, 0, 360));
+  lImage.draw(Magick::DrawableEllipse(lOriginCoordinates[0], lOriginCoordinates[1], lRadiusX, lRadiusY, 0, 360));
   Magick::Blob lBlob;
   lImage.write(&lBlob);
   aBlob = lBlob;
@@ -447,29 +414,26 @@
 
 void              
 PaintImplFunction::applyArc(Magick::Blob& aBlob, Item& aCircle) const {
-  Item lFirstPoint;
-  Iterator_t lChildren = aCircle.getChildren();
-  lChildren->open();
-  double lStrokeWidth = 0; 
+ double lStrokeWidth = 0; 
   std::string lStrokeColor = "";
   std::string lFillColor = "";
   bool lAntiAliasing;
-  lAntiAliasing = getCommonValues(lChildren, lFirstPoint, &lStrokeWidth, lStrokeColor, lFillColor);
- 
   double lOriginCoordinates[2];
-  getDoublesFromPoint(lFirstPoint, lOriginCoordinates);
-  Item lPeremeterItem;
-  lChildren->next(lPeremeterItem);
-  double lPeremeterX = getDoubleValue(lPeremeterItem);
-  lChildren->next(lPeremeterItem);
-  double lPeremeterY = getDoubleValue(lPeremeterItem);
-  Item lDegreesItem;
-  lChildren->next(lDegreesItem);
-  double lStartDegrees = getDoubleValue(lDegreesItem);
-  lChildren->next(lDegreesItem);
-  double lEndDegrees = getDoubleValue(lDegreesItem);
+  double lRadiusX, lRadiusY, lStartDegrees, lEndDegrees;
+  Item lItem;
+
+  lAntiAliasing = getCommonValues(aCircle, &lStrokeWidth, lStrokeColor, lFillColor);
+  lItem = aCircle.getObjectValue("origin");
+  getDoublesFromPoint(lItem, lOriginCoordinates);    
+  lItem = aCircle.getObjectValue("radiusX");
+  lRadiusX = getDoubleValue(lItem);
+  lItem = aCircle.getObjectValue("radiusY");
+  lRadiusY = getDoubleValue(lItem);
+  lItem = aCircle.getObjectValue("startDegrees");
+  lStartDegrees = getDoubleValue(lItem);
+  lItem = aCircle.getObjectValue("endDegrees");
+  lEndDegrees = getDoubleValue(lItem);  
   
-  lChildren->close();
   Magick::Image lImage(aBlob);
   lImage.strokeAntiAlias(lAntiAliasing);
   lImage.strokeWidth(lStrokeWidth);
@@ -479,7 +443,7 @@
   ImageFunction::getColorFromString(lFillColor.c_str(), lFillColorForMagick);
   lImage.strokeColor(lStrokeColorForMagick);
   lImage.fillColor(lFillColorForMagick);
-  lImage.draw(Magick::DrawableEllipse(lOriginCoordinates[0], lOriginCoordinates[1], lPeremeterX, lPeremeterY, lStartDegrees, lEndDegrees));
+  lImage.draw(Magick::DrawableEllipse(lOriginCoordinates[0], lOriginCoordinates[1], lRadiusX, lRadiusY, lStartDegrees, lEndDegrees));
   Magick::Blob lBlob;
   lImage.write(&lBlob);
   aBlob = lBlob;
@@ -488,42 +452,35 @@
 
 void              
 PaintImplFunction::applyPolygon(Magick::Blob& aBlob, Item& aLine) const {
-  Item lFirstPoint;
-  Iterator_t lChildren = aLine.getChildren();
-  lChildren->open();
-  double lStrokeWidth = 0; 
+ double lStrokeWidth = 0; 
   std::string lStrokeColor = "";
   std::string lFillColor = "";
   bool lAntiAliasing;
-
-  lAntiAliasing = getCommonValues(lChildren, lFirstPoint, &lStrokeWidth, lStrokeColor, lFillColor);
- 
   std::vector<double> lXValues;
   std::vector<double> lYValues;
-
-  double lFirst[2];
-  getDoublesFromPoint(lFirstPoint, lFirst);
-  lXValues.push_back(lFirst[0]);
-  lYValues.push_back(lFirst[1]);
-  Item lPoint;
-  int lCounter = 1;
-  while(lChildren->next(lPoint)) {
-    lCounter++;
-    double lPointValues[2];
-    getDoublesFromPoint(lPoint, lPointValues);
-    lXValues.push_back(lPointValues[0]);
-    lYValues.push_back(lPointValues[1]);
+  double lTempPoint[2];
+  int lSize = 1;
+
+  lAntiAliasing = getCommonValues(aLine, &lStrokeWidth, lStrokeColor, lFillColor);
+
+  Item lPoints = aLine.getObjectValue("points");
+  lSize = lPoints.getArraySize();
+  for (int i = 1; i <= lSize; i++)
+  {
+    Item lPoint = lPoints.getArrayValue(i);  
+    getDoublesFromPoint(lPoint, lTempPoint);
+    lXValues.push_back(lTempPoint[0]);
+    lYValues.push_back(lTempPoint[1]);
   }
-  lChildren->close();
   
   long lBlobLength = (long) aBlob.length();
   
-  double* lXValuesArray = new double[lCounter];
-  double* lYValuesArray = new double[lCounter];
-  memcpy(lXValuesArray, &lXValues[0], lCounter*sizeof(lXValues[0]));
-  memcpy(lYValuesArray, &lYValues[0], lCounter*sizeof(lYValues[0]));
+  double* lXValuesArray = new double[lSize];
+  double* lYValuesArray = new double[lSize];
+  memcpy(lXValuesArray, &lXValues[0], lSize*sizeof(lXValues[0]));
+  memcpy(lYValuesArray, &lYValues[0], lSize*sizeof(lYValues[0]));
     
-  void * lBlobPointer = DrawPolygon(aBlob.data(), &lBlobLength, &lXValuesArray[0], &lYValuesArray[0], lCounter, lStrokeColor, lFillColor, lStrokeWidth, lAntiAliasing);
+  void * lBlobPointer = DrawPolygon(aBlob.data(), &lBlobLength, &lXValuesArray[0], &lYValuesArray[0], lSize, lStrokeColor, lFillColor, lStrokeWidth, lAntiAliasing);
   
   delete[] lXValuesArray;
   delete[] lYValuesArray;
@@ -531,47 +488,34 @@
   Magick::Blob lBlobWithPolyLine(lBlobPointer, lBlobLength);
   // now read the blob back into an image to pass it back as encoded string 
   aBlob = lBlobWithPolyLine;
- 
-
 }
 
 void              
 PaintImplFunction::applyText(Magick::Blob& aBlob, Item& aText) const {
-  Item lFirstPoint;
-  Iterator_t lChildren = aText.getChildren();
-  lChildren->open();
   double lStrokeWidth = 0; 
   std::string lStrokeColor = "";
   std::string lFillColor = "";
   bool lAntiAliasing;
-
-  lAntiAliasing = getCommonValues(lChildren, lFirstPoint, &lStrokeWidth, lStrokeColor, lFillColor);
- 
-
-  double lFirst[2];
-  getDoublesFromPoint(lFirstPoint, lFirst);
-
-  Item lTextItem;
-  lChildren->next(lTextItem);
-  String lText = lTextItem.getStringValue();
-  Item lFontFamilyItem;
-  lChildren->next(lFontFamilyItem);
-  String lFontFamily = lFontFamilyItem.getStringValue();
-  Item lFontSizeItem;
-  lChildren->next(lFontSizeItem);
-  double lFontSize = getDoubleValue(lFontSizeItem);
-
-  lChildren->close();
+  double lOriginCoordinates[2];
+  Item lItem;
+  String lText, lFontFamily;
+  double lFontSize;
+
+  lAntiAliasing = getCommonValues(aText, &lStrokeWidth, lStrokeColor, lFillColor);
+  lItem = aText.getObjectValue("origin");
+  getDoublesFromPoint(lItem, lOriginCoordinates);
+  lItem = aText.getObjectValue("text");
+  lText = lItem.getStringValue();
+  lItem = aText.getObjectValue("font");
+  lFontFamily = lItem.getStringValue();
+  lItem = aText.getObjectValue("fontSize");
+  lFontSize = getDoubleValue(lItem); 
   
-    
   long lBlobLength = (long) aBlob.length();
-  void * lBlobPointer = DrawText(aBlob.data(), &lBlobLength, lText.c_str() , lFirst[0], lFirst[1], lFontFamily.c_str(), lFontSize, lStrokeColor.c_str());
+  void * lBlobPointer = DrawText(aBlob.data(), &lBlobLength, lText.c_str() , lOriginCoordinates[0], lOriginCoordinates[1], lFontFamily.c_str(), lFontSize, lStrokeColor.c_str());
   Magick::Blob lBlobWithPolyLine(lBlobPointer, lBlobLength);
   // now read the blob back into an image to pass it back as encoded string 
   aBlob = lBlobWithPolyLine;
- 
-
-
 }
 
 

=== modified file 'src/paint.xq.src/paint.h'
--- src/com/zorba-xquery/www/modules/image/paint.xq.src/paint.h	2011-10-06 08:18:47 +0000
+++ src/paint.xq.src/paint.h	2013-08-12 22:55:38 +0000
@@ -79,11 +79,10 @@
       applyText(Magick::Blob& aBlob, Item& aShape) const;      
 
       virtual bool
-      getCommonValues(Iterator_t& aChildIterator, 
-                      Item& aLastItemFound, 
+      getCommonValues(Item& lObjectValue, 
                       double* aStrokeWidth, 
                       std::string& aStrokeColor, 
-                      std::string& aFillColor) const; 
+                      std::string& aFillColor) const;  
 
 
       double

=== modified file 'src/paint.xq.src/paint_module.h'
--- src/com/zorba-xquery/www/modules/image/paint.xq.src/paint_module.h	2011-10-06 08:18:47 +0000
+++ src/paint.xq.src/paint_module.h	2013-08-12 22:55:38 +0000
@@ -34,7 +34,7 @@
 public:
   
   virtual String
-  getURI() const { return "http://www.zorba-xquery.com/modules/image/paint";; }
+  getURI() const { return "http://zorba.io/modules/image/paint";; }
   
   virtual ExternalFunction*
   getExternalFunction(const String& aLocalname);

=== modified file 'test/Queries/image/animation.xq'
--- test/Queries/image/animation.xq	2013-08-09 09:37:05 +0000
+++ test/Queries/image/animation.xq	2013-08-12 22:55:38 +0000
@@ -4,9 +4,9 @@
  : @author Daniel Thomas
  :)
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
-import module namespace ani = 'http://www.zorba-xquery.com/modules/image/animation';
-import schema namespace image = 'http://www.zorba-xquery.com/modules/image/image';
+import module namespace basic = 'http://zorba.io/modules/image/basic';
+import module namespace ani = 'http://zorba.io/modules/image/animation';
+import schema namespace image = 'http://zorba.io/modules/image/image';
 
 declare namespace an = "http://zorba.io/annotations";;
 

=== modified file 'test/Queries/image/animation_create.xq'
--- test/Queries/image/animation_create.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/animation_create.xq	2013-08-12 22:55:38 +0000
@@ -5,7 +5,7 @@
  : to disk using file:write-binary(a_path, $animatedGif), send it in an email etc.
  :)
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace animation = 'http://www.zorba-xquery.com/modules/image/animation';
+import module namespace animation = 'http://zorba.io/modules/image/animation';
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
 

=== modified file 'test/Queries/image/animation_create_morphed.xq'
--- test/Queries/image/animation_create_morphed.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/animation_create_morphed.xq	2013-08-12 22:55:38 +0000
@@ -5,7 +5,7 @@
  : to disk using file:write-binary(a_path, $animatedGif), send it in an email etc.
  :)
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace animation = 'http://www.zorba-xquery.com/modules/image/animation';
+import module namespace animation = 'http://zorba.io/modules/image/animation';
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
 

=== modified file 'test/Queries/image/basic.xq'
--- test/Queries/image/basic.xq	2013-08-09 09:37:05 +0000
+++ test/Queries/image/basic.xq	2013-08-12 22:55:38 +0000
@@ -3,7 +3,7 @@
  : 
  : @author Daniel Thomas
  :)
-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
+import module namespace basic = 'http://zorba.io/modules/image/basic';
 import module namespace file = 'http://expath.org/ns/file';
 
 declare namespace an = "http://zorba.io/annotations";;

=== modified file 'test/Queries/image/basic_compress.xq'
--- test/Queries/image/basic_compress.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/basic_compress.xq	2013-08-12 22:55:38 +0000
@@ -4,7 +4,7 @@
  : to disk using file:write-binary(a_path, basic:compress($compressed-bird, xs:unsignedInt(2))), send it in an email etc.
  :)
 import module namespace file = 'http://expath.org/ns/file';                                         
-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';                                 
+import module namespace basic = 'http://zorba.io/modules/image/basic';                                 
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");                    
 

=== modified file 'test/Queries/image/basic_convert.xq'
--- test/Queries/image/basic_convert.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/basic_convert.xq	2013-08-12 22:55:38 +0000
@@ -4,7 +4,7 @@
  : to disk using file:write-binary(a_path, basic:compress($gif-bird, xs:unsignedInt(2))), send it in an email etc.
  :)
 import module namespace file = 'http://expath.org/ns/file';                                         
-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';                                 
+import module namespace basic = 'http://zorba.io/modules/image/basic';                                 
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");                    
 

=== modified file 'test/Queries/image/basic_create.xq'
--- test/Queries/image/basic_create.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/basic_create.xq	2013-08-12 22:55:38 +0000
@@ -3,7 +3,7 @@
  : As it is, the example just asserts that the resulting xs:base64Binary is not empty, in a real application one could further process the image, or write it 
  : to disk using file:write-binary(a_path, $new-image)), send it in an email etc.
  :)
-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
+import module namespace basic = 'http://zorba.io/modules/image/basic';
 
 let $new-image as xs:base64Binary := basic:create(xs:unsignedInt(100), xs:unsignedInt(50), "GIF") 
 return not(empty($new-image))

=== modified file 'test/Queries/image/basic_equals.xq'
--- test/Queries/image/basic_equals.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/basic_equals.xq	2013-08-12 22:55:38 +0000
@@ -3,7 +3,7 @@
  : are not equal. 
  :)
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
+import module namespace basic = 'http://zorba.io/modules/image/basic';
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
 

=== modified file 'test/Queries/image/basic_exif.xq'
--- test/Queries/image/basic_exif.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/basic_exif.xq	2013-08-12 22:55:38 +0000
@@ -3,7 +3,7 @@
  : Trying to read out the value of an non-existing exif tag will result in an empty sequence. 
  :)
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
+import module namespace basic = 'http://zorba.io/modules/image/basic';
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
 

=== modified file 'test/Queries/image/basic_height.xq'
--- test/Queries/image/basic_height.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/basic_height.xq	2013-08-12 22:55:38 +0000
@@ -3,7 +3,7 @@
  : The basic:height function returns the height in pixels (as xs:unsignedInt).                                       
  :)
 import module namespace file = 'http://expath.org/ns/file';                                         
-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';                                 
+import module namespace basic = 'http://zorba.io/modules/image/basic';                                 
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");                    
 

=== modified file 'test/Queries/image/basic_svg.xq'
--- test/Queries/image/basic_svg.xq	2012-10-29 07:53:55 +0000
+++ test/Queries/image/basic_svg.xq	2013-08-12 22:55:38 +0000
@@ -4,7 +4,7 @@
  : to disk using file:write-binary(a_path, basic:compress($jpeg-bird, xs:unsignedInt(2))), send it in an email etc.
  :)
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
+import module namespace basic = 'http://zorba.io/modules/image/basic';
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
 

=== modified file 'test/Queries/image/basic_type.xq'
--- test/Queries/image/basic_type.xq	2011-08-04 04:09:00 +0000
+++ test/Queries/image/basic_type.xq	2013-08-12 22:55:38 +0000
@@ -3,7 +3,7 @@
  : The basic:width function returns the width in pixels (as xs:unsignedInt).
  :)
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
+import module namespace basic = 'http://zorba.io/modules/image/basic';
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
 

=== modified file 'test/Queries/image/basic_width.xq'
--- test/Queries/image/basic_width.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/basic_width.xq	2013-08-12 22:55:38 +0000
@@ -3,7 +3,7 @@
  : The basic:width function returns the width in pixels (as xs:unsignedInt).
  :)
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
+import module namespace basic = 'http://zorba.io/modules/image/basic';
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
 

=== modified file 'test/Queries/image/manipulation_1.xq'
--- test/Queries/image/manipulation_1.xq	2013-08-09 09:37:05 +0000
+++ test/Queries/image/manipulation_1.xq	2013-08-12 22:55:38 +0000
@@ -3,10 +3,10 @@
  : 
  : @author Daniel Thomas
  :)
-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
+import module namespace basic = 'http://zorba.io/modules/image/basic';
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace man = 'http://www.zorba-xquery.com/modules/image/manipulation';
-import schema namespace image = 'http://www.zorba-xquery.com/modules/image/image';
+import module namespace man = 'http://zorba.io/modules/image/manipulation';
+import schema namespace image = 'http://zorba.io/modules/image/image';
 
 declare namespace an = "http://zorba.io/annotations";;
 

=== modified file 'test/Queries/image/manipulation_2.xq'
--- test/Queries/image/manipulation_2.xq	2013-08-09 09:37:05 +0000
+++ test/Queries/image/manipulation_2.xq	2013-08-12 22:55:38 +0000
@@ -3,10 +3,10 @@
  : 
  : @author Daniel Thomas
  :)
-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
+import module namespace basic = 'http://zorba.io/modules/image/basic';
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace man = 'http://www.zorba-xquery.com/modules/image/manipulation';
-import schema namespace image = 'http://www.zorba-xquery.com/modules/image/image';
+import module namespace man = 'http://zorba.io/modules/image/manipulation';
+import schema namespace image = 'http://zorba.io/modules/image/image';
 
 declare namespace an = "http://zorba.io/annotations";;
 

=== modified file 'test/Queries/image/manipulation_3.xq'
--- test/Queries/image/manipulation_3.xq	2013-08-09 09:37:05 +0000
+++ test/Queries/image/manipulation_3.xq	2013-08-12 22:55:38 +0000
@@ -3,10 +3,10 @@
  : 
  : @author Daniel Thomas
  :)
-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
+import module namespace basic = 'http://zorba.io/modules/image/basic';
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace man = 'http://www.zorba-xquery.com/modules/image/manipulation';
-import schema namespace image = 'http://www.zorba-xquery.com/modules/image/image';
+import module namespace man = 'http://zorba.io/modules/image/manipulation';
+import schema namespace image = 'http://zorba.io/modules/image/image';
 
 declare namespace an = "http://zorba.io/annotations";;
 

=== modified file 'test/Queries/image/manipulation_4.xq'
--- test/Queries/image/manipulation_4.xq	2013-08-09 09:37:05 +0000
+++ test/Queries/image/manipulation_4.xq	2013-08-12 22:55:38 +0000
@@ -3,10 +3,10 @@
  : 
  : @author Daniel Thomas
  :)
-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
+import module namespace basic = 'http://zorba.io/modules/image/basic';
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace man = 'http://www.zorba-xquery.com/modules/image/manipulation';
-import schema namespace image = 'http://www.zorba-xquery.com/modules/image/image';
+import module namespace man = 'http://zorba.io/modules/image/manipulation';
+import schema namespace image = 'http://zorba.io/modules/image/image';
 
 declare namespace an = "http://zorba.io/annotations";;
 

=== modified file 'test/Queries/image/manipulation_5.xq'
--- test/Queries/image/manipulation_5.xq	2013-08-09 09:37:05 +0000
+++ test/Queries/image/manipulation_5.xq	2013-08-12 22:55:38 +0000
@@ -3,10 +3,10 @@
  : 
  : @author Daniel Thomas
  :)
-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
+import module namespace basic = 'http://zorba.io/modules/image/basic';
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace man = 'http://www.zorba-xquery.com/modules/image/manipulation';
-import schema namespace image = 'http://www.zorba-xquery.com/modules/image/image';
+import module namespace man = 'http://zorba.io/modules/image/manipulation';
+import schema namespace image = 'http://zorba.io/modules/image/image';
 
 declare namespace an = "http://zorba.io/annotations";;
 

=== modified file 'test/Queries/image/manipulation_add_noise.xq'
--- test/Queries/image/manipulation_add_noise.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/manipulation_add_noise.xq	2013-08-12 22:55:38 +0000
@@ -6,7 +6,7 @@
  : to disk using file:write-binary(a_path, $noise-image), send it in an email etc.
  :)
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
 

=== modified file 'test/Queries/image/manipulation_blur.xq'
--- test/Queries/image/manipulation_blur.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/manipulation_blur.xq	2013-08-12 22:55:38 +0000
@@ -6,7 +6,7 @@
  : to disk using file:write-binary(a_path, $blurred-image), send it in an email etc.
  :)
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
 

=== modified file 'test/Queries/image/manipulation_charcoal.xq'
--- test/Queries/image/manipulation_charcoal.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/manipulation_charcoal.xq	2013-08-12 22:55:38 +0000
@@ -6,7 +6,7 @@
  : to disk using file:write-binary(a_path, $charcoaled-image), send it in an email etc.
  :)
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
 

=== modified file 'test/Queries/image/manipulation_chop.xq'
--- test/Queries/image/manipulation_chop.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/manipulation_chop.xq	2013-08-12 22:55:38 +0000
@@ -7,7 +7,7 @@
  : to disk using file:write-binary(a_path, $chopped-image), send it in an email etc.
  :)
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
 

=== modified file 'test/Queries/image/manipulation_contrast.xq'
--- test/Queries/image/manipulation_contrast.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/manipulation_contrast.xq	2013-08-12 22:55:38 +0000
@@ -6,7 +6,7 @@
  : to disk using file:write-binary(a_path, $contrasted-image), send it in an email etc.
  :)
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
 

=== modified file 'test/Queries/image/manipulation_crop.xq'
--- test/Queries/image/manipulation_crop.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/manipulation_crop.xq	2013-08-12 22:55:38 +0000
@@ -7,7 +7,7 @@
  : to disk using file:write-binary(a_path, $cropped-image), send it in an email etc.
  :)
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
 

=== modified file 'test/Queries/image/manipulation_despeckle.xq'
--- test/Queries/image/manipulation_despeckle.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/manipulation_despeckle.xq	2013-08-12 22:55:38 +0000
@@ -6,7 +6,7 @@
  : to disk using file:write-binary(a_path, $despeckled-image), send it in an email etc.
  :)
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
 

=== modified file 'test/Queries/image/manipulation_edge.xq'
--- test/Queries/image/manipulation_edge.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/manipulation_edge.xq	2013-08-12 22:55:38 +0000
@@ -7,7 +7,7 @@
  : to disk using file:write-binary(a_path, $edged-image), send it in an email etc.
  :)
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
 

=== modified file 'test/Queries/image/manipulation_emboss.xq'
--- test/Queries/image/manipulation_emboss.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/manipulation_emboss.xq	2013-08-12 22:55:38 +0000
@@ -6,7 +6,7 @@
  : to disk using file:write-binary(a_path, $embossed-image), send it in an email etc.
  :)
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
 

=== modified file 'test/Queries/image/manipulation_enhance.xq'
--- test/Queries/image/manipulation_enhance.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/manipulation_enhance.xq	2013-08-12 22:55:38 +0000
@@ -6,7 +6,7 @@
  : to disk using file:write-binary(a_path, $enhanced-image), send it in an email etc.
  :)
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
 

=== modified file 'test/Queries/image/manipulation_equalize.xq'
--- test/Queries/image/manipulation_equalize.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/manipulation_equalize.xq	2013-08-12 22:55:38 +0000
@@ -6,7 +6,7 @@
  : to disk using file:write(a_path, $enhanced-image, <method>binary</method>), send it in an email etc.
  :)
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
 

=== modified file 'test/Queries/image/manipulation_erase.xq'
--- test/Queries/image/manipulation_erase.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/manipulation_erase.xq	2013-08-12 22:55:38 +0000
@@ -6,7 +6,7 @@
  : to disk using file:write(a_path, $erased-image, <method>binary</method>), send it in an email etc.
  :)
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
 

=== modified file 'test/Queries/image/manipulation_flip.xq'
--- test/Queries/image/manipulation_flip.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/manipulation_flip.xq	2013-08-12 22:55:38 +0000
@@ -6,7 +6,7 @@
  : to disk using file:write(a_path, $flip-image, <method>binary</method>), send it in an email etc.
  :)
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
 

=== modified file 'test/Queries/image/manipulation_flop.xq'
--- test/Queries/image/manipulation_flop.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/manipulation_flop.xq	2013-08-12 22:55:38 +0000
@@ -6,7 +6,7 @@
  : to disk using file:write(a_path, $flop-image, <method>binary</method>), send it in an email etc.
  :)
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
 

=== modified file 'test/Queries/image/manipulation_gamma.xq'
--- test/Queries/image/manipulation_gamma.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/manipulation_gamma.xq	2013-08-12 22:55:38 +0000
@@ -6,7 +6,7 @@
  : to disk using file:write(a_path, $gamma-corrected-image, <method>binary</method>), send it in an email etc.
  :)
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
 

=== modified file 'test/Queries/image/manipulation_gamma2.xq'
--- test/Queries/image/manipulation_gamma2.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/manipulation_gamma2.xq	2013-08-12 22:55:38 +0000
@@ -6,7 +6,7 @@
  : to disk using file:write(a_path, $gamma-corrected-image, <method>binary</method>), send it in an email etc.
  :)
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
 

=== modified file 'test/Queries/image/manipulation_implode.xq'
--- test/Queries/image/manipulation_implode.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/manipulation_implode.xq	2013-08-12 22:55:38 +0000
@@ -6,7 +6,7 @@
  : to disk using file:write(a_path, $imploded-image, <method>binary</method>), send it in an email etc.
  :)
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
 

=== modified file 'test/Queries/image/manipulation_oil_paint.xq'
--- test/Queries/image/manipulation_oil_paint.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/manipulation_oil_paint.xq	2013-08-12 22:55:38 +0000
@@ -6,7 +6,7 @@
  : to disk using file:write(a_path, $oil-image, <method>binary</method>), send it in an email etc.
  :)
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
 

=== modified file 'test/Queries/image/manipulation_overlay.xq'
--- test/Queries/image/manipulation_overlay.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/manipulation_overlay.xq	2013-08-12 22:55:38 +0000
@@ -5,8 +5,8 @@
  : to disk using file:write(a_path, $overlayed-image, <method>binary</method>), send it in an email etc.
  :)
 import module namespace file = 'http://expath.org/ns/file';                                         
-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';                                 
-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';                                 
+import module namespace basic = 'http://zorba.io/modules/image/basic';
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");                    
 

=== modified file 'test/Queries/image/manipulation_reduce_noise.xq'
--- test/Queries/image/manipulation_reduce_noise.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/manipulation_reduce_noise.xq	2013-08-12 22:55:38 +0000
@@ -6,7 +6,7 @@
  : to disk using file:write(a_path, $less-noisy-image, <method>binary</method>), send it in an email etc.
  :)
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
 

=== modified file 'test/Queries/image/manipulation_resize.xq'
--- test/Queries/image/manipulation_resize.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/manipulation_resize.xq	2013-08-12 22:55:38 +0000
@@ -4,7 +4,7 @@
  : to disk using file:write(a_path, $resized-image, <method>binary</method>), send it in an email etc.
  :)
 import module namespace file = 'http://expath.org/ns/file';                                         
-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';                                 
+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';                                 
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");                    
 

=== modified file 'test/Queries/image/manipulation_rotate.xq'
--- test/Queries/image/manipulation_rotate.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/manipulation_rotate.xq	2013-08-12 22:55:38 +0000
@@ -6,7 +6,7 @@
  : to disk using file:write(a_path, $rotated-image, <method>binary</method>), send it in an email etc.
  :)
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
 

=== modified file 'test/Queries/image/manipulation_solarize.xq'
--- test/Queries/image/manipulation_solarize.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/manipulation_solarize.xq	2013-08-12 22:55:38 +0000
@@ -6,7 +6,7 @@
  : to disk using file:write(a_path, $solarized-image, <method>binary</method>), send it in an email etc.
  :)
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
 

=== modified file 'test/Queries/image/manipulation_stereo.xq'
--- test/Queries/image/manipulation_stereo.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/manipulation_stereo.xq	2013-08-12 22:55:38 +0000
@@ -7,7 +7,7 @@
  : to disk using file:write(a_path, $stereo-image, <method>binary</method>), send it in an email etc.
  :)
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
 

=== modified file 'test/Queries/image/manipulation_sub_image.xq'
--- test/Queries/image/manipulation_sub_image.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/manipulation_sub_image.xq	2013-08-12 22:55:38 +0000
@@ -5,8 +5,8 @@
  : to disk using file:write(a_path, $zoomed-image, <method>binary</method>), send it in an email etc.
  :)
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
+import module namespace basic = 'http://zorba.io/modules/image/basic';
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
 

=== modified file 'test/Queries/image/manipulation_swirl.xq'
--- test/Queries/image/manipulation_swirl.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/manipulation_swirl.xq	2013-08-12 22:55:38 +0000
@@ -6,7 +6,7 @@
  : to disk using file:write(a_path, $swirled-image, <method>binary</method>), send it in an email etc.
  :)
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
 

=== modified file 'test/Queries/image/manipulation_transparent.xq'
--- test/Queries/image/manipulation_transparent.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/manipulation_transparent.xq	2013-08-12 22:55:38 +0000
@@ -6,7 +6,7 @@
  : to disk using file:write(a_path, $transparent-image, <method>binary</method>), send it in an email etc.
  :)
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
 

=== modified file 'test/Queries/image/manipulation_trim.xq'
--- test/Queries/image/manipulation_trim.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/manipulation_trim.xq	2013-08-12 22:55:38 +0000
@@ -6,7 +6,7 @@
  : to disk using file:write(a_path, $trimmed-image, <method>binary</method>), send it in an email etc.
  :)
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
 

=== modified file 'test/Queries/image/manipulation_watermark.xq'
--- test/Queries/image/manipulation_watermark.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/manipulation_watermark.xq	2013-08-12 22:55:38 +0000
@@ -6,7 +6,7 @@
  : to disk using file:write(a_path, $watermarked-image, <method>binary</method>), send it in an email etc.
  :)
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
 

=== modified file 'test/Queries/image/manipulation_zoom.xq'
--- test/Queries/image/manipulation_zoom.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/manipulation_zoom.xq	2013-08-12 22:55:38 +0000
@@ -4,7 +4,7 @@
  : to disk using file:write(a_path, $zoomed-image, <method>binary</method>), send it in an email etc.
  :)
 import module namespace file = 'http://expath.org/ns/file';                                         
-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';                                 
+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';                                 
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");                    
 

=== modified file 'test/Queries/image/manipulation_zoom_height.xq'
--- test/Queries/image/manipulation_zoom_height.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/manipulation_zoom_height.xq	2013-08-12 22:55:38 +0000
@@ -5,8 +5,8 @@
  : to disk using file:write(a_path, $zoomed-image, <method>binary</method>), send it in an email etc.
  :)
 import module namespace file = 'http://expath.org/ns/file';                                         
-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';                                 
-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';                                 
+import module namespace basic = 'http://zorba.io/modules/image/basic';
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");                    
 

=== modified file 'test/Queries/image/manipulation_zoom_width.xq'
--- test/Queries/image/manipulation_zoom_width.xq	2011-10-06 08:18:47 +0000
+++ test/Queries/image/manipulation_zoom_width.xq	2013-08-12 22:55:38 +0000
@@ -5,8 +5,8 @@
  : to disk using file:write(a_path, $zoomed-image, <method>binary</method>), send it in an email etc.
  :)
 import module namespace file = 'http://expath.org/ns/file';                                         
-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';                                 
-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';                                 
+import module namespace basic = 'http://zorba.io/modules/image/basic';
 
 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");                    
 

=== modified file 'test/Queries/image/paint_1.xq'
--- test/Queries/image/paint_1.xq	2013-08-09 09:37:05 +0000
+++ test/Queries/image/paint_1.xq	2013-08-12 22:55:38 +0000
@@ -3,10 +3,10 @@
  :
  : @author Daniel Thomas
  :)
-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
-import module namespace file = 'http://expath.org/ns/file';
-import module namespace paint = 'http://www.zorba-xquery.com/modules/image/paint';
-import schema namespace image = 'http://www.zorba-xquery.com/modules/image/image';
+import module namespace basic = 'http://zorba.io/modules/image/basic';
+import module namespace file = 'http://expath.org/ns/file';               
+import module namespace paint = 'http://zorba.io/modules/image/paint';
+import schema namespace image = 'http://zorba.io/modules/image/image';
 
 declare namespace an = "http://zorba.io/annotations";;
 
@@ -38,36 +38,77 @@
 (:~
  : @return true if the man:draw-line function works.
  :)
-declare %an:nondeterministic function local:test-draw-line() as xs:boolean {
-    let $draw := paint:paint($local:gif, <image:line><image:start><image:x>-20</image:x><image:y>-20</image:y></image:start><image:end><image:x>80</image:x><image:y>80</image:y></image:end></image:line>) 
+declare %an:nondeterministic function local:test-draw-line() as xs:boolean {            
+    let $draw := paint:paint($local:gif, 
+    {
+      "line" : {
+        "start" : [ -20, -20 ],
+        "end" : [ 80, 80 ]
+      }
+    }) 
     let $draw-ref := file:read-binary(concat($local:image-dir,"paint/line.gif"))
     return basic:equals($draw, $draw-ref)
 };
 
 declare %an:nondeterministic function local:test-draw-line-color-red() {
-    let $draw := paint:paint($local:gif, <image:line><image:strokeColor>#6F0000</image:strokeColor><image:start><image:x>0</image:x><image:y>0</image:y></image:start><image:end><image:x>80</image:x><image:y>80</image:y></image:end></image:line>) 
+    let $draw := paint:paint($local:gif, 
+    {
+      "line" : { 
+        "strokeColor" : "#6F0000",      
+        "start" : [ 0, 0 ],
+        "end" : [ 80, 80 ]
+      }
+    }) 
     let $draw-ref := file:read-binary(concat($local:image-dir,"paint/redLine.gif"))
     return basic:equals($draw, $draw-ref)
 
 };
 
 declare %an:nondeterministic function local:test-draw-line-color-green() {
-    let $draw := paint:paint($local:gif, <image:line><image:strokeColor>#006F00</image:strokeColor><image:start><image:x>0</image:x><image:y>0</image:y></image:start><image:end><image:x>80</image:x><image:y>80</image:y></image:end></image:line>)
-
+    let $draw := paint:paint($local:gif, 
+    {
+      "line" : { 
+        "strokeColor" : "#006F00",      
+        "start" : [ 0, 0 ],
+        "end" : [ 80, 80 ]
+      }
+    })
     let $draw-ref := file:read-binary(concat($local:image-dir,"paint/greenLine.gif"))
     return basic:equals($draw, $draw-ref)
 
 };
 
 declare %an:nondeterministic function local:test-draw-line-color-blue() {
-    let $draw := paint:paint($local:gif, <image:line><image:strokeColor>#00006F</image:strokeColor><image:start><image:x>0</image:x><image:y>0</image:y></image:start><image:end><image:x>80</image:x><image:y>80</image:y></image:end></image:line>) 
+    let $draw := paint:paint($local:gif, 
+    {
+      "line" : { 
+        "strokeColor" : "#00006F",      
+        "start" : [ 0, 0 ],
+        "end" : [ 80, 80 ]
+      }
+    }) 
     let $draw-ref := file:read-binary(concat($local:image-dir,"paint/blueLine.gif"))
     return basic:equals($draw, $draw-ref)
 
 };
 
 declare %an:nondeterministic function local:test-stroke-width() {
-    let $draw := paint:paint($local:gif, (<image:line><image:strokeWidth>10</image:strokeWidth><image:strokeColor>#000000</image:strokeColor><image:start><image:x>0</image:x><image:y>0</image:y></image:start><image:end><image:x>80</image:x><image:y>80</image:y></image:end></image:line>,<image:line><image:strokeColor>#FF00FF</image:strokeColor><image:start><image:x>30</image:x><image:y>0</image:y></image:start><image:end><image:x>70</image:x><image:y>90</image:y></image:end></image:line>))
+    let $draw := paint:paint($local:gif, 
+    ({
+      "line" : {
+        "strokeWidth" : 10, 
+        "strokeColor" : "#000000",      
+        "start" : [ 0, 0 ],
+        "end" : [ 80, 80 ]
+      }
+    },
+    {
+      "line" : { 
+        "strokeColor" : "#FF00FF",      
+        "start" : [ 30, 0 ],
+        "end" : [ 70, 90 ]
+      }
+    }))
     let $draw-ref := file:read-binary(concat($local:image-dir,"paint/wideLine.gif"))
     return basic:equals($draw, $draw-ref)
 
@@ -76,7 +117,7 @@
 
 
 
-declare %an:nondeterministic %an:sequential function local:main() as xs:string* {
+declare %an:nondeterministic function local:main() as xs:string* {
 
   let $a := local:test-draw-line()
   return

=== modified file 'test/Queries/image/paint_2.xq'
--- test/Queries/image/paint_2.xq	2013-08-09 09:37:05 +0000
+++ test/Queries/image/paint_2.xq	2013-08-12 22:55:38 +0000
@@ -3,10 +3,10 @@
  : 
  : @author Daniel Thomas
  :)
-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
+import module namespace basic = 'http://zorba.io/modules/image/basic';
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace paint = 'http://www.zorba-xquery.com/modules/image/paint';
-import schema namespace img = 'http://www.zorba-xquery.com/modules/image/image';
+import module namespace paint = 'http://zorba.io/modules/image/paint';
+import schema namespace img = 'http://zorba.io/modules/image/image';
 
 declare namespace an = "http://zorba.io/annotations";;
 
@@ -37,14 +37,25 @@
 
 declare %an:nondeterministic function local:test-draw-poly-line() as xs:boolean 
 {
-  let $draw := paint:paint($local:gif, <img:polyLine><img:point><img:x>10</img:x><img:y>10</img:y></img:point><img:point><img:x>40</img:x><img:y>80</img:y></img:point><img:point><img:x>50</img:x><img:y>30</img:y></img:point><img:point><img:x>200</img:x><img:y>200</img:y></img:point></img:polyLine>)
+  let $draw := paint:paint($local:gif, 
+  {
+    "polyLine" : {
+      "points" : [ [ 10, 10 ], [ 40, 80 ], [ 50, 30 ], [ 200, 200 ] ]
+    }
+  })
   let $draw-ref := file:read-binary(concat($local:image-dir, "paint/polyLine.gif"))
   return basic:equals($draw, $draw-ref)
 };
 
 declare %an:nondeterministic function local:test-draw-poly-line-anti-aliased() as xs:boolean
 {
-  let $draw := paint:paint($local:gif, <img:polyLine><img:antiAliasing>true</img:antiAliasing><img:point><img:x>10</img:x><img:y>10</img:y></img:point><img:point><img:x>40</img:x><img:y>80</img:y></img:point><img:point><img:x>50</img:x><img:y>30</img:y></img:point></img:polyLine>)
+  let $draw := paint:paint($local:gif, 
+  {
+    "polyLine" : {
+      "antiAliasing" : fn:true(),
+      "points" : [ [ 10, 10 ], [ 40, 80 ], [ 50, 30 ] ]
+    }
+  })
   let $draw-ref := file:read-binary(concat($local:image-dir, "paint/polyLineAntiAliased.gif"))
   return basic:equals($draw,  $draw-ref)
 };
@@ -54,27 +65,40 @@
  : @return true if the man:draw-poly-line function works.
  :)
 declare %an:nondeterministic function local:test-draw-poly-line-red() as xs:boolean 
-{
-    let $draw := paint:paint($local:gif, <img:polyLine><img:strokeColor>#FF0000</img:strokeColor><img:antiAliasing>true</img:antiAliasing><img:point><img:x>10</img:x><img:y>10</img:y></img:point><img:point><img:x>40</img:x><img:y>80</img:y></img:point><img:point><img:x>50</img:x><img:y>30</img:y></img:point></img:polyLine>)
-    
-    let $draw-ref := file:read-binary(concat($local:image-dir, "paint/polyLineRed.gif"))
-    return basic:equals($draw, $draw-ref)
+{   
+  let $draw := paint:paint($local:gif, 
+  {
+    "polyLine" : {
+      "strokeColor" : "#FF0000",
+      "antiAliasing" : fn:true(),
+      "points" : [ [ 10, 10 ], [ 40, 80 ], [ 50, 30 ] ]
+    }
+  })    
+  let $draw-ref := file:read-binary(concat($local:image-dir, "paint/polyLineRed.gif"))
+  return basic:equals($draw, $draw-ref)
 };
 
 
 (:~
  : @return true if the man:draw-poly-line function works.
  :)
-declare %an:nondeterministic function local:test-draw-poly-line-wide() as xs:boolean {
-     let $draw := paint:paint($local:gif, <img:polyLine><img:strokeWidth>5</img:strokeWidth><img:antiAliasing>true</img:antiAliasing><img:point><img:x>10</img:x><img:y>10</img:y></img:point><img:point><img:x>40</img:x><img:y>80</img:y></img:point><img:point><img:x>50</img:x><img:y>30</img:y></img:point></img:polyLine>)
-    
-    let $draw-ref := file:read-binary(concat($local:image-dir, "paint/polyLineWide.gif"))
-    return basic:equals($draw, $draw-ref)
+declare %an:nondeterministic function local:test-draw-poly-line-wide() as xs:boolean 
+{ 
+  let $draw := paint:paint($local:gif, 
+  {
+    "polyLine" : {
+      "strokeWidth" : 5,
+      "antiAliasing" : fn:true(),
+      "points" : [ [ 10, 10 ], [ 40, 80 ], [ 50, 30 ] ]
+    }
+  })    
+  let $draw-ref := file:read-binary(concat($local:image-dir, "paint/polyLineWide.gif"))
+  return basic:equals($draw, $draw-ref)
 };
 
 
 
-declare %an:nondeterministic %an:sequential function local:main() as xs:string* {
+declare %an:nondeterministic function local:main() as xs:string* {
 
 
   let $a := local:test-draw-poly-line()

=== modified file 'test/Queries/image/paint_3.xq'
--- test/Queries/image/paint_3.xq	2013-08-09 09:37:05 +0000
+++ test/Queries/image/paint_3.xq	2013-08-12 22:55:38 +0000
@@ -3,10 +3,10 @@
  : 
  : @author Daniel Thomas
  :)
-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
+import module namespace basic = 'http://zorba.io/modules/image/basic';
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace paint = 'http://www.zorba-xquery.com/modules/image/paint';
-import schema namespace img = 'http://www.zorba-xquery.com/modules/image/image';
+import module namespace paint = 'http://zorba.io/modules/image/paint';
+import schema namespace img = 'http://zorba.io/modules/image/image';
 
 declare namespace an = "http://zorba.io/annotations";;
 
@@ -39,7 +39,14 @@
  : @return true if the man:draw-stroked-poly-line function works.
  :)
 declare %an:nondeterministic function local:test-draw-stroked-poly-line() as xs:boolean {
-    let $draw := paint:paint($local:gif, <img:strokedPolyLine><img:point><img:x>10</img:x><img:y>10</img:y></img:point><img:point><img:x>40</img:x><img:y>80</img:y></img:point><img:point><img:x>50</img:x><img:y>30</img:y></img:point><img:strokeLength>5</img:strokeLength><img:gapLength>2</img:gapLength></img:strokedPolyLine>)
+    let $draw := paint:paint($local:gif, 
+    {
+      "strokedPolyLine" : {
+        "points" : [ [10,10], [40,80], [50,30] ],
+        "strokeLength" : 5,
+        "gapLength" : 2
+      }
+    })
     let $draw-ref := file:read-binary(concat($local:image-dir, "paint/polyLineStroked.gif"))
     return basic:equals($draw, $draw-ref)
 };
@@ -49,7 +56,15 @@
  : @return true if the man:draw-stroked-poly-line function works.
  :)
 declare %an:nondeterministic function local:test-draw-stroked-poly-line-blue() as xs:boolean {
-    let $draw := paint:paint($local:gif, <img:strokedPolyLine><img:strokeColor>#0000FF</img:strokeColor><img:point><img:x>10</img:x><img:y>10</img:y></img:point><img:point><img:x>40</img:x><img:y>80</img:y></img:point><img:point><img:x>50</img:x><img:y>30</img:y></img:point><img:strokeLength>5</img:strokeLength><img:gapLength>2</img:gapLength></img:strokedPolyLine>)
+    let $draw := paint:paint($local:gif, 
+    {
+      "strokedPolyLine" : {
+        "strokeColor" : "#0000FF",
+        "points" : [ [10,10], [40,80], [50,30] ],
+        "strokeLength" : 5,
+        "gapLength" : 2
+      }
+    })
     let $draw-ref := file:read-binary(concat($local:image-dir, "paint/polyLineStrokedBlue.gif"))
     return basic:equals($draw, $draw-ref)
 };
@@ -58,7 +73,15 @@
  : @return true if the man:draw-stroked-poly-line function works.
  :)
 declare %an:nondeterministic function local:test-draw-stroked-poly-line-wide() as xs:boolean {
-    let $draw := paint:paint($local:gif, <img:strokedPolyLine><img:strokeWidth>4</img:strokeWidth><img:point><img:x>10</img:x><img:y>10</img:y></img:point><img:point><img:x>40</img:x><img:y>80</img:y></img:point><img:point><img:x>50</img:x><img:y>30</img:y></img:point><img:strokeLength>5</img:strokeLength><img:gapLength>2</img:gapLength></img:strokedPolyLine>)
+    let $draw := paint:paint($local:gif, 
+    {
+      "strokedPolyLine" : {
+        "strokeWidth" : 4,
+        "points" : [ [10,10], [40,80], [50,30] ],
+        "strokeLength" : 5,
+        "gapLength" : 2
+      }
+    })
     let $draw-ref := file:read-binary(concat($local:image-dir, "paint/polyLineStrokedWide.gif"))
     return basic:equals($draw, $draw-ref)
 };
@@ -67,12 +90,20 @@
  : @return true if the man:draw-stroked-poly-line function works.
  :)
 declare %an:nondeterministic function local:test-draw-stroked-poly-line-anti-aliased() as xs:boolean {
-    let $draw := paint:paint($local:gif, <img:strokedPolyLine><img:antiAliasing>true</img:antiAliasing><img:point><img:x>10</img:x><img:y>10</img:y></img:point><img:point><img:x>40</img:x><img:y>80</img:y></img:point><img:point><img:x>50</img:x><img:y>30</img:y></img:point><img:strokeLength>5</img:strokeLength><img:gapLength>2</img:gapLength></img:strokedPolyLine>)
+    let $draw := paint:paint($local:gif, 
+    {
+      "strokedPolyLine" : {
+        "antiAliasing" : fn:true(),
+        "points" : [ [10,10], [40,80], [50,30] ],
+        "strokeLength" : 5,
+        "gapLength" : 2
+      }
+    })
     let $draw-ref := file:read-binary(concat($local:image-dir, "paint/polyLineStrokedAntiAliased.gif"))
     return basic:equals($draw, $draw-ref)
 };
 
-declare %an:nondeterministic %an:sequential function local:main() as xs:string* {
+declare %an:nondeterministic function local:main() as xs:string* {
 
   let $a := local:test-draw-stroked-poly-line()
   return

=== modified file 'test/Queries/image/paint_4.xq'
--- test/Queries/image/paint_4.xq	2013-08-09 09:37:05 +0000
+++ test/Queries/image/paint_4.xq	2013-08-12 22:55:38 +0000
@@ -3,10 +3,10 @@
  : 
  : @author Daniel Thomas
  :)
-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
+import module namespace basic = 'http://zorba.io/modules/image/basic';
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace paint = 'http://www.zorba-xquery.com/modules/image/paint';
-import schema namespace image = 'http://www.zorba-xquery.com/modules/image/image';
+import module namespace paint = 'http://zorba.io/modules/image/paint';
+import schema namespace image = 'http://zorba.io/modules/image/image';
 
 declare namespace an = "http://zorba.io/annotations";;
 
@@ -39,7 +39,13 @@
  : @return true if the man:draw-rectangle function works.
  :)
 declare %an:nondeterministic function local:test-draw-rectangle() as xs:boolean {
-    let $draw := paint:paint($local:gif, <image:rectangle><image:upperLeft><image:x>20</image:x><image:y>20</image:y></image:upperLeft><image:lowerRight><image:x>50</image:x><image:y>50</image:y></image:lowerRight></image:rectangle>)
+    let $draw := paint:paint($local:gif, 
+    {
+      "rectangle" : {
+        "upperLeft" : [ 20, 20 ],
+        "lowerRight" : [ 50, 50 ]
+      }
+    })
     let $draw-ref := file:read-binary(concat($local:image-dir, "paint/rectangle.gif"))
     return basic:equals($draw, $draw-ref)
 };
@@ -48,7 +54,14 @@
  : @return true if the man:draw-rectangle function works.
  :)
 declare %an:nondeterministic function local:test-draw-rectangle-green() as xs:boolean {
-    let $draw := paint:paint($local:gif, <image:rectangle><image:strokeColor>#00AF00</image:strokeColor><image:upperLeft><image:x>20</image:x><image:y>20</image:y></image:upperLeft><image:lowerRight><image:x>50</image:x><image:y>50</image:y></image:lowerRight></image:rectangle>)
+    let $draw := paint:paint($local:gif, 
+    {
+      "rectangle" : {
+        "strokeColor" : "#00AF00",
+        "upperLeft" : [ 20, 20 ],
+        "lowerRight" : [ 50, 50 ]
+      }
+    })
     let $draw-ref := file:read-binary(concat($local:image-dir, "paint/rectangleGreen.gif"))
     return basic:equals($draw, $draw-ref)
 };
@@ -58,7 +71,15 @@
  : @return true if the man:draw-rectangle function works.
  :)
 declare %an:nondeterministic function local:test-draw-rectangle-green-red() as xs:boolean {
-    let $draw := paint:paint($local:gif, <image:rectangle><image:strokeColor>#00AF00</image:strokeColor><image:fillColor>#A10000</image:fillColor><image:upperLeft><image:x>20</image:x><image:y>20</image:y></image:upperLeft><image:lowerRight><image:x>50</image:x><image:y>50</image:y></image:lowerRight></image:rectangle>)
+    let $draw := paint:paint($local:gif, 
+    {
+      "rectangle" : {
+        "strokeColor" : "#00AF00",
+        "fillColor" : "#A10000",
+        "upperLeft" : [ 20, 20 ],
+        "lowerRight" : [ 50, 50 ]
+      }
+    })
     let $draw-ref := file:read-binary(concat($local:image-dir, "paint/rectangleGreenRed.gif"))
     return basic:equals($draw, $draw-ref)
 };
@@ -68,7 +89,17 @@
  : @return true if the man:draw-rectangle function works.
  :)
 declare %an:nondeterministic function local:test-draw-rectangle-anti-aliased() as xs:boolean {
-    let $draw := paint:paint($local:gif, <image:rectangle><image:strokeWidth>5</image:strokeWidth><image:strokeColor>#00AF00</image:strokeColor><image:fillColor>#A10000</image:fillColor><image:antiAliasing>true</image:antiAliasing><image:upperLeft><image:x>20</image:x><image:y>20</image:y></image:upperLeft><image:lowerRight><image:x>50</image:x><image:y>50</image:y></image:lowerRight></image:rectangle>)
+    let $draw := paint:paint($local:gif, 
+    {
+      "rectangle" : {
+        "strokeWidth" : 5,
+        "strokeColor" : "#00AF00",
+        "fillColor" : "#A10000",
+        "antiAliasing" : fn:true(),
+        "upperLeft" : [ 20, 20 ],
+        "lowerRight" : [ 50, 50 ]
+      }
+    })
     let $draw-ref := file:read-binary(concat($local:image-dir, "paint/rectangleAntiAliased.gif"))
     return basic:equals($draw, $draw-ref)
 };
@@ -77,7 +108,15 @@
  : @return true if the man:draw-rounded-rectangle function works.
  :)
 declare %an:nondeterministic function local:test-draw-rounded-rectangle() as xs:boolean {
-    let $draw := paint:paint($local:gif, <image:roundedRectangle><image:upperLeft><image:x>20</image:x><image:y>20</image:y></image:upperLeft><image:lowerRight><image:x>50</image:x><image:y>50</image:y></image:lowerRight><image:cornerWidth>10</image:cornerWidth><image:cornerHeight>10</image:cornerHeight></image:roundedRectangle>)
+    let $draw := paint:paint($local:gif, 
+    {
+      "roundedRectangle" : {
+        "upperLeft" : [ 20, 20 ],
+        "lowerRight" : [ 50, 50 ],
+        "cornerWidth" : 10,
+        "cornerHeight" : 10
+      }
+    })
     let $draw-ref := file:read-binary(concat($local:image-dir, "paint/rectangleRounded.gif"))
     return basic:equals($draw, $draw-ref)
 };
@@ -86,7 +125,16 @@
  : @return true if the man:draw-rounded-rectangle function works.
  :)
 declare %an:nondeterministic function local:test-draw-rounded-rectangle-blue() as xs:boolean {
-    let $draw := paint:paint($local:gif, <image:roundedRectangle><image:strokeColor>#0000FF</image:strokeColor><image:upperLeft><image:x>20</image:x><image:y>20</image:y></image:upperLeft><image:lowerRight><image:x>50</image:x><image:y>50</image:y></image:lowerRight><image:cornerWidth>10</image:cornerWidth><image:cornerHeight>10</image:cornerHeight></image:roundedRectangle>)
+    let $draw := paint:paint($local:gif, 
+    {
+      "roundedRectangle" : {
+        "strokeColor" : "#0000FF",
+        "upperLeft" : [ 20, 20 ],
+        "lowerRight" : [ 50, 50 ],
+        "cornerWidth" : 10,
+        "cornerHeight" : 10
+      }
+    })
     let $draw-ref := file:read-binary(concat($local:image-dir, "paint/rectangleRoundedBlue.gif"))
     return basic:equals($draw, $draw-ref)
 };
@@ -96,7 +144,17 @@
  : @return true if the man:draw-rounded-rectangle function works.
  :)
 declare %an:nondeterministic function local:test-draw-rounded-rectangle-blue-green() as xs:boolean {
-    let $draw := paint:paint($local:gif, <image:roundedRectangle><image:strokeColor>#0000FF</image:strokeColor><image:fillColor>#00FF00</image:fillColor><image:upperLeft><image:x>20</image:x><image:y>20</image:y></image:upperLeft><image:lowerRight><image:x>50</image:x><image:y>50</image:y></image:lowerRight><image:cornerWidth>10</image:cornerWidth><image:cornerHeight>10</image:cornerHeight></image:roundedRectangle>)
+    let $draw := paint:paint($local:gif, 
+    {
+      "roundedRectangle" : {
+        "strokeColor" : "#0000FF",
+        "fillColor" : "#00FF00",
+        "upperLeft" : [ 20, 20 ],
+        "lowerRight" : [ 50, 50 ],
+        "cornerWidth" : 10,
+        "cornerHeight" : 10
+      }
+    })
     let $draw-ref := file:read-binary(concat($local:image-dir, "paint/rectangleRoundedBlueGreen.gif"))
     return basic:equals($draw, $draw-ref)
 };
@@ -106,13 +164,24 @@
  : @return true if the man:draw-rounded-rectangle function works.
  :)
 declare %an:nondeterministic function local:test-draw-rounded-rectangle-anti-aliased() as xs:boolean {
-    let $draw := paint:paint($local:gif, <image:roundedRectangle><image:strokeColor>#0000FF</image:strokeColor><image:fillColor>#00FF00</image:fillColor><image:antiAliasing>true</image:antiAliasing><image:upperLeft><image:x>20</image:x><image:y>20</image:y></image:upperLeft><image:lowerRight><image:x>50</image:x><image:y>50</image:y></image:lowerRight><image:cornerWidth>10</image:cornerWidth><image:cornerHeight>10</image:cornerHeight></image:roundedRectangle>)
+    let $draw := paint:paint($local:gif, 
+    {
+      "roundedRectangle" : {
+        "strokeColor" : "#0000FF",
+        "fillColor" : "#00FF00",
+        "antiAliased" : fn:true(),
+        "upperLeft" : [ 20, 20 ],
+        "lowerRight" : [ 50, 50 ],
+        "cornerWidth" : 10,
+        "cornerHeight" : 10
+      }
+    })
     let $draw-ref := file:read-binary(concat($local:image-dir, "paint/rectangleRoundedAntiAliased.gif"))
     return basic:equals($draw, $draw-ref)
 };
 
 
-declare %an:nondeterministic %an:sequential function local:main() as xs:string* {
+declare %an:nondeterministic function local:main() as xs:string* {
 
   let $a := local:test-draw-rectangle()
   return

=== modified file 'test/Queries/image/paint_5.xq'
--- test/Queries/image/paint_5.xq	2013-08-09 09:37:05 +0000
+++ test/Queries/image/paint_5.xq	2013-08-12 22:55:38 +0000
@@ -3,10 +3,10 @@
  : 
  : @author Daniel Thomas
  :)
-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
+import module namespace basic = 'http://zorba.io/modules/image/basic';
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace paint = 'http://www.zorba-xquery.com/modules/image/paint';
-import schema namespace image = 'http://www.zorba-xquery.com/modules/image/image';
+import module namespace paint = 'http://zorba.io/modules/image/paint';
+import schema namespace image = 'http://zorba.io/modules/image/image';
 
 declare namespace an = "http://zorba.io/annotations";;
 
@@ -40,7 +40,12 @@
  : @return true if the man:draw-circle function works.
  :)
 declare %an:nondeterministic function local:test-draw-circle() as xs:boolean {
-    let $draw := paint:paint($local:jpg, <image:circle><image:origin><image:x>20</image:x><image:y>20</image:y></image:origin><image:perimeter>5</image:perimeter></image:circle>)
+    let $draw := paint:paint($local:jpg, {
+      "circle" : {
+        "origin" : [ 20, 20 ],
+        "radius" : 5
+      }
+    })
     let $draw-ref := file:read-binary(concat($local:image-dir, "paint/circle.jpg"))
     return basic:equals($draw, $draw-ref)
 };
@@ -50,7 +55,13 @@
  : @return true if the man:draw-ellipse function works.
  :)
 declare %an:nondeterministic function local:test-draw-ellipse() as xs:boolean {
-    let $draw := paint:paint($local:jpg, <image:ellipse><image:origin><image:x>50</image:x><image:y>50</image:y></image:origin><image:perimeterX>30</image:perimeterX><image:perimeterY>20</image:perimeterY></image:ellipse>)
+    let $draw := paint:paint($local:jpg, {
+      "ellipse" : {
+        "origin" : [ 50, 50 ],
+        "radiusX" : 30,
+        "radiusY" : 20
+      }
+    })
     let $draw-ref := file:read-binary(concat($local:image-dir, "paint/ellipse.jpg"))
     return basic:equals($draw, $draw-ref)
 };
@@ -59,7 +70,15 @@
  : @return true if the man:draw-arc function works.
  :)
 declare %an:nondeterministic function local:test-draw-arc() as xs:boolean {
-    let $draw := paint:paint($local:jpg, <image:arc><image:origin><image:x>50</image:x><image:y>50</image:y></image:origin><image:perimeterX>10</image:perimeterX><image:perimeterY>20</image:perimeterY><image:startDegrees>180</image:startDegrees><image:endDegrees>270</image:endDegrees></image:arc>)
+    let $draw := paint:paint($local:jpg, {
+      "arc" : {
+        "origin" : [ 50, 50 ],
+        "radiusX" : 10,
+        "radiusY" : 20,
+        "startDegrees" : 180,
+        "endDegrees" : 270
+      }
+    })
     let $draw-ref := file:read-binary(concat($local:image-dir, "paint/arc.jpg"))
     return basic:equals($draw, $draw-ref)
 };
@@ -68,7 +87,16 @@
  : @return true if the man:draw-arc function works.
  :)
 declare %an:nondeterministic function local:test-draw-red-arc() as xs:boolean {
-    let $draw := paint:paint($local:jpg, <image:arc><image:strokeColor>#FF0000</image:strokeColor><image:origin><image:x>50</image:x><image:y>50</image:y></image:origin><image:perimeterX>10</image:perimeterX><image:perimeterY>20</image:perimeterY><image:startDegrees>180</image:startDegrees><image:endDegrees>270</image:endDegrees></image:arc>)
+    let $draw := paint:paint($local:jpg, {
+      "arc" : {
+        "strokeColor" : "#FF0000",
+        "origin" : [ 50, 50 ],
+        "radiusX" : 10,
+        "radiusY" : 20,
+        "startDegrees" : 180,
+        "endDegrees" : 270
+      }
+    })
     let $draw-ref := file:read-binary(concat($local:image-dir, "paint/arcRed.jpg"))
     return basic:equals($draw, $draw-ref)
 };
@@ -77,7 +105,17 @@
  : @return true if the man:draw-arc function works.
  :)
 declare %an:nondeterministic function local:test-draw-red-green-arc() as xs:boolean {
-    let $draw := paint:paint($local:jpg, <image:arc><image:strokeColor>#FF0000</image:strokeColor><image:fillColor>#00AF00</image:fillColor><image:origin><image:x>50</image:x><image:y>50</image:y></image:origin><image:perimeterX>10</image:perimeterX><image:perimeterY>20</image:perimeterY><image:startDegrees>180</image:startDegrees><image:endDegrees>270</image:endDegrees></image:arc>)
+    let $draw := paint:paint($local:jpg, {
+      "arc" : {
+        "strokeColor" : "#FF0000",
+        "fillColor" : "#00AF00",
+        "origin" : [ 50, 50 ],
+        "radiusX" : 10,
+        "radiusY" : 20,
+        "startDegrees" : 180,
+        "endDegrees" : 270
+      }
+    })
     let $draw-ref := file:read-binary(concat($local:image-dir, "paint/arcRedGreen.jpg"))
     return basic:equals($draw, $draw-ref)
 };
@@ -86,7 +124,18 @@
  : @return true if the man:draw-arc function works.
  :)
 declare %an:nondeterministic function local:test-draw-wide-arc() as xs:boolean {
-    let $draw := paint:paint($local:jpg, <image:arc><image:strokeWidth>5</image:strokeWidth><image:strokeColor>#FF0000</image:strokeColor><image:fillColor>#00AF00</image:fillColor><image:origin><image:x>50</image:x><image:y>50</image:y></image:origin><image:perimeterX>10</image:perimeterX><image:perimeterY>20</image:perimeterY><image:startDegrees>180</image:startDegrees><image:endDegrees>270</image:endDegrees></image:arc>)
+    let $draw := paint:paint($local:jpg, {
+      "arc" : {
+        "strokeWidth" : 5,
+        "strokeColor" : "#FF0000",
+        "fillColor" : "#00AF00",
+        "origin" : [ 50, 50 ],
+        "radiusX" : 10,
+        "radiusY" : 20,
+        "startDegrees" : 180,
+        "endDegrees" : 270
+      }
+    })
     let $draw-ref := file:read-binary(concat($local:image-dir, "paint/arcWide.jpg"))
     return basic:equals($draw, $draw-ref)
 };
@@ -97,7 +146,19 @@
  : @return true if the man:draw-arc function works.
  :)
 declare %an:nondeterministic function local:test-draw-anti-aliased-arc() as xs:boolean {
-    let $draw := paint:paint($local:jpg, <image:arc><image:strokeWidth>5</image:strokeWidth><image:strokeColor>#FF0000</image:strokeColor><image:fillColor>#00AF00</image:fillColor><image:antiAliasing>true</image:antiAliasing><image:origin><image:x>50</image:x><image:y>50</image:y></image:origin><image:perimeterX>10</image:perimeterX><image:perimeterY>20</image:perimeterY><image:startDegrees>180</image:startDegrees><image:endDegrees>270</image:endDegrees></image:arc>)
+    let $draw := paint:paint($local:jpg, {
+      "arc" : {
+        "strokeWidth" : 5,
+        "strokeColor" : "#FF0000",
+        "fillColor" : "#00AF00",
+        "antiAliasing" : fn:true(),
+        "origin" : [ 50, 50 ],
+        "radiusX" : 10,
+        "radiusY" : 20,
+        "startDegrees" : 180,
+        "endDegrees" : 270
+      }
+    })
     let $draw-ref := file:read-binary(concat($local:image-dir, "paint/arcAntiAliased.jpg"))
     return basic:equals($draw, $draw-ref)
 };
@@ -106,7 +167,7 @@
 
 
 
-declare %an:nondeterministic %an:sequential function local:main() as xs:string* {
+declare %an:nondeterministic function local:main() as xs:string* {
 
   let $a := local:test-draw-circle()
   return

=== modified file 'test/Queries/image/paint_6.xq'
--- test/Queries/image/paint_6.xq	2013-08-09 09:37:05 +0000
+++ test/Queries/image/paint_6.xq	2013-08-12 22:55:38 +0000
@@ -3,10 +3,10 @@
  : 
  : @author Daniel Thomas
  :)
-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
+import module namespace basic = 'http://zorba.io/modules/image/basic';
 import module namespace file = 'http://expath.org/ns/file';
-import module namespace paint = 'http://www.zorba-xquery.com/modules/image/paint';
-import schema namespace image = 'http://www.zorba-xquery.com/modules/image/image';
+import module namespace paint = 'http://zorba.io/modules/image/paint';
+import schema namespace image = 'http://zorba.io/modules/image/image';
 
 declare namespace an = "http://zorba.io/annotations";;
 
@@ -37,7 +37,12 @@
  : @return true if the man:draw-polygon function works.
  :)
 declare %an:nondeterministic function local:test-draw-polygon() as xs:boolean {
-    let $draw := paint:paint($local:jpg, <image:polygon><image:point><image:x>10</image:x><image:y>10</image:y></image:point><image:point><image:x>40</image:x><image:y>80</image:y></image:point><image:point><image:x>50</image:x><image:y>30</image:y></image:point></image:polygon>)
+    let $draw := paint:paint($local:jpg, 
+    {
+      "polygon" : {
+        "points" : [ [ 10, 10 ], [ 40, 80 ], [ 50, 30 ] ]
+      }
+    })
     let $draw-ref := file:read-binary(concat($local:image-dir, "paint/polygon.jpg"))
     return basic:equals($draw, $draw-ref)
 };
@@ -46,7 +51,13 @@
  : @return true if the man:draw-polygon function works.
  :)
 declare %an:nondeterministic function local:test-draw-polygon-red() as xs:boolean {
-    let $draw := paint:paint($local:jpg, <image:polygon><image:strokeColor>#FF0000</image:strokeColor><image:point><image:x>10</image:x><image:y>10</image:y></image:point><image:point><image:x>40</image:x><image:y>80</image:y></image:point><image:point><image:x>50</image:x><image:y>30</image:y></image:point></image:polygon>)
+    let $draw := paint:paint($local:jpg, 
+    {
+      "polygon" : {
+        "strokeColor" : "#FF0000",
+        "points" : [ [ 10, 10 ], [ 40, 80 ], [ 50, 30 ] ]
+      }
+    })
     let $draw-ref := file:read-binary(concat($local:image-dir, "paint/polygonRed.jpg"))
     return basic:equals($draw, $draw-ref)
 };
@@ -55,7 +66,14 @@
  : @return true if the man:draw-polygon function works.
  :)
 declare %an:nondeterministic function local:test-draw-polygon-red-green() as xs:boolean {
-    let $draw := paint:paint($local:jpg, <image:polygon><image:strokeColor>#FF0000</image:strokeColor><image:fillColor>#00FF00</image:fillColor><image:point><image:x>10</image:x><image:y>10</image:y></image:point><image:point><image:x>40</image:x><image:y>80</image:y></image:point><image:point><image:x>50</image:x><image:y>30</image:y></image:point></image:polygon>)
+    let $draw := paint:paint($local:jpg,
+    {
+      "polygon" : {
+        "strokeColor" : "#FF0000",
+        "fillColor" : "#00FF00",
+        "points" : [ [ 10, 10 ], [ 40, 80 ], [ 50, 30 ] ]
+      }
+    })
     let $draw-ref := file:read-binary(concat($local:image-dir, "paint/polygonRedGreen.jpg"))
     return basic:equals($draw, $draw-ref)
 };
@@ -64,7 +82,15 @@
  : @return true if the man:draw-polygon function works.
  :)
 declare %an:nondeterministic function local:test-draw-polygon-wide() as xs:boolean {
-    let $draw := paint:paint($local:jpg, <image:polygon><image:strokeWidth>3</image:strokeWidth><image:strokeColor>#FF0000</image:strokeColor><image:fillColor>#00FF00</image:fillColor><image:point><image:x>10</image:x><image:y>10</image:y></image:point><image:point><image:x>40</image:x><image:y>80</image:y></image:point><image:point><image:x>50</image:x><image:y>30</image:y></image:point></image:polygon>)
+    let $draw := paint:paint($local:jpg, 
+    {
+      "polygon" : {
+        "strokeWidth" : 3,
+        "strokeColor" : "#FF0000",
+        "fillColor" : "#00FF00",
+        "points" : [ [ 10, 10 ], [ 40, 80 ], [ 50, 30 ] ]
+      }
+    })
     let $draw-ref := file:read-binary(concat($local:image-dir, "paint/polygonWide.jpg"))
     return basic:equals($draw, $draw-ref)
 };
@@ -74,7 +100,16 @@
  : @return true if the man:draw-polygon function works.
  :)
 declare %an:nondeterministic function local:test-draw-polygon-anti-aliased() as xs:boolean {
-    let $draw := paint:paint($local:jpg, <image:polygon><image:strokeWidth>3</image:strokeWidth><image:strokeColor>#FF0000</image:strokeColor><image:fillColor>#00FF00</image:fillColor><image:antiAliasing>true</image:antiAliasing><image:point><image:x>10</image:x><image:y>10</image:y></image:point><image:point><image:x>40</image:x><image:y>80</image:y></image:point><image:point><image:x>50</image:x><image:y>30</image:y></image:point></image:polygon>)
+    let $draw := paint:paint($local:jpg, 
+    {
+      "polygon" : {
+        "strokeWidth" : 3,
+        "strokeColor" : "#FF0000",
+        "fillColor" : "#00FF00",
+        "antiAliasing" : fn:true(),
+        "points" : [ [ 10, 10 ], [ 40, 80 ], [ 50, 30 ] ]
+      }
+    })
     let $draw-ref := file:read-binary(concat($local:image-dir, "paint/polygonAntiAliased.jpg"))
     return basic:equals($draw, $draw-ref)
 };

=== modified file 'test/Queries/image/paint_circles.xq'
--- test/Queries/image/paint_circles.xq	2011-08-07 00:38:36 +0000
+++ test/Queries/image/paint_circles.xq	2013-08-12 22:55:38 +0000
@@ -3,34 +3,58 @@
  : As it is, the example just asserts that the resulting xs:base64Binary is not empty, in a real application one could further process the image, or write it 
  : to disk using file:write(a_path, $image-with-circles, <method>binary</method>), send it in an email etc.
  : 
- : Actually, as the paint function accepts sequences of shapes, it would have been possible to paint all circles, ellipses and arcs with one single command
- : paint:paint($new-image, (<image:circle><image:origin><image:x>20</image:x><image:y>20</image:y></image:origin><image:perimeter>20</image:perimeter></image:circle>,
- :                          <image:ellipse><image:origin><image:x>40</image:x><image:y>70</image:y></image:origin><image:perimeterX>20</image:perimeterX><image:perimeterY>10</image:perimeterY></image:ellipse>,
- :                          <image:arc><image:origin><image:x>70</image:x><image:y>35</image:y></image:origin><image:perimeterX>15</image:perimeterX><image:perimeterY>25</image:perimeterY><image:startDegrees>90</image:startDegrees><image:endDegrees>180</image:endDegrees></image:arc>,
- :                          <image:circle><image:fillColor>#0000FF</image:fillColor><image:origin><image:x>80</image:x><image:y>20</image:y></image:origin><image:perimeter>20</image:perimeter></image:circle>))
- :                           
+ : Actually, as the paint function accepts sequences of shapes, it would have been possible to paint all circles, ellipses and arcs with one single command              
  : However, here it is done with several function calls to make it more clear what exactly is painted.
  :
  :)
-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
-import module namespace paint = 'http://www.zorba-xquery.com/modules/image/paint';
+import module namespace basic = 'http://zorba.io/modules/image/basic';
+import module namespace paint = 'http://zorba.io/modules/image/paint';
 import module namespace file = 'http://expath.org/ns/file';
 
-import schema namespace image = 'http://www.zorba-xquery.com/modules/image/image';
+import schema namespace image = 'http://zorba.io/modules/image/image';
 
 let $new-image :=  basic:create(xs:unsignedInt(100), xs:unsignedInt(100), "GIF")
 
 (: paint a simple circle with origin in (20, 20) and a perimeter of 20px to the image :)
-let $image-with-circle := paint:paint($new-image, <image:circle><image:origin><image:x>20</image:x><image:y>20</image:y></image:origin><image:perimeter>20</image:perimeter></image:circle>)
+let $image-with-circle := paint:paint($new-image, 
+{
+  "circle" : {
+    "origin" : [ 20, 20 ],
+    "radius" : 20
+  }
+})
 
 (: paint an ellipse to the image :)
-let $image-with-circles := paint:paint($image-with-circle, <image:ellipse><image:origin><image:x>40</image:x><image:y>70</image:y></image:origin><image:perimeterX>20</image:perimeterX><image:perimeterY>10</image:perimeterY></image:ellipse>)
+let $image-with-circles := paint:paint($image-with-circle,
+{
+  "ellipse" : {
+    "origin" : [ 40, 70 ],
+    "radiusX" : 20,
+    "radiusY" : 10
+  }
+})
 
 (: paint an arc from 90 to 180 degrees to the image :)
-let $image-with-circles := paint:paint($image-with-circles, <image:arc><image:origin><image:x>70</image:x><image:y>35</image:y></image:origin><image:perimeterX>15</image:perimeterX><image:perimeterY>25</image:perimeterY><image:startDegrees>90</image:startDegrees><image:endDegrees>180</image:endDegrees></image:arc>)
+let $image-with-circles := paint:paint($image-with-circles,
+{
+  "arc" : {
+    "origin" : [ 70, 35 ],
+    "radiusX" : 15,
+    "radiusY" : 25,
+    "startDegrees" : 90,
+    "endDegrees" : 180
+  }
+})
 
 (: paint a blue circle with black contour onto the image :)
-let $image-with-circles := paint:paint($image-with-circles, <image:circle><image:fillColor>#0000FF</image:fillColor><image:origin><image:x>80</image:x><image:y>20</image:y></image:origin><image:perimeter>20</image:perimeter></image:circle>)
+let $image-with-circles := paint:paint($image-with-circles,
+{
+  "circle" : {
+    "fillColor" : "#0000FF",
+    "origin" : [ 80, 20 ],
+    "radius" : 20
+  }
+})
 
 
 return not(empty($image-with-circles)) 

=== modified file 'test/Queries/image/paint_different_lines.xq'
--- test/Queries/image/paint_different_lines.xq	2011-08-07 00:38:36 +0000
+++ test/Queries/image/paint_different_lines.xq	2013-08-12 22:55:38 +0000
@@ -10,20 +10,50 @@
  :
  : However, to show exactly what is painted it was done with several function calls in this example (which is much less performant).
  :)
-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic'; 
-import module namespace paint = 'http://www.zorba-xquery.com/modules/image/paint';
+import module namespace basic = 'http://zorba.io/modules/image/basic'; 
+import module namespace paint = 'http://zorba.io/modules/image/paint';
 
-import schema namespace image = 'http://www.zorba-xquery.com/modules/image/image';
+import schema namespace image = 'http://zorba.io/modules/image/image';
 
 let $new-image :=  basic:create(xs:unsignedInt(100), xs:unsignedInt(100), "GIF")
 (: paint a simple line from (10, 0) to (10, 100) :)
-let $image-with-1-line := paint:paint($new-image, <image:line><image:start><image:x>10</image:x><image:y>0</image:y></image:start><image:end><image:x>10</image:x><image:y>100</image:y></image:end></image:line>)
+let $image-with-1-line := paint:paint($new-image, 
+{
+  "line" : {
+    "start" : [10,0],
+    "end" : [10,100]
+  }
+})
 (: paint a simple red line from (30, 0) to (30, 100) :)
-let $image-with-2-line := paint:paint($image-with-1-line, <image:line><image:strokeColor>#FF0000</image:strokeColor><image:start><image:x>30</image:x><image:y>0</image:y></image:start><image:end><image:x>30</image:x><image:y>100</image:y></image:end></image:line>)
+let $image-with-2-line := paint:paint($image-with-1-line, 
+{
+  "line" : {
+    "strokeColor" : "#FF0000",
+    "start" : [30,0],
+    "end" : [30,100]
+  }
+})
 (: paint a simple red anti-aliased line from (50, 0) to (50, 100) :)
-let $image-with-3-line := paint:paint($image-with-2-line, <image:line><image:strokeColor>#FF0000</image:strokeColor><image:antiAliasing>true</image:antiAliasing><image:start><image:x>50</image:x><image:y>0</image:y></image:start><image:end><image:x>50</image:x><image:y>100</image:y></image:end></image:line>)
+let $image-with-3-line := paint:paint($image-with-2-line, 
+{
+  "line" : {
+    "strokeColor" : "#FF0000",
+    "antiAliasing" : fn:true(),
+    "start" : [50,0],
+    "end" : [50,100]
+  }
+})
 (: paint a simple red wide anti-aliased line  from (70, 0) to (70, 100) :)
-let $image-with-4-line := paint:paint($image-with-3-line, <image:line><image:strokeWidth>10</image:strokeWidth><image:strokeColor>#FF0000</image:strokeColor><image:antiAliasing>true</image:antiAliasing><image:start><image:x>70</image:x><image:y>0</image:y></image:start><image:end><image:x>70</image:x><image:y>100</image:y></image:end></image:line>)
+let $image-with-4-line := paint:paint($image-with-3-line, 
+{
+  "line" : {
+    "strokeWidth" : 10,
+    "strokeColor" : "#FF0000",
+    "antiAliasing" : fn:true(),
+    "start" : [70,0],
+    "end" : [70,100]
+  }
+})
 
 return not(empty($image-with-4-line))
 

=== modified file 'test/Queries/image/paint_polygon.xq'
--- test/Queries/image/paint_polygon.xq	2011-08-07 00:38:36 +0000
+++ test/Queries/image/paint_polygon.xq	2013-08-12 22:55:38 +0000
@@ -3,15 +3,20 @@
  : As it is, the example just asserts that the resulting xs:base64Binary is not empty, in a real application one could further process the image, or write it 
  : to disk using file:write(a_path, $image-with-polygon, <method>binary</method>), send it in an email etc.
  :)
-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic'; 
-import module namespace paint = 'http://www.zorba-xquery.com/modules/image/paint';
+import module namespace basic = 'http://zorba.io/modules/image/basic'; 
+import module namespace paint = 'http://zorba.io/modules/image/paint';
 
-import schema namespace image = 'http://www.zorba-xquery.com/modules/image/image';
+import schema namespace image = 'http://zorba.io/modules/image/image';
 
 let $new-image :=  basic:create(xs:unsignedInt(100), xs:unsignedInt(100), "GIF")
 
 (: paint an anti-aliased polyline which goes through the points (0,0) (30, 70), (20, 18), (89, 33) :)
-let $image-with-polygon := paint:paint($new-image, <image:polygon><image:antiAliasing>true</image:antiAliasing><image:point><image:x>0</image:x><image:y>0</image:y></image:point><image:point><image:x>30</image:x><image:y>70</image:y></image:point><image:point><image:x>20</image:x><image:y>18</image:y></image:point><image:point><image:x>89</image:x><image:y>33</image:y></image:point></image:polygon>)
+let $image-with-polygon := paint:paint($new-image, { 
+  "polyLine" : { 
+    "antiAliasing" : fn:true(),
+    "points" : [ [ 0, 0 ], [ 30, 70 ], [  20, 18 ], [ 89, 33 ] ] 
+    }
+})
 
 return not(empty($image-with-polygon)) 
 

=== modified file 'test/Queries/image/paint_polyline.xq'
--- test/Queries/image/paint_polyline.xq	2011-08-07 00:38:36 +0000
+++ test/Queries/image/paint_polyline.xq	2013-08-12 22:55:38 +0000
@@ -3,15 +3,20 @@
  : As it is, the example just asserts that the resulting xs:base64Binary is not empty, in a real application one could further process the image, or write it 
  : to disk using file:write(a_path, $image-with-polyline, <method>binary</method>), send it in an email etc.
  :)
-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic'; 
-import module namespace paint = 'http://www.zorba-xquery.com/modules/image/paint';
+import module namespace basic = 'http://zorba.io/modules/image/basic'; 
+import module namespace paint = 'http://zorba.io/modules/image/paint';
 
-import schema namespace image = 'http://www.zorba-xquery.com/modules/image/image';
+import schema namespace image = 'http://zorba.io/modules/image/image';
 
 let $new-image :=  basic:create(xs:unsignedInt(100), xs:unsignedInt(100), "GIF")
 
 (: paint an anti-aliased polyline which goes through the points (0,0) (30, 70), (20, 18), (89, 33) :)
-let $image-with-polyline := paint:paint($new-image, <image:polyLine><image:antiAliasing>true</image:antiAliasing><image:point><image:x>0</image:x><image:y>0</image:y></image:point><image:point><image:x>30</image:x><image:y>70</image:y></image:point><image:point><image:x>20</image:x><image:y>18</image:y></image:point><image:point><image:x>89</image:x><image:y>33</image:y></image:point></image:polyLine>)
+let $image-with-polyline := paint:paint($new-image, { 
+  "polyLine" : { 
+    "antiAliasing" : fn:true(),
+    "points" : [ [ 0, 0 ], [ 30, 70 ], [  20, 18 ], [ 89, 33 ] ] 
+    }
+})
 
 return not(empty($image-with-polyline)) 
 

=== modified file 'test/Queries/image/paint_rectangles.xq'
--- test/Queries/image/paint_rectangles.xq	2011-08-07 00:38:36 +0000
+++ test/Queries/image/paint_rectangles.xq	2013-08-12 22:55:38 +0000
@@ -12,20 +12,42 @@
  :
  : However, to make clear what exaclty is painted it was done with several function calls in this example (which is less performant).
  :)
-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
-import module namespace paint = 'http://www.zorba-xquery.com/modules/image/paint';
+import module namespace basic = 'http://zorba.io/modules/image/basic';
+import module namespace paint = 'http://zorba.io/modules/image/paint';
 
-import schema namespace image = 'http://www.zorba-xquery.com/modules/image/image';
+import schema namespace image = 'http://zorba.io/modules/image/image';
 
 let $new-image :=  basic:create(xs:unsignedInt(100), xs:unsignedInt(100), "GIF")
 
 (: paint a simple rectangle to the image :) 
-let $image-with-rectangle := paint:paint($new-image, <image:rectangle><image:upperLeft><image:x>10</image:x><image:y>10</image:y></image:upperLeft><image:lowerRight><image:x>20</image:x><image:y>20</image:y></image:lowerRight></image:rectangle>) 
+let $image-with-rectangle := paint:paint($new-image, 
+{
+  "rectangle" : {
+    "upperLeft" : [10,10],
+    "lowerRight" : [20,20]
+  }
+}) 
 
 (: paint a rounded rectangle to the image with a corner width of 10px and a corner height of 10 px :) 
-let $image-with-rectangles := paint:paint($image-with-rectangle, <image:roundedRectangle><image:upperLeft><image:x>30</image:x><image:y>30</image:y></image:upperLeft><image:lowerRight><image:x>50</image:x><image:y>60</image:y></image:lowerRight><image:cornerWidth>10</image:cornerWidth><image:cornerHeight>10</image:cornerHeight></image:roundedRectangle>)
+let $image-with-rectangles := paint:paint($image-with-rectangle, 
+{
+  "roundedRectangle" : {
+    "upperLeft" : [30,30],
+    "lowerRight" : [50,60],
+    "cornerWidth" : 10,
+    "cornerHeight" : 10 
+  }             
+})
 
 (: paint a rectangle with green contour which is filled with red to the image :)  
-let $image-with-rectangles := paint:paint($image-with-rectangles, <image:rectangle><image:strokeColor>#00FF00</image:strokeColor><image:fillColor>#FF0000</image:fillColor><image:upperLeft><image:x>75</image:x><image:y>10</image:y></image:upperLeft><image:lowerRight><image:x>95</image:x><image:y>50</image:y></image:lowerRight></image:rectangle>)
+let $image-with-rectangles := paint:paint($image-with-rectangles, 
+{
+  "rectangle" : {
+    "strokeColor" : "#00FF00",
+    "fillColor" : "#FF0000",
+    "upperLeft" : [75,10],
+    "lowerRight" : [95,50]
+  }
+})
 
 return not(empty($image-with-rectangles)) 

=== modified file 'test/Queries/image/paint_stroked_polyline.xq'
--- test/Queries/image/paint_stroked_polyline.xq	2011-08-07 00:38:36 +0000
+++ test/Queries/image/paint_stroked_polyline.xq	2013-08-12 22:55:38 +0000
@@ -3,14 +3,21 @@
  : As it is, the example just asserts that the resulting xs:base64Binary is not empty, in a real application one could further process the image, or write it 
  : to disk using file:write(a_path, $image-with-polyline, <method>binary</method>), send it in an email etc.
  :)
-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
-import module namespace paint = 'http://www.zorba-xquery.com/modules/image/paint';
+import module namespace basic = 'http://zorba.io/modules/image/basic';
+import module namespace paint = 'http://zorba.io/modules/image/paint';
 
-import schema namespace image = 'http://www.zorba-xquery.com/modules/image/image';
+import schema namespace image = 'http://zorba.io/modules/image/image';
 
 let $new-image :=  basic:create(xs:unsignedInt(100), xs:unsignedInt(100), "GIF")
 (: paint an anti-aliased polyline with stoke length 2 and gap length 1 which goes through the points (0,0) (30, 70), (20, 18), (89, 33) :)
-let $image-with-polyline := paint:paint($new-image, <image:strokedPolyLine><image:antiAliasing>true</image:antiAliasing><image:point><image:x>0</image:x><image:y>0</image:y></image:point><image:point><image:x>30</image:x><image:y>70</image:y></image:point><image:point><image:x>20</image:x><image:y>18</image:y></image:point><image:point><image:x>89</image:x><image:y>33</image:y></image:point><image:strokeLength>2</image:strokeLength><image:gapLength>5</image:gapLength></image:strokedPolyLine>)
+let $image-with-polyline := paint:paint($new-image, 
+{
+  "strokedPolyLine" : {
+    "points" : [ [ 0, 0 ], [ 30, 70 ], [ 20, 18 ], [ 89, 33 ] ],
+    "strokeLength" : 2,
+    "gapLength" : 5
+  }
+})
 
 return not(empty($image-with-polyline)) 
 

=== modified file 'test/Queries/image/paint_text.xq'
--- test/Queries/image/paint_text.xq	2011-08-07 00:38:36 +0000
+++ test/Queries/image/paint_text.xq	2013-08-12 22:55:38 +0000
@@ -3,13 +3,21 @@
  : As it is, the example just asserts that the resulting xs:base64Binary is not empty, in a real application one could further process the image, or write it 
  : to disk using file:write-binary(a_path, $image-with-text), send it in an email etc.
  :)
-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';                                                                                                                                                     import module namespace paint = 'http://www.zorba-xquery.com/modules/image/paint';                                                                                                                                                     
-import schema namespace image = 'http://www.zorba-xquery.com/modules/image/image';
+import module namespace basic = 'http://zorba.io/modules/image/basic';                                                                                                                                                     import module namespace paint = 'http://zorba.io/modules/image/paint';                                                                                                                                                     
+import schema namespace image = 'http://zorba.io/modules/image/image';
 
 let $new-image := basic:create(xs:unsignedInt(200), xs:unsignedInt(100), "GIF")
 
 (: write a really important message to the image :)
 
-let $image-with-text := paint:paint($new-image, <image:text><image:origin><image:x>10</image:x><image:y>40</image:y></image:origin><image:text>Zorba really rocks!</image:text><image:font>Arial</image:font><image:font-size>12</image:font-size></image:text>)
+let $image-with-text := paint:paint($new-image, 
+{
+  "text" : {
+    "origin" : [ 10, 40 ],
+    "text" : "Zorba really rocks!",
+    "font" : "Arial",
+    "fontSize" : 12   
+  }
+})
 
 return not(empty($image-with-text)) 


References