From 98a8085d6ccf2a7296302922a30c59f8b87e66f6 Mon Sep 17 00:00:00 2001 From: hugovk Date: Tue, 12 May 2015 12:49:43 +0300 Subject: [PATCH] Header width/height may have multiple underscores: file_name_width --- PIL/XbmImagePlugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PIL/XbmImagePlugin.py b/PIL/XbmImagePlugin.py index 604ba15a8..454a95534 100644 --- a/PIL/XbmImagePlugin.py +++ b/PIL/XbmImagePlugin.py @@ -26,8 +26,8 @@ from PIL import Image, ImageFile # XBM header xbm_head = re.compile( - b"\s*#define[ \t]+[^_]*_width[ \t]+(?P[0-9]+)[\r\n]+" - b"#define[ \t]+[^_]*_height[ \t]+(?P[0-9]+)[\r\n]+" + b"\s*#define[ \t]+.*_width[ \t]+(?P[0-9]+)[\r\n]+" + b"#define[ \t]+.*_height[ \t]+(?P[0-9]+)[\r\n]+" b"(?P" b"#define[ \t]+[^_]*_x_hot[ \t]+(?P[0-9]+)[\r\n]+" b"#define[ \t]+[^_]*_y_hot[ \t]+(?P[0-9]+)[\r\n]+"