Permalink
Browse files

Merge branch 'branch-6-2'

  • Loading branch information...
2 parents b8f75e5 + 0a40805 commit 70d2510636a627c652372f76fc84218669384414 @tbonfort tbonfort committed Oct 9, 2012
Showing with 17 additions and 3 deletions.
  1. +13 −0 mapcairo.c
  2. +1 −1 mapscript/python/tests/cases/imagetest.py
  3. +1 −1 mapscript/python/tests/cases/threadtest.py
  4. +1 −1 msautotest
  5. +1 −0 tests/test.map
View
@@ -840,6 +840,18 @@ int saveImageCairo(imageObj *img, mapObj *map, FILE *fp, outputFormatObj *format
return MS_SUCCESS;
}
+unsigned char* saveImageBufferCairo(imageObj *img, int *size_ptr, outputFormatObj *format)
+{
+ cairo_renderer *r = CAIRO_RENDERER(img);
+ unsigned char *data;
+ assert(!strcasecmp(img->format->driver,"cairo/pdf") || !strcasecmp(img->format->driver,"cairo/svg"));
+ cairo_surface_finish (r->surface);
+ data = msSmallMalloc(r->outputStream->size);
+ memcpy(data,r->outputStream->data,r->outputStream->size);
+ *size_ptr = (int)r->outputStream->size;
+ return data;
+}
+
void *msCreateTileEllipseCairo(double width, double height, double angle,
colorObj *c, colorObj *bc, colorObj *oc, double ow)
{
@@ -1252,6 +1264,7 @@ inline int populateRendererVTableCairoVector( rendererVTableObj *renderer )
renderer->renderLineTiled = NULL;
renderer->createImage=&createImageCairo;
renderer->saveImage=&saveImageCairo;
+ renderer->saveImageBuffer = &saveImageBufferCairo;
renderer->getRasterBufferHandle=&getRasterBufferHandleCairo;
renderer->renderPolygon=&renderPolygonCairo;
renderer->renderGlyphs=&renderGlyphsCairo;
@@ -128,7 +128,7 @@ def testConstructorStringIO(self):
def testConstructorUrlStream(self):
"""imageObj with a URL stream works"""
- url = urllib.urlopen('http://mapserver.gis.umn.edu/logo.jpg')
+ url = urllib.urlopen('http://mapserver.org/_static/banner.png')
imgobj = mapscript.imageObj(url, 'GD/JPEG')
assert imgobj.thisown == 1
assert imgobj.height == 68
@@ -159,7 +159,7 @@ def draw_map_wms(name, save=0):
lo.setProjection('+init=epsg:4326')
lo.connectiontype = mapscript.MS_WMS
# lo.connection = 'http://wms.jpl.nasa.gov/wms.cgi?'
- lo.connection = 'http://labs.metacarta.com/wms/vmap0?'
+ lo.connection = 'http://vmap0.tiles.osgeo.org/wms/vmap0?'
lo.metadata.set('wms_service', 'WMS')
lo.metadata.set('wms_server_version', '1.1.1')
lo.metadata.set('wms_name', 'basic')
View
@@ -40,6 +40,7 @@ MAP
"key2" "value2"
"key3" "value3"
"key4" "value4"
+ "ows_enable_request" "*"
END
END

0 comments on commit 70d2510

Please sign in to comment.