Permalink
Browse files

add test for #997- closes #997

  • Loading branch information...
Dane Springmeyer
Dane Springmeyer committed Jul 25, 2012
1 parent cc8f86e commit b298e21f8e49b82accd0be63dadf4e5f01e0894d
@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE Map[]>
-<Map srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over" background-color="transparent">
+<Map srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over" background-color="blue">
-<Style name="white" filter-mode="first">
+<Style name="transp">
<Rule>
<RasterSymbolizer opacity="1" scaling="bilinear" />
</Rule>
</Style>
-<Layer name="white"
+<Layer name="transp"
srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over">
- <StyleName>white</StyleName>
+ <StyleName>transp</StyleName>
<Datasource>
<Parameter name="file">../raster/transp.tiff</Parameter>
<Parameter name="type">gdal</Parameter>
@@ -2,7 +2,7 @@
<!DOCTYPE Map[]>
<Map srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over" background-color="red">
-<Style name="white" filter-mode="first">
+<Style name="white">
<Rule>
<RasterSymbolizer opacity="1" scaling="bilinear" />
</Rule>
Binary file not shown.
@@ -23,6 +23,18 @@ def test_map_alpha_compare():
expected_im = mapnik.Image.open(expected)
eq_(im.tostring(),expected_im.tostring(), 'failed comparing actual (%s) and expected(%s)' % (actual,'tests/python_tests/'+ expected))
+def test_map_alpha_gradient_compare():
+ m = mapnik.Map(600,400)
+ mapnik.load_map(m,'../data/good_maps/raster-alpha-gradient.xml')
+ m.zoom_all()
+ actual = '/tmp/mapnik-raster-alpha-gradient.png'
+ expected = 'images/support/raster-alpha-gradient.png'
+ im = mapnik.Image(m.width,m.height)
+ mapnik.render(m,im)
+ im.save(actual)
+ expected_im = mapnik.Image.open(expected)
+ eq_(im.tostring(),expected_im.tostring(), 'failed comparing actual (%s) and expected(%s)' % (actual,'tests/python_tests/'+ expected))
+
if __name__ == "__main__":
setup()

0 comments on commit b298e21

Please sign in to comment.