mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-03 21:24:31 +03:00
commit
b9fb9449fb
|
@ -69,8 +69,8 @@ def bdf_char(f):
|
|||
bitmap.append(s[:-1])
|
||||
bitmap = b"".join(bitmap)
|
||||
|
||||
[x, y, l, d] = [int(s) for s in props["BBX"].split()]
|
||||
[dx, dy] = [int(s) for s in props["DWIDTH"].split()]
|
||||
[x, y, l, d] = [int(p) for p in props["BBX"].split()]
|
||||
[dx, dy] = [int(p) for p in props["DWIDTH"].split()]
|
||||
|
||||
bbox = (dx, dy), (l, -d-y, x+l, -d), (0, 0, x, y)
|
||||
|
||||
|
|
|
@ -19,8 +19,8 @@
|
|||
__version__ = "0.1"
|
||||
|
||||
|
||||
from PIL import Image, ImageFile, OleFileIO
|
||||
from PIL.OleFileIO import i8, i32, MAGIC
|
||||
from PIL import Image, ImageFile
|
||||
from PIL.OleFileIO import i8, i32, MAGIC, OleFileIO
|
||||
|
||||
|
||||
# we map from colour field tuples to (mode, rawmode) descriptors
|
||||
|
|
|
@ -1243,7 +1243,7 @@ class OleFileIO:
|
|||
debug( "Number of sectors in the file: %d" % self.nb_sect )
|
||||
|
||||
# file clsid (probably never used, so we don't store it)
|
||||
clsid = _clsid(header[8:24])
|
||||
#clsid = _clsid(header[8:24])
|
||||
self.sectorsize = self.SectorSize #1 << i16(header, 30)
|
||||
self.minisectorsize = self.MiniSectorSize #1 << i16(header, 32)
|
||||
self.minisectorcutoff = self.MiniSectorCutoff # i32(header, 56)
|
||||
|
@ -1561,7 +1561,7 @@ class OleFileIO:
|
|||
## break
|
||||
## self.direntries.append(_OleDirectoryEntry(entry, sid, self))
|
||||
# load root entry:
|
||||
root_entry = self._load_direntry(0)
|
||||
self._load_direntry(0)
|
||||
# Root entry is the first entry:
|
||||
self.root = self.direntries[0]
|
||||
# read and build all storage trees, starting from the root:
|
||||
|
@ -1786,7 +1786,7 @@ class OleFileIO:
|
|||
:returns: True if object exist, else False.
|
||||
"""
|
||||
try:
|
||||
sid = self._find(filename)
|
||||
self._find(filename)
|
||||
return True
|
||||
except:
|
||||
return False
|
||||
|
@ -1842,11 +1842,11 @@ class OleFileIO:
|
|||
try:
|
||||
# header
|
||||
s = fp.read(28)
|
||||
clsid = _clsid(s[8:24])
|
||||
#clsid = _clsid(s[8:24])
|
||||
|
||||
# format id
|
||||
s = fp.read(20)
|
||||
fmtid = _clsid(s[:16])
|
||||
#fmtid = _clsid(s[:16])
|
||||
fp.seek(i32(s, 16))
|
||||
|
||||
# get section
|
||||
|
@ -1983,8 +1983,6 @@ class OleFileIO:
|
|||
|
||||
if __name__ == "__main__":
|
||||
|
||||
import sys
|
||||
|
||||
# [PL] display quick usage info if launched from command-line
|
||||
if len(sys.argv) <= 1:
|
||||
print(__doc__)
|
||||
|
@ -2001,7 +1999,7 @@ Options:
|
|||
|
||||
check_streams = False
|
||||
for filename in sys.argv[1:]:
|
||||
## try:
|
||||
#try:
|
||||
# OPTIONS:
|
||||
if filename == '-d':
|
||||
# option to switch debug mode on:
|
||||
|
|
Loading…
Reference in New Issue
Block a user