mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-06-30 09:53:39 +03:00
Flake8 fixes
This commit is contained in:
parent
9ba3799980
commit
a83bcec169
|
@ -132,7 +132,8 @@ class BmpImageFile(ImageFile.ImageFile):
|
||||||
SUPPORTED = {
|
SUPPORTED = {
|
||||||
32: [(0xff0000, 0xff00, 0xff, 0x0), (0xff0000, 0xff00, 0xff, 0xff000000), (0x0, 0x0, 0x0, 0x0)],
|
32: [(0xff0000, 0xff00, 0xff, 0x0), (0xff0000, 0xff00, 0xff, 0xff000000), (0x0, 0x0, 0x0, 0x0)],
|
||||||
24: [(0xff0000, 0xff00, 0xff)],
|
24: [(0xff0000, 0xff00, 0xff)],
|
||||||
16: [(0xf800, 0x7e0, 0x1f), (0x7c00, 0x3e0, 0x1f)]}
|
16: [(0xf800, 0x7e0, 0x1f), (0x7c00, 0x3e0, 0x1f)]
|
||||||
|
}
|
||||||
MASK_MODES = {
|
MASK_MODES = {
|
||||||
(32, (0xff0000, 0xff00, 0xff, 0x0)): "BGRX",
|
(32, (0xff0000, 0xff00, 0xff, 0x0)): "BGRX",
|
||||||
(32, (0xff0000, 0xff00, 0xff, 0xff000000)): "BGRA",
|
(32, (0xff0000, 0xff00, 0xff, 0xff000000)): "BGRA",
|
||||||
|
|
|
@ -434,7 +434,7 @@ def _getexif(self):
|
||||||
else:
|
else:
|
||||||
info = TiffImagePlugin.ImageFileDirectory_v1(head)
|
info = TiffImagePlugin.ImageFileDirectory_v1(head)
|
||||||
info.load(file)
|
info.load(file)
|
||||||
exif[0x8825] = dict([(k,v[0]) if len(v) == 1 else (k,v) for k,v in info.items()])
|
exif[0x8825] = dict([(k, v[0]) if len(v) == 1 else (k, v) for k, v in info.items()])
|
||||||
return exif
|
return exif
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -170,7 +170,7 @@ class TestFileLibTiff(LibTiffTestCase):
|
||||||
'RowsPerStrip',
|
'RowsPerStrip',
|
||||||
'StripOffsets']
|
'StripOffsets']
|
||||||
for field in requested_fields:
|
for field in requested_fields:
|
||||||
self.assertTrue(field in reloaded, "%s not in metadata" %field)
|
self.assertTrue(field in reloaded, "%s not in metadata" % field)
|
||||||
|
|
||||||
def test_g3_compression(self):
|
def test_g3_compression(self):
|
||||||
i = Image.open('Tests/images/hopper_g4_500.tif')
|
i = Image.open('Tests/images/hopper_g4_500.tif')
|
||||||
|
|
|
@ -17,11 +17,13 @@ class TestImageFontBitmap(PillowTestCase):
|
||||||
font='Tests/fonts/DejaVuSans.ttf', size=24)
|
font='Tests/fonts/DejaVuSans.ttf', size=24)
|
||||||
font_bitmap = ImageFont.truetype(
|
font_bitmap = ImageFont.truetype(
|
||||||
font='Tests/fonts/DejaVuSans-bitmap.ttf', size=24)
|
font='Tests/fonts/DejaVuSans-bitmap.ttf', size=24)
|
||||||
size_outline, size_bitmap = font_outline.getsize(text), font_bitmap.getsize(text)
|
size_outline = font_outline.getsize(text)
|
||||||
|
size_bitmap = font_bitmap.getsize(text)
|
||||||
size_final = max(size_outline[0], size_bitmap[0]), max(size_outline[1], size_bitmap[1])
|
size_final = max(size_outline[0], size_bitmap[0]), max(size_outline[1], size_bitmap[1])
|
||||||
im_bitmap = Image.new('RGB', size_final, (255, 255, 255))
|
im_bitmap = Image.new('RGB', size_final, (255, 255, 255))
|
||||||
im_outline = im_bitmap.copy()
|
im_outline = im_bitmap.copy()
|
||||||
draw_bitmap, draw_outline = ImageDraw.Draw(im_bitmap), ImageDraw.Draw(im_outline)
|
draw_bitmap = ImageDraw.Draw(im_bitmap)
|
||||||
|
draw_outline = ImageDraw.Draw(im_outline)
|
||||||
|
|
||||||
# Metrics are different on the bitmap and ttf fonts,
|
# Metrics are different on the bitmap and ttf fonts,
|
||||||
# more so on some platforms and versions of freetype than others.
|
# more so on some platforms and versions of freetype than others.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user