trunk: ink2canvas for stroked objects fails with "AttributeError: 'module' object has no attribute 'unittouu'"

Bug #1258473 reported by su_v on 2013-12-06
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Alvin Penner

Bug Description

Steps to reproduce:
1) launch current trunk (default (new) prefs, default not-localized template)
2) draw a rectangle
3) change stroke width to any value ≠ 1 px
4) save a copy as 'HTML 5 canvas (*.html)'

Saving fails with this error message:

Traceback (most recent call last):
  File "", line 89, in <module>
  File "/custom/prefix/share/inkscape/extensions/", line 245, in affect
  File "", line 84, in effect
  File "", line 75, in walk_tree
  File "", line 74, in walk_tree
  File "/custom/prefix/share/inkscape/extensions/ink2canvas/", line 134, in draw
  File "/custom/prefix/share/inkscape/extensions/ink2canvas/", line 86, in set_style
    getattr(self.ctx, method)(style[key])
  File "/custom/prefix/share/inkscape/extensions/ink2canvas/", line 120, in setStrokeWidth
    self.write("ctx.lineWidth = %f;" % inkex.unittouu(value))
AttributeError: 'module' object has no attribute 'unittouu'

Simply changing 'inkex.unittouu' to 'self.unittouu' does not work in this case.

AFAIU this regression is related to the changes in revision 12722:

Backtrace produced with r12839 on OS X 10.7.5.

su_v (suv-lp) on 2013-12-06
description: updated
tags: added: units
su_v (suv-lp) on 2013-12-06
description: updated
jazzynico (jazzynico) wrote :

Reproduced on Crunchbang Waldorf, Inkscape trunk revision 12840.

Changed in inkscape:
importance: Undecided → Medium
status: New → Triaged
Alvin Penner (apenner) wrote :

I believe the crash is fixed with the following two updated files :

Alvin Penner (apenner) wrote :

and the subdirectory file : ink2canvas/

however, I am not familiar enough with html to know whether the resulting scaling behaviour is the intended behaviour or not, so I am just posting it here for comment...

Alvin Penner (apenner) wrote :

committed to rev 13027

Changed in inkscape:
status: Triaged → Fix Committed
su_v (suv-lp) on 2014-02-13
Changed in inkscape:
assignee: nobody → Alvin Penner (apenner)
Bryce Harrington (bryce) on 2015-02-23
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers