~ubuntu-branches/debian/squeeze/python-imaging/squeeze

« back to all changes in this revision

Viewing changes to PIL/WmfImagePlugin.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2009-11-20 19:22:59 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20091120192259-n3iy0f17n5akogom
Tags: 1.1.7-1
New upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#
2
2
# The Python Imaging Library
3
 
# $Id: WmfImagePlugin.py 2134 2004-10-06 08:55:20Z fredrik $
 
3
# $Id$
4
4
#
5
5
# WMF stub codec
6
6
#
30
30
    global _handler
31
31
    _handler = handler
32
32
 
 
33
if hasattr(Image.core, "drawwmf"):
 
34
    # install default handler (windows only)
 
35
 
 
36
    class WmfHandler:
 
37
 
 
38
        def open(self, im):
 
39
            im.mode = "RGB"
 
40
            self.bbox = im.info["wmf_bbox"]
 
41
 
 
42
        def load(self, im):
 
43
            im.fp.seek(0) # rewind
 
44
            return Image.fromstring(
 
45
                "RGB", im.size,
 
46
                Image.core.drawwmf(im.fp.read(), im.size, self.bbox),
 
47
                "raw", "BGR", (im.size[0]*3 + 3) & -4, -1
 
48
                )
 
49
 
 
50
    register_handler(WmfHandler())
 
51
 
33
52
# --------------------------------------------------------------------
34
53
 
35
54
def word(c, o=0):