Page 1 of 1

Error with ImageDraw.py in Indigo7

PostPosted: Fri Jul 28, 2017 6:23 am
by siclark
Hi,

I have finally got PILLOW and SUDS installed and the plugin is working and showing devices and creating the text files. However its generating an error on trying to create the png files.
This is the parameters used

/users/xxxxxx/documents/iTravel/WATWALtimetable.png
/users/xxxxxx/documents/iTravel/WATWALdepartureBoard.txt
/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/iTravel.indigoPlugin/Contents/Server Plugin/trainparameters.txt
YES

and the myImageErrors.txt file

Traceback (most recent call last):
File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/iTravel.indigoPlugin/Contents/Server Plugin/text2png.py", line 157, in <module>
draw.text((leftpadding, y), stationName, ticolour, font=titleFont)
File "/Library/Python/2.7/site-packages/PIL/ImageDraw.py", line 209, in text
*args, **kwargs)
File "/Library/Python/2.7/site-packages/PIL/ImageDraw.py", line 233, in multiline_text
line_width, line_height = self.textsize(line, font)
File "/Library/Python/2.7/site-packages/PIL/ImageDraw.py", line 260, in textsize
return font.getsize(text, direction, features)
File "/Library/Python/2.7/site-packages/PIL/ImageFont.py", line 156, in getsize
size, offset = self.font.getsize(text, direction, features)
SystemError: error return without exception set

I'm wondering whether PILLOW under 2.7 takes different arguments to under 2.6?

Re: Error with ImageDraw.py in Indigo7

PostPosted: Thu Sep 28, 2017 12:53 am
by siclark
Finally solved this after having started on a python self learning course and realised how to read and load python code. The issue was on 2 lines in the text2png.py code, one being line 157 below that define the font to pass to ImageDraw.py and despite the path being correct and the font folder existing there it seems to cause an error. So I deleted the font=titleFont from at line and subsequent line (164 I think) and then it ran.

Would be good to confirm where the font folder should be, or if there needs to be a change made to support Indigo 7 or python 2.7 but I can't see what that is.

Now to start working out how to help me avoid cancelled trains this winter!!