mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-27 01:34:24 +03:00
flake8
This commit is contained in:
parent
4c5a5c1f0e
commit
515bb6e14d
|
@ -21,7 +21,8 @@ __version__ = "0.3"
|
|||
|
||||
|
||||
from PIL import Image, ImageFile, _binary
|
||||
import os, tempfile
|
||||
import os
|
||||
import tempfile
|
||||
|
||||
i8 = _binary.i8
|
||||
i16 = _binary.i16be
|
||||
|
@ -35,17 +36,20 @@ COMPRESSION = {
|
|||
|
||||
PAD = o8(0) * 4
|
||||
|
||||
|
||||
#
|
||||
# Helpers
|
||||
|
||||
def i(c):
|
||||
return i32((PAD + c)[-4:])
|
||||
|
||||
|
||||
def dump(c):
|
||||
for i in c:
|
||||
print("%02x" % i8(i), end=' ')
|
||||
print()
|
||||
|
||||
|
||||
##
|
||||
# Image plugin for IPTC/NAA datastreams. To read IPTC/NAA fields
|
||||
# from TIFF and JPEG files, use the <b>getiptcinfo</b> function.
|
||||
|
@ -200,14 +204,17 @@ class IptcImageFile(ImageFile.ImageFile):
|
|||
im.load()
|
||||
self.im = im.im
|
||||
finally:
|
||||
try: os.unlink(outfile)
|
||||
except: pass
|
||||
try:
|
||||
os.unlink(outfile)
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
Image.register_open("IPTC", IptcImageFile)
|
||||
|
||||
Image.register_extension("IPTC", ".iim")
|
||||
|
||||
|
||||
##
|
||||
# Get IPTC information from TIFF, JPEG, or IPTC file.
|
||||
#
|
||||
|
|
Loading…
Reference in New Issue
Block a user