Skip to content

Commit 2ae1ba5

Browse files
committed
Skip failing WMF records on 32-bit Windows
1 parent b4ba466 commit 2ae1ba5

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

Tests/test_file_wmf.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from __future__ import annotations
22

3-
import sys
43
from io import BytesIO
54
from pathlib import Path
65
from typing import IO
@@ -36,7 +35,6 @@ def test_load() -> None:
3635
assert im.load()[0, 0] == (255, 255, 255)
3736

3837

39-
@pytest.mark.skipif(sys.maxsize <= 2**32, reason="Requires 64-bit system")
4038
def test_render() -> None:
4139
with open("Tests/images/drawing.emf", "rb") as fp:
4240
data = fp.read()

src/display.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ PyImaging_EventLoopWin32(PyObject *self, PyObject *args) {
716716

717717
#define GET32(p, o) ((DWORD *)(p + o))[0]
718718

719-
int
719+
static int CALLBACK
720720
enhMetaFileProc(
721721
HDC hdc, HANDLETABLE *lpht, const ENHMETARECORD *lpmr, int nHandles, LPARAM data
722722
) {
@@ -804,14 +804,7 @@ PyImaging_DrawWmf(PyObject *self, PyObject *args) {
804804
/* FIXME: make background transparent? configurable? */
805805
FillRect(dc, &rect, GetStockObject(WHITE_BRUSH));
806806

807-
#ifdef _WIN64
808807
EnumEnhMetaFile(dc, meta, enhMetaFileProc, NULL, &rect);
809-
#else
810-
if (!PlayEnhMetaFile(dc, meta, &rect)) {
811-
PyErr_SetString(PyExc_OSError, "cannot render metafile");
812-
goto error;
813-
}
814-
#endif
815808

816809
/* step 4: extract bits from bitmap */
817810

0 commit comments

Comments
 (0)