'fix' PyQgsRulebasedRenderer test (followup 08185c9a)

This commit is contained in:
Juergen E. Fischer 2015-10-29 15:21:05 +01:00
parent 80d0272bcd
commit d9c8e73fa2
3 changed files with 89 additions and 84 deletions

5
scripts/generate_test_mask_image.py Normal file → Executable file
View File

@ -14,10 +14,12 @@ import struct
import urllib2
import glob
def error(msg):
print msg
sys.exit(1)
def colorDiff(c1, c2):
redDiff = abs(qRed(c1) - qRed(c2))
greenDiff = abs(qGreen(c1) - qGreen(c2))
@ -25,6 +27,7 @@ def colorDiff( c1, c2 ):
alphaDiff = abs(qAlpha(c1) - qAlpha(c2))
return max(redDiff, greenDiff, blueDiff, alphaDiff)
def imageFromPath(path):
if (path[:7] == 'http://' or path[:7] == 'file://'):
#fetch remote image
@ -35,6 +38,7 @@ def imageFromPath(path):
image = QImage(path)
return image
def getControlImagePath(path):
if os.path.isfile(path):
return path
@ -63,6 +67,7 @@ def getControlImagePath(path):
print 'Found matching control image: {}'.format(found_image)
return found_image
def updateMask(control_image_path, rendered_image_path, mask_image_path):
control_image = imageFromPath(control_image_path)
if not control_image:

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB