Package: wotsap
Version: 0.7-2
Severity: normal
Tags: patch

Hi,

currently, wotsap line 1723 (in Wheezy) or line 1724 (in version 0.7
released recently) saves the font size supplied via -S as a float:

  elif o in ("-S", "--ttfsize"):
    ttfsize = float(a)

However, core.getfont() in ImageFont.py (package python-imaging) would
prefer an integer and does not hesitate to complain:

Traceback (most recent call last):
  File "/usr/bin/wotsap", line 1903, in <module>
    wotsapmain(sys.argv)
  File "/usr/bin/wotsap", line 1852, in wotsapmain
    wot.initfont(fontfile, ttffile, ttfsize)
  File "/usr/bin/wotsap", line 1491, in initfont
    self.font = ImageFont.truetype(ttffile, ttffilesize)
  File "/usr/lib/python2.7/dist-packages/PIL/ImageFont.py", line 218, in 
truetype
    return FreeTypeFont(filename, size, index, encoding)
  File "/usr/lib/python2.7/dist-packages/PIL/ImageFont.py", line 134, in 
__init__
    self.font = core.getfont(file, size, index, encoding)
TypeError: integer argument expected, got float

The following ‘patch’ solves this problem:

--- wotsap      2013-03-03 14:12:34.615420677 +0000
+++ /usr/bin/wotsap     2013-03-03 14:12:42.565420729 +0000
@@ -1720,7 +1720,7 @@
         elif o in ("-T", "--ttffile"):
             ttffile = a
         elif o in ("-S", "--ttfsize"):
-            ttfsize = float(a)
+            ttfsize = int(a)
         elif o in ("-p", "--print"):
             prnt=1
         elif o in ("-D", "--print-debug"):

The affected variable, ttfsize, is used nowhere else in the file but
in the initfont() function mentioned above (and a few default
assignments to 16).

Best regards,

Claudius

-- System Information:
Debian Release: 7.0
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'stable-updates'), (500, 'unstable'), 
(500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.7.1.a2017.3 (SMP w/4 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages wotsap depends on:
ii  fonts-freefont-ttf [ttf-freefont]  20120503-1
ii  python                             2.7.3-4
ii  python-imaging                     1.1.7-4
ii  ttf-dejavu                         2.33-3
ii  ttf-freefont                       20120503-1

wotsap recommends no packages.

Versions of packages wotsap suggests:
ii  gnupg  1.4.12-7
ii  wget   1.13.4-3

-- no debconf information


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to