[Windows] PIL 1.1.7 does not support truetype fonts

Bug #540460 reported by Nadia Alramli
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Phatch
Confirmed
Critical
robinmills

Bug Description

When applying the polaroid library actionlist on one of the input images (png of gif) I got the following error:
I'm using PIL 1.1.7 on windows

Traceback (most recent call last):

  File "E:\phatch\phatch\core\api.py", line 650, in apply_action_to_photo

    photo = action.apply(photo, read_only_settings, cache)

  File "E:\phatch\phatch\core\models.py", line 106, in apply

    photo.get_layer().apply_pil(self.pil, **values)

  File "E:\phatch\phatch\core\pil.py", line 735, in apply_pil

    self.image = function(self.image, *arg, **keyw)

  File "E:\phatch\phatch\actions\text.py", line 46, in draw_text

    font = ImageFont.truetype(font, size)

  File "C:\Python26\lib\site-packages\PIL\ImageFont.py", line 218, in truetype

    return FreeTypeFont(filename, size, index, encoding)

  File "C:\Python26\lib\site-packages\PIL\ImageFont.py", line 134, in __init__

    self.font = core.getfont(file, size, index, encoding)

  File "C:\Python26\lib\site-packages\PIL\ImageFont.py", line 34, in __getattr__

    raise ImportError("The _imagingft C module is not installed")

ImportError: The _imagingft C module is not installed

Tags: windows
Revision history for this message
Stani (stani) wrote :

I can't reproduce this with PIL 1.1.7

Revision history for this message
Nadia Alramli (nadiana) wrote :

The text action in the acceptance test on windows (pil 1.1.7) is failing with the same error as well.

Revision history for this message
Stani (stani) wrote :

My mistake with Pil 1.1.6

Revision history for this message
Stani (stani) wrote :
summary: - [windows] polaroid error
+ [windows] PIL 1.1.7 does not support truetype fonts
Revision history for this message
Stani (stani) wrote :
Changed in phatch:
assignee: nobody → Nadia Alramli (nadiana)
importance: Undecided → Critical
status: New → Triaged
Revision history for this message
Stani (stani) wrote : Re: [windows] PIL 1.1.7 for Python 2.6 does not support truetype fonts

Strange, I can't reproduce this with PIL 1.1.7 for python 2.5 on Windows. Are you sure you uninstalled PIL 1.1.6 cleanly?

summary: - [windows] PIL 1.1.7 does not support truetype fonts
+ [windows] PIL 1.1.7 for Python 2.6 does not support truetype fonts
Revision history for this message
Stani (stani) wrote :

@Nadia
Please clear all your user settings and install the dependencies from http://photobatch.stani.be/download/package/phatch-dependencies-win32-py25.zip

and see if you still have this issue.

Changed in phatch:
status: Triaged → Incomplete
summary: - [windows] PIL 1.1.7 for Python 2.6 does not support truetype fonts
+ [windows] PIL 1.1.7 does not support truetype fonts
Stani (stani)
tags: added: windows
Stani (stani)
summary: - [windows] PIL 1.1.7 does not support truetype fonts
+ [Windows] PIL 1.1.7 does not support truetype fonts
Stani (stani)
Changed in phatch:
status: Incomplete → Confirmed
Revision history for this message
Stani (stani) wrote :

Hey Robin,
Can you look at it? The PIL1.1.7 build for py25 works fine, so there should be a bug in the py26 build.

This error does not happen on Windows 2000, but it happens on Windows 7.

Changed in phatch:
assignee: Nadia Alramli (nadiana) → robinmills (robinmills)
Revision history for this message
Andreas Bittel (andreas-bittel) wrote :

Hello all,

I have also a problem with "ImportError: The _imagingft C module is not installed". I installed python 2.6.4 and the corresponding
PIL-1.1.7.win32-py2.6.exe. My script is the following:

from PIL import Image, ImageDraw, ImageFont

im =Image.new("RGB",(400,400),(128,0,0))

draw = ImageDraw.Draw(im)
draw.line((0, 0) + im.size, fill=(128,128,128))
draw.line((0, im.size[1], im.size[0], 0), fill=128)

# use a bitmap font
font = ImageFont.truetype("arial.ttf",15)
#font =ImageFont.load("courB12.pil")

draw.text((10,20), "Test", font=font)
del draw

# write to stdout
im.save("c:\Test.bmp", "bmp")

Traceback (most recent call last):
  File "\\cdn-srv8\CDN_userbase$\andreas.bittel\Eigene Dateien\Downloads\Image_Test.py", line 11, in <module>
    font = ImageFont.truetype("arial.ttf",15)
  File "C:\Python26\lib\site-packages\PIL\ImageFont.py", line 218, in truetype
    return FreeTypeFont(filename, size, index, encoding)
  File "C:\Python26\lib\site-packages\PIL\ImageFont.py", line 134, in __init__
    self.font = core.getfont(file, size, index, encoding)
  File "C:\Python26\lib\site-packages\PIL\ImageFont.py", line 34, in __getattr__
    raise ImportError("The _imagingft C module is not installed")
ImportError: The _imagingft C module is not installed

What do I have to do to use the text output in an image?

Revision history for this message
Stani (stani) wrote :

@Andreas
Use Python 2.5 (this problem is only in the PIL 1.1.7 installer for python 2.6) or report the issue on the Image-sig mailing list:
http://mail.python.org/mailman/listinfo/image-sig

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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