~ubuntu-branches/ubuntu/wily/python-imaging/wily

« back to all changes in this revision

Viewing changes to PIL/PcdImagePlugin.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
Tags: 1.1.7+1.7.8-1ubuntu1
Rewrite build dependencies to allow cross builds.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
__version__ = "0.1"
19
19
 
20
20
 
21
 
import Image, ImageFile
 
21
from . import Image, ImageFile, _binary
 
22
 
 
23
i8 = _binary.i8
22
24
 
23
25
##
24
26
# Image plugin for PhotoCD images.  This plugin only reads the 768x512
36
38
        self.fp.seek(2048)
37
39
        s = self.fp.read(2048)
38
40
 
39
 
        if s[:4] != "PCD_":
40
 
            raise SyntaxError, "not a PCD file"
 
41
        if s[:4] != b"PCD_":
 
42
            raise SyntaxError("not a PCD file")
41
43
 
42
 
        orientation = ord(s[1538]) & 3
 
44
        orientation = i8(s[1538]) & 3
43
45
        if orientation == 1:
44
46
            self.tile_post_rotate = 90 # hack
45
47
        elif orientation == 3: