Skip to content

Commit

Permalink
update tests images after change made to agg src_over in #1452, refs #…
Browse files Browse the repository at this point in the history
  • Loading branch information
Dane Springmeyer committed Sep 1, 2012
1 parent bc3c7b4 commit 6450d33
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/data/good_maps/style_level_opacity_and_blur.xml
@@ -0,0 +1,24 @@
<Map background-color="#fcc" srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over">
<!-- Asia -->
<Style name="style" image-filters="agg-stack-blur(4,4)">
<Rule>
<Filter>([REGION]=142)</Filter>
<PolygonSymbolizer fill="yellow"/>
</Rule>
</Style>
<!-- Not Asia -->
<Style name="style2" opacity=".5">
<Rule>
<Filter>([REGION]!=142)</Filter>
<PolygonSymbolizer fill="#fff"/>
</Rule>
</Style>
<Layer name="world" srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over">
<StyleName>style</StyleName>
<StyleName>style2</StyleName>
<Datasource>
<Parameter name="file">../shp/world_merc</Parameter>
<Parameter name="type">shape</Parameter>
</Datasource>
</Layer>
</Map>
11 changes: 11 additions & 0 deletions tests/python_tests/compositing_test.py
Expand Up @@ -145,6 +145,17 @@ def test_pre_multiply_status_of_map2():
mapnik.render(m,im)
eq_(validate_pixels_are_not_premultiplied(im),True)

def test_style_level_opacity():
m = mapnik.Map(512,512)
mapnik.load_map(m,'../data/good_maps/style_level_opacity_and_blur.xml')
m.zoom_all()
im = mapnik.Image(512,512)
mapnik.render(m,im)
actual = '/tmp/mapnik-style-level-opacity.png'
expected = 'images/support/mapnik-style-level-opacity.png'
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()
Expand Down
Binary file modified tests/python_tests/images/composited/src_over.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6450d33

Please sign in to comment.