mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
'fix' PyQgsRulebasedRenderer test (followup 08185c9a)
This commit is contained in:
parent
80d0272bcd
commit
d9c8e73fa2
5
scripts/generate_test_mask_image.py
Normal file → Executable file
5
scripts/generate_test_mask_image.py
Normal file → Executable 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 |
BIN
tests/testdata/control_images/expected_rulebased_else/expected_rulebased_else_mask.png
vendored
Normal file
BIN
tests/testdata/control_images/expected_rulebased_else/expected_rulebased_else_mask.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
Loading…
x
Reference in New Issue
Block a user