Bug#618835: inkscape: Barcode - Datamatrix dialog gives errors with live preview and bad row/col count

2011-03-19 Thread Alex Valavanis
tags 618835 + confirmed
forwarded 618835 https://bugs.launchpad.net/inkscape/+bug/738108
thanks

Confirmed in inkscape_0.48.1ubuntu2.  Looking at the extension script,
only a finite set of row/col combinations are valid.  It's not a good
idea for Inkscape to use spin buttons  live preview!


On 18 March 2011 19:56, Daniel Kahn Gillmor d...@fifthhorseman.net wrote:
 Package: inkscape
 Version: 0.48.1-2
 Severity: normal

 I just tried Extensions  Render  Barcode - Datamatrix

 I checked Live preview and clicked the spin buttons for Rows to
 see the images grow.

 When i hit Rows == 19, a new dialog box popped up, with this
 message:

   Inkscape has received additional data from the script executed.
   The script did not return an error, but this may indicate the
   results will not be as expected.
    -

 Unrecognised DataMatrix size
 Traceback (most recent call last):
  File render_barcode_datamatrix.py, line 652, in module
    e.affect()
  File /usr/share/inkscape/extensions/inkex.py, line 215, in affect
    self.effect()
  File render_barcode_datamatrix.py, line 647, in effect
    encoded = encode( so.TEXT, (so.ROWS, so.COLS) ) #get the pattern of squares
  File render_barcode_datamatrix.py, line 68, in encode
    data_nrow, data_ncol, reg_row, reg_col, nd, nc, inter = get_parameters( 
 nrow, ncol )
 TypeError: 'NoneType' object is not iterable

    --


 It seems to me that the spin buttons shouldn't allow the user to
 choose bad values (e.g. enforce a range), but i don't know enough
 about datamatrix to know if that's acceptable or not in a 2-D
 constraint.  For example, maybe 200x200 is OK, but 200x10 is not.  if
 that was the case, then starting with 10x10, you'd have no way to get
 to 200x200.

 So maybe the right fix is for the live preview to simply disable
 itself when the dimensions are unacceptable, with an in-window display
 of why it's not working.

       --dkg


 -- System Information:
 Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (500, 'testing'), (200, 'unstable'), (1, 'experimental')
 Architecture: i386 (i686)

 Kernel: Linux 2.6.37-2-686 (SMP w/1 CPU core)
 Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
 Shell: /bin/sh linked to /bin/bash

 Versions of packages inkscape depends on:
 ii  libaspell15            0.60.6-6          GNU Aspell spell-checker runtime 
 l
 ii  libatk1.0-0            1.30.0-1          The ATK accessibility toolkit
 ii  libc6                  2.11.2-11         Embedded GNU C Library: Shared 
 lib
 ii  libcairo2              1.10.2-4          The Cairo 2D vector graphics 
 libra
 ii  libcairomm-1.0-1       1.8.4-3           C++ wrappers for Cairo (shared 
 lib
 ii  libfontconfig1         2.8.0-2.1         generic font configuration 
 library
 ii  libfreetype6           2.4.4-1           FreeType 2 font engine, shared 
 lib
 ii  libgc1c2               1:7.1-7           conservative garbage collector 
 for
 ii  libgcc1                1:4.5.2-4         GCC support library
 ii  libgconf2-4            2.28.1-6          GNOME configuration database 
 syste
 ii  libglib2.0-0           2.28.1-1+b1       The GLib library of C routines
 ii  libglibmm-2.4-1c2a     2.24.2-1          C++ wrapper for the GLib toolkit 
 (
 ii  libgnomevfs2-0         1:2.24.3-2        GNOME Virtual File System 
 (runtime
 ii  libgomp1               4.5.2-4           GCC OpenMP (GOMP) support library
 ii  libgsl0ldbl            1.14+dfsg-1       GNU Scientific Library (GSL) -- 
 li
 ii  libgtk2.0-0            2.20.1-2          The GTK+ graphical user interface
 ii  libgtkmm-2.4-1c2a      1:2.20.3-1        C++ wrappers for GTK+ (shared 
 libr
 ii  libgtkspell0           2.0.16-1          a spell-checking addon for GTK's 
 T
 ii  liblcms1               1.18.dfsg-1.2+b3  Color management library
 ii  libmagick++3           8:6.6.0.4-3       object-oriented C++ interface to 
 I
 ii  libmagickcore3         8:6.6.0.4-3       low-level image manipulation 
 libra
 ii  libpango1.0-0          1.28.3-1+squeeze1 Layout and rendering of 
 internatio
 ii  libpangomm-1.4-1       2.26.2-1          C++ Wrapper for pango (shared 
 libr
 ii  libpng12-0             1.2.44-1          PNG library - runtime
 ii  libpoppler-glib4       0.12.4-1.2        PDF rendering library (GLib-based
 ii  libpoppler5            0.12.4-1.2        PDF rendering library
 ii  libpopt0               1.16-1            lib for parsing cmdline 
 parameters
 ii  libsigc++-2.0-0c2a     2.2.4.2-1         type-safe Signal Framework for 
 C++
 ii  libstdc++6             4.5.2-4           The GNU Standard C++ Library v3
 ii  libwpd-0.9-9           0.9.1-2           Library for handling WordPerfect 
 d
 ii  libwpg-0.2-2           0.2.0-4           WordPerfect graphics 
 import/conver
 ii  libx11-6               2:1.4.1-5         X11 client-side library
 ii  libxml2                2.7.8.dfsg-2      GNOME XML library
 ii  libxslt1.1             1.1.26-6          XSLT 1.0 processing 

Bug#618835: inkscape: Barcode - Datamatrix dialog gives errors with live preview and bad row/col count

2011-03-18 Thread Daniel Kahn Gillmor
Package: inkscape
Version: 0.48.1-2
Severity: normal

I just tried Extensions  Render  Barcode - Datamatrix

I checked Live preview and clicked the spin buttons for Rows to
see the images grow.

When i hit Rows == 19, a new dialog box popped up, with this
message:

   Inkscape has received additional data from the script executed.
   The script did not return an error, but this may indicate the
   results will not be as expected.
-

Unrecognised DataMatrix size
Traceback (most recent call last):
  File render_barcode_datamatrix.py, line 652, in module
e.affect()
  File /usr/share/inkscape/extensions/inkex.py, line 215, in affect
self.effect()
  File render_barcode_datamatrix.py, line 647, in effect
encoded = encode( so.TEXT, (so.ROWS, so.COLS) ) #get the pattern of squares
  File render_barcode_datamatrix.py, line 68, in encode
data_nrow, data_ncol, reg_row, reg_col, nd, nc, inter = get_parameters( 
nrow, ncol )
TypeError: 'NoneType' object is not iterable

--


It seems to me that the spin buttons shouldn't allow the user to
choose bad values (e.g. enforce a range), but i don't know enough
about datamatrix to know if that's acceptable or not in a 2-D
constraint.  For example, maybe 200x200 is OK, but 200x10 is not.  if
that was the case, then starting with 10x10, you'd have no way to get
to 200x200.

So maybe the right fix is for the live preview to simply disable
itself when the dimensions are unacceptable, with an in-window display
of why it's not working.

   --dkg


-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (500, 'testing'), (200, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.37-2-686 (SMP w/1 CPU core)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages inkscape depends on:
ii  libaspell150.60.6-6  GNU Aspell spell-checker runtime l
ii  libatk1.0-01.30.0-1  The ATK accessibility toolkit
ii  libc6  2.11.2-11 Embedded GNU C Library: Shared lib
ii  libcairo2  1.10.2-4  The Cairo 2D vector graphics libra
ii  libcairomm-1.0-1   1.8.4-3   C++ wrappers for Cairo (shared lib
ii  libfontconfig1 2.8.0-2.1 generic font configuration library
ii  libfreetype6   2.4.4-1   FreeType 2 font engine, shared lib
ii  libgc1c2   1:7.1-7   conservative garbage collector for
ii  libgcc11:4.5.2-4 GCC support library
ii  libgconf2-42.28.1-6  GNOME configuration database syste
ii  libglib2.0-0   2.28.1-1+b1   The GLib library of C routines
ii  libglibmm-2.4-1c2a 2.24.2-1  C++ wrapper for the GLib toolkit (
ii  libgnomevfs2-0 1:2.24.3-2GNOME Virtual File System (runtime
ii  libgomp1   4.5.2-4   GCC OpenMP (GOMP) support library
ii  libgsl0ldbl1.14+dfsg-1   GNU Scientific Library (GSL) -- li
ii  libgtk2.0-02.20.1-2  The GTK+ graphical user interface 
ii  libgtkmm-2.4-1c2a  1:2.20.3-1C++ wrappers for GTK+ (shared libr
ii  libgtkspell0   2.0.16-1  a spell-checking addon for GTK's T
ii  liblcms1   1.18.dfsg-1.2+b3  Color management library
ii  libmagick++3   8:6.6.0.4-3   object-oriented C++ interface to I
ii  libmagickcore3 8:6.6.0.4-3   low-level image manipulation libra
ii  libpango1.0-0  1.28.3-1+squeeze1 Layout and rendering of internatio
ii  libpangomm-1.4-1   2.26.2-1  C++ Wrapper for pango (shared libr
ii  libpng12-0 1.2.44-1  PNG library - runtime
ii  libpoppler-glib4   0.12.4-1.2PDF rendering library (GLib-based 
ii  libpoppler50.12.4-1.2PDF rendering library
ii  libpopt0   1.16-1lib for parsing cmdline parameters
ii  libsigc++-2.0-0c2a 2.2.4.2-1 type-safe Signal Framework for C++
ii  libstdc++6 4.5.2-4   The GNU Standard C++ Library v3
ii  libwpd-0.9-9   0.9.1-2   Library for handling WordPerfect d
ii  libwpg-0.2-2   0.2.0-4   WordPerfect graphics import/conver
ii  libx11-6   2:1.4.1-5 X11 client-side library
ii  libxml22.7.8.dfsg-2  GNOME XML library
ii  libxslt1.1 1.1.26-6  XSLT 1.0 processing library - runt
ii  zlib1g 1:1.2.3.4.dfsg-3  compression library - runtime

Versions of packages inkscape recommends:
ii  aspell0.60.6-6   GNU Aspell spell-checker
ii  imagemagick   8:6.6.0.4-3image manipulation programs
ii  libwmf-bin0.2.8.4-6.1+b1 Windows metafile conversion tools
ii  perlmagick8:6.6.0.4-3Perl interface to the ImageMagick 
ii  pstoedit  3.50-3+b1