update visual test images after agg rgba improvements

This commit is contained in:
Dane Springmeyer 2014-12-03 12:10:49 -05:00
parent 6fc8002dec
commit 27159b8086
28 changed files with 5 additions and 9 deletions

View file

@ -93,7 +93,7 @@ def test_compare_images():
if not validate_pixels_are_not_premultiplied(a): if not validate_pixels_are_not_premultiplied(a):
fails.append('%s not validly demultiplied' % (name)) fails.append('%s not validly demultiplied' % (name))
a.save(actual,'png32') a.save(actual,'png32')
if not os.path.exists(expected): if not os.path.exists(expected) or os.environ.get('UPDATE'):
print 'generating expected test image: %s' % expected print 'generating expected test image: %s' % expected
a.save(expected,'png32') a.save(expected,'png32')
expected_im = mapnik.Image.open(expected) expected_im = mapnik.Image.open(expected)
@ -167,7 +167,7 @@ if 'shape' in mapnik.DatasourceCache.plugin_names():
actual = '/tmp/mapnik-style-comp-op-' + name + '.png' actual = '/tmp/mapnik-style-comp-op-' + name + '.png'
expected = 'images/style-comp-op/' + name + '.png' expected = 'images/style-comp-op/' + name + '.png'
im.save(actual,'png32') im.save(actual,'png32')
if not os.path.exists(expected): if not os.path.exists(expected) or os.environ.get('UPDATE'):
print 'generating expected test image: %s' % expected print 'generating expected test image: %s' % expected
im.save(expected,'png32') im.save(expected,'png32')
expected_im = mapnik.Image.open(expected) expected_im = mapnik.Image.open(expected)
@ -197,13 +197,12 @@ def test_rounding_and_color_expectations():
m.background = mapnik.Color('rgba(255,255,255,.4999999)') m.background = mapnik.Color('rgba(255,255,255,.4999999)')
im = mapnik.Image(m.width,m.height) im = mapnik.Image(m.width,m.height)
mapnik.render(m,im) mapnik.render(m,im)
# ugh 252, see: https://github.com/mapnik/mapnik/issues/1519 eq_(get_unique_colors(im),['rgba(255,255,255,127)'])
eq_(get_unique_colors(im),['rgba(252,252,252,127)'])
m = mapnik.Map(1,1) m = mapnik.Map(1,1)
m.background = mapnik.Color('rgba(255,255,255,.5)') m.background = mapnik.Color('rgba(255,255,255,.5)')
im = mapnik.Image(m.width,m.height) im = mapnik.Image(m.width,m.height)
mapnik.render(m,im) mapnik.render(m,im)
eq_(get_unique_colors(im),['rgba(253,253,253,128)']) eq_(get_unique_colors(im),['rgba(255,255,255,128)'])
im_file = mapnik.Image.open('../data/images/stripes_pattern.png') im_file = mapnik.Image.open('../data/images/stripes_pattern.png')
eq_(get_unique_colors(im_file),['rgba(0,0,0,0)', 'rgba(74,74,74,255)']) eq_(get_unique_colors(im_file),['rgba(0,0,0,0)', 'rgba(74,74,74,255)'])
# should have no effect # should have no effect
@ -224,10 +223,7 @@ def test_background_image_and_background_color():
m.background_image = '../data/images/stripes_pattern.png' m.background_image = '../data/images/stripes_pattern.png'
im = mapnik.Image(m.width,m.height) im = mapnik.Image(m.width,m.height)
mapnik.render(m,im) mapnik.render(m,im)
# note: data loss due to rounding as per https://github.com/mapnik/mapnik/issues/1519 eq_(get_unique_colors(im),['rgba(255,255,255,128)', 'rgba(74,74,74,255)'])
# means that background will roundtrip to 253 not 255
#eq_(get_unique_colors(im),['rgba(255,255,255,128)', 'rgba(74,74,74,255)'])
eq_(get_unique_colors(im),['rgba(253,253,253,128)', 'rgba(74,74,74,255)'])
def test_background_image_with_alpha_and_background_color(): def test_background_image_with_alpha_and_background_color():
m = mapnik.Map(10,10) m = mapnik.Map(10,10)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB