From 278441d1d7bd699bbbf8310a372a817eca1d7988 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotrek=20Szyma=C5=84ski?= Date: Thu, 5 Dec 2013 13:48:27 +0000 Subject: [PATCH] Open BMP with header size 108 bytes PIL doest not support http://msdn.microsoft.com/en-us/library/windows/desktop/dd183380%28v=vs.85%29.aspx This header is very similar to this one http://msdn.microsoft.com/en-us/library/windows/desktop/dd183376%28v=vs.85%29.aspx With given changes its possible to open and manipulate BMP file with header size of 108 bytes. --- PIL/BmpImagePlugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PIL/BmpImagePlugin.py b/PIL/BmpImagePlugin.py index a4eb1d3f2..0633a4cd3 100644 --- a/PIL/BmpImagePlugin.py +++ b/PIL/BmpImagePlugin.py @@ -82,7 +82,7 @@ class BmpImageFile(ImageFile.ImageFile): colors = 0 direction = -1 - elif len(s) in [40, 64]: + elif len(s) in [40, 64, 108]: # WIN 3.1 or OS/2 2.0 INFO bits = i16(s[14:])