Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui.py throws a MemoryError when creating a topdown picture for specific maps #1

Open
RenolY2 opened this issue Feb 15, 2014 · 2 comments
Labels

Comments

@RenolY2
Copy link
Collaborator

RenolY2 commented Feb 15, 2014

In some cases it can happen that ui.py throws a MemoryError when opening some bigger maps and creating a topdown picture for them. This doesn't happen for everybody (e.g. I can open the Trolls'n Elves map just fine, but when SinZ does the same, a MemoryError is raised).

It doesn't appear to happen when running the topdown viewer on the map directly.

@SinZ163
Copy link
Owner

SinZ163 commented Feb 17, 2014

Loading war3map_troll.w3e

Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Python27\lib\lib-tk\Tkinter.py", line 1470, in __call__
    return self.func(*args)
  File "C:\Users\SinZ\Documents\GitHub\w3x-to-vmf\ui.py", line 95, in openFile
    self.topDownTab.setImage(topdownImage)
  File "C:\Users\SinZ\Documents\GitHub\w3x-to-vmf\ui.py", line 148, in setImage
    self.img = ImageTk.PhotoImage(img)
  File "C:\Python27\lib\site-packages\PIL\ImageTk.py", line 113, in __init__
    self.paste(image)
  File "C:\Python27\lib\site-packages\PIL\ImageTk.py", line 172, in paste
    block = image.new_block(self.__mode, im.size)
MemoryError

@SinZ163
Copy link
Owner

SinZ163 commented Feb 17, 2014

same for zoom in as it is for zoom out (on wc3map.w3e)

Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Python27\lib\lib-tk\Tkinter.py", line 1470, in __call__
    return self.func(*args)
  File "C:\Users\SinZ\Documents\GitHub\w3x-to-vmf\ui.py", line 160, in zoomIn
    self.img = ImageTk.PhotoImage(img)
  File "C:\Python27\lib\site-packages\PIL\ImageTk.py", line 110, in __init__
    self.__photo = tkinter.PhotoImage(**kw)
  File "C:\Python27\lib\lib-tk\Tkinter.py", line 3306, in __init__
    Image.__init__(self, 'photo', name, cnf, master, **kw)
  File "C:\Python27\lib\lib-tk\Tkinter.py", line 3262, in __init__
    self.tk.call(('image', 'create', imgtype, name,) + options)
TclError: not enough free memory for image buffer

Note, the computer isn't out of RAM, it is simply python not wanting to use more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants