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