Skip to content

Commit

Permalink
Better test and fix for #32
Browse files Browse the repository at this point in the history
  • Loading branch information
kylemacfarlane committed Feb 5, 2015
1 parent aee6f70 commit f8c8faa
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 13 deletions.
3 changes: 2 additions & 1 deletion src/z3c/rml/canvas.py
Expand Up @@ -343,7 +343,8 @@ class IImage(interfaces.IRMLDirectiveSignature):

mask = attr.Color(
title=u'Mask',
description=u'The color mask used to render the image.',
description=u'The color mask used to render the image, or "auto" to use the alpha channel if available.',
default='auto',
required=False,
acceptAuto=True)

Expand Down
6 changes: 4 additions & 2 deletions src/z3c/rml/flowable.py
Expand Up @@ -903,7 +903,8 @@ class IImage(interfaces.IRMLDirectiveSignature):

mask = attr.Color(
title=u'Mask',
description=u'The color mask used to render the image.',
description=u'The color mask used to render the image, or "auto" to use the alpha channel if available.',
default='auto',
required=False,
acceptAuto=True)

Expand Down Expand Up @@ -980,7 +981,8 @@ class IImageAndFlowables(interfaces.IRMLDirectiveSignature):

imageMask = attr.Color(
title=u'Mask',
description=u'The height the image.',
description=u'The color mask used to render the image, or "auto" to use the alpha channel if available.',
default='auto',
required=False,
acceptAuto=True)

Expand Down
Binary file modified src/z3c/rml/tests/expected/tag-image-mask.pdf
Binary file not shown.
21 changes: 14 additions & 7 deletions src/z3c/rml/tests/input/tag-image-mask.rml
@@ -1,13 +1,20 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE document SYSTEM "rml.dtd">

<document
filename="tag-image-svg.pdf"
xmlns:doc="http://namespaces.zope.org/rml/doc">
<pageDrawing>
<document filename="tag-image-mask.pdf">

<image file="[z3c.rml.tests]/input/images/cylinder.png"
x="10mm" y="10mm" mask="auto" />
<template>
<pageTemplate id="main">
<pageGraphics>
<image file="[z3c.rml.tests]/input/images/cylinder.png" x="10mm" y="10mm" mask="auto" />
<image file="[z3c.rml.tests]/input/images/cylinder.png" x="30mm" y="10mm" />
</pageGraphics>
<frame id="first" x1="72" y1="72" width="451" height="698"/>
</pageTemplate>
</template>

</pageDrawing>
<story>
<img src="[z3c.rml.tests]/input/images/cylinder.png" width="20mm" height="20mm" mask="auto" />
<img src="[z3c.rml.tests]/input/images/cylinder.png" width="20mm" height="20mm" />
</story>
</document>
3 changes: 0 additions & 3 deletions src/z3c/rml/tests/test_rml.py
Expand Up @@ -134,9 +134,6 @@ def test_suite():
if not filename.endswith(".rml"):
continue

if 'image-mask' not in filename:
continue

inPath = os.path.join(inputDir, filename)
outPath = os.path.join(outputDir, filename[:-4] + '.pdf')
expectPath = os.path.join(expectDir, filename[:-4] + '.pdf')
Expand Down

0 comments on commit f8c8faa

Please sign in to comment.