Skip to content

Commit e16e334

Browse files
authored
Merge pull request #28 from nulano/emf_records
Skip failing WMF records on 32-bit Windows
2 parents 413cae5 + 2ea3ea9 commit e16e334

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
@@ -43,7 +42,6 @@ def test_load_zero_inch() -> None:
4342
pass
4443

4544

46-
@pytest.mark.skipif(sys.maxsize <= 2**32, reason="Requires 64-bit system")
4745
def test_render() -> None:
4846
with open("Tests/images/drawing.emf", "rb") as fp:
4947
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)