0

I have tried to find a solution for converting a .WMF image file to .png, unfortunately I have not been able to render the .wmf file in pyhton (on a windows machine). Do anyone have a solution for this?

One of the simplest examples I have tried out is the following (Python 3.6):

from PIL import Image  
Image.open("test.wmf").save("test.png")

But gets the error:

File "C:\Python36\lib\site-packages\PIL\WmfImagePlugin.py", line 58, in load
    Image.core.drawwmf(im.fp.read(), im.size, self.bbox),
OSError: cannot render metafile

Thank you in advance

sichrisy
  • 11
  • 2
  • Are you sure the WMF is not corrupted? In the past, I have used the same method with WMFs and never had a problem. – Mario Camilleri Jun 18 '20 at 07:44
  • I can open the image with e.g. paint without any errors, so I believe the image format is correct. However it is generated on an old XP machine and now I want to convert these images to e.g. png. – sichrisy Jun 18 '20 at 09:16

1 Answers1

0

I am sorry for the "duplicate" of this issue. I resolved my problem by use of ImageMagick (did not resolve original question):

Solution from similar topic - https://stackoverflow.com/a/46058963/13767408

sichrisy
  • 11
  • 2