Inkscape UI can pass invalid values to Datamatrix extension

Bug #738108 reported by Alex Valavanis
28
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Low
jazzynico
inkscape (Debian)
Fix Released
Unknown
inkscape (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: inkscape

This bug in Inkscape's handling of the Datamatrix extension was reported in Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=618835

* Go to Extensions->Render->Barcode - Datamatrix
* Select Rows = 19, Cols = 10, Square Size / px = 4
* Click "Apply"
>> The extension raises an error

The main problem here is that Inkscape uses spin-buttons in the extension dialog, which invite the user to scroll through any combination of row/col values. However, the extension itself only accepts a finite set of combinations... in other words, the user can very easily select an invalid input for the script. Combining this with "Live preview" leads to bad results!

It might be better (if a bit ugly) to have a drop-down list containing only the valid row/col combinations.

ProblemType: Crash
DistroRelease: Ubuntu 11.04
Package: inkscape 0.48.1-2ubuntu1
ProcVersionSignature: Ubuntu 2.6.38-7.35-generic 2.6.38
Uname: Linux 2.6.38-7-generic x86_64
NonfreeKernelModules: nvidia
Architecture: amd64
Date: Sat Mar 19 09:03:24 2011
EcryptfsInUse: Yes
ExecutablePath: /usr/share/inkscape/extensions/render_barcode_datamatrix.py
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release amd64 (20101007)
InterpreterPath: /usr/bin/python2.7
ProcCmdline: /usr/bin/python render_barcode_datamatrix.py --text=Inkscape --rows=19 --cols=10 --size=4 /tmp/ink_ext_XXXXXX.svgPFP0SV
ProcEnviron:
 LANGUAGE=en_GB:en
 PATH=(custom, user)
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
PythonArgs: ['render_barcode_datamatrix.py', '--text=Inkscape', '--rows=19', '--cols=10', '--size=4', '/tmp/ink_ext_XXXXXX.svgPFP0SV']
SourcePackage: inkscape
Title: render_barcode_datamatrix.py crashed with TypeError in encode(): 'NoneType' object is not iterable
UpgradeStatus: Upgraded to natty on 2011-02-27 (19 days ago)
UserGroups: adm admin cdrom dialout lpadmin plugdev sambashare

Related branches

Revision history for this message
Alex Valavanis (valavanisalex) wrote :
visibility: private → public
summary: - render_barcode_datamatrix.py crashed with TypeError in encode():
- 'NoneType' object is not iterable
+ Inkscape UI can pass invalid values to Datamatrix extension
Changed in inkscape (Ubuntu):
status: New → Triaged
importance: Undecided → Low
tags: added: extensions-plugins ui
removed: amd64 natty need-duplicate-check
Changed in inkscape (Debian):
status: Unknown → Confirmed
Revision history for this message
Alex Valavanis (valavanisalex) wrote :

Here is a list of the valid datamatrix dimensions accepted by the extension. The UI should be modified to only allow these values to be entered.

== Square symbols ==
10x10
12x12
14x14
16x16
18x18
20x20
22x22
24x24
26x26
32x32
36x36
40x40
44x44
48x48
52x52
64x64
72x72
80x80
88x88
96x96
104x104
120x120
132x132
144x144

== Rectangular symbols ==
8x18
8x32
12x26
12x36
16x36
16x48

Revision history for this message
jazzynico (jazzynico) wrote :

The attached version replaces the rows and cols entries with a list of valid dimensions.
Please test and comment.

Changed in inkscape:
assignee: nobody → JazzyNico (jazzynico)
importance: Undecided → Low
milestone: none → 0.49
status: New → In Progress
Revision history for this message
Alex Valavanis (valavanisalex) wrote :

Tested new version with inkscape_0.48.0-1ubuntu1.1. It works well for me. Thanks very much for sorting this out!

tags: added: patch
Revision history for this message
jazzynico (jazzynico) wrote :

Fix committed in the trunk, revision 10127.

Changed in inkscape:
status: In Progress → Fix Committed
tags: added: patch-accepted-upstream
removed: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package inkscape - 0.48.1-2.1ubuntu1

---------------
inkscape (0.48.1-2.1ubuntu1) oneiric; urgency=low

  * Merge from Debian Unstable (LP: #791728). Remaining changes:
    - debian/control:
      + Ubuntu maintainers
      + Promote python-lxml, python-numpy, python-uniconvertor to Recommends.
      + Demote pstoedit to Suggests (universe package).
      + Suggest transfig to allow import of xfig files (LP: #668300)
      + Drop unnecessary python and skencil suggestions (LP: #762541)
    - Handle translation tasks for Ubuntu main (LP: #726850):
      + debian/rules: Add dh_translations to binary-arch rule
      + debian/control: Build-Depends dh-translations
    - debian/patches/01_add_unity_quicklist_support.patch: add "New Drawing"
      to Unity quicklist (LP: #676886)
    - debian/patches/fix-fontforge-glyph-template.dpatch: Cherry-pick
      patch from uptream trunk to fix layer structure in template (LP: #565296)
    - debian/patches/02-add-shebangs-and-fix-permissions.dpatch: No longer mark
      JavaScript extension files as standalone executables (LP: #602005):
      + share/extensions/*.js: Revert addition of shebangs
      + share/extensions/Makefile.am: Install *.js using _DATA rule rather
        than _SCRIPTS rule to avoid giving executable permission
  * debian/patches/fix-datamatrix-ui.dpatch: Prevent invalid input in
    Datamatrix extension dialog (LP: #738108)
 -- Alex Valavanis <email address hidden> Thu, 02 Jun 2011 18:13:05 +0100

Changed in inkscape (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
su_v (suv-lp) wrote :

@JazzyNico - since this was already packported to the Ubuntu 0.48.1 package, what do you think about packporting it to the inkscape/0.48.x branch too, so that 0.48.2 will include the fix for other platforms as well?

Revision history for this message
jazzynico (jazzynico) wrote :

@~suv - I didn't backport it to the branch because it adds new strings that would be untranslated in 0.48.2.
IIRC it was decided that minor versions should not modify source strings so that we don't need to translate it and thus release it faster than with major versions.

Changed in inkscape (Debian):
status: Confirmed → Fix Released
jazzynico (jazzynico)
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.