~ubuntu-branches/ubuntu/raring/python-imaging/raring-updates

« back to all changes in this revision

Viewing changes to PIL/PixarImagePlugin.py

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2013-01-31 20:49:20 UTC
  • mfrom: (27.1.1 raring-proposed)
  • Revision ID: package-import@ubuntu.com-20130131204920-b5zshy6vgfvdionl
Rewrite build dependencies to allow cross builds.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
__version__ = "0.1"
23
23
 
24
 
import Image, ImageFile
 
24
from . import Image, ImageFile, _binary
25
25
 
26
26
#
27
27
# helpers
28
28
 
29
 
def i16(c):
30
 
    return ord(c[0]) + (ord(c[1])<<8)
31
 
 
32
 
def i32(c):
33
 
    return ord(c[0]) + (ord(c[1])<<8) + (ord(c[2])<<16) + (ord(c[3])<<24)
 
29
i16 = _binary.i16le
 
30
i32 = _binary.i32le
34
31
 
35
32
##
36
33
# Image plugin for PIXAR raster images.
44
41
 
45
42
        # assuming a 4-byte magic label (FIXME: add "_accept" hook)
46
43
        s = self.fp.read(4)
47
 
        if s != "\200\350\000\000":
48
 
            raise SyntaxError, "not a PIXAR file"
 
44
        if s != b"\200\350\000\000":
 
45
            raise SyntaxError("not a PIXAR file")
49
46
 
50
47
        # read rest of header
51
48
        s = s + self.fp.read(508)