New (minor) release of Mamba 2

31 views
Skip to first unread message

Serge Beucher

unread,
May 6, 2016, 4:02:10 AM5/6/16
to Mamba Image
Hi,

A new and minor release of Mamba is available (Mamba 2.0.1). It aims at correcting a bug in TkInter (not in Mamba) with the askcolor function which returns float values instead of integer ones (error in the Python division). This bug made Mamba crash when using the superpose display function if you tried to change the display colors.

The Windows installers of this new release are also available from the Mamba Web page.

Sincerely,

Serge Beucher


ma...@simonhaenisch.com

unread,
Sep 20, 2016, 5:31:52 AM9/20/16
to Mamba Image
Hi, I still have this problem with your 2.0.1 release, below is the Traceback.

I use Python 3.5 64 bit on Windows, the version string is:
Python 3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015, 01:54:25) [MSC v.1900 64 bit (AMD64)] on win32

I built mamba-image from the github source with the VS 14 2015 Win64 compiler without errors. It is the compiler used to build Python 3.5 (see https://wiki.python.org/moin/WindowsCompilers). The resulting Mamba Image-2.0.1.win-amd64-py3.5.exe installs without any problems.


Traceback (most recent call last):
File "<pyshell#4>", line 1, in <module>
img.show()
File "C:\Program Files\Python35\lib\site-packages\mamba\base.py", line 337, in show
self.gd.showWindow(self.displayId, **options)
File "C:\Program Files\Python35\lib\site-packages\mambaDisplay\dftDisplayer.py", line 72, in showWindow
self.windows[wKey].show(**options)
File "C:\Program Files\Python35\lib\site-packages\mambaDisplay\display2D.py", line 461, in show
self.updateim()
File "C:\Program Files\Python35\lib\site-packages\mambaDisplay\display2D.py", line 424, in updateim
self.drawImage()
File "C:\Program Files\Python35\lib\site-packages\mambaDisplay\display2D.py", line 380, in drawImage
self.tkpi = ImageTk.PhotoImage(self.pilImage.resize(self.dsize, Image.NEAREST))
File "C:\Program Files\Python35\lib\site-packages\PIL\Image.py", line 1550, in resize
return self._new(self.im.resize(size, resample))
TypeError: integer argument expected, got float
>>> Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Program Files\Python35\lib\idlelib\run.py", line 119, in main
seq, request = rpc.request_queue.get(block=True, timeout=0.05)
File "C:\Program Files\Python35\lib\queue.py", line 172, in get
raise Empty
queue.Empty

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Program Files\Python35\lib\tkinter\__init__.py", line 1549, in __call__
return self.func(*args)
File "C:\Program Files\Python35\lib\site-packages\mambaDisplay\display2D.py", line 161, in resizeEvent
self.drawImage()
File "C:\Program Files\Python35\lib\site-packages\mambaDisplay\display2D.py", line 380, in drawImage
self.tkpi = ImageTk.PhotoImage(self.pilImage.resize(self.dsize, Image.NEAREST))
File "C:\Program Files\Python35\lib\site-packages\PIL\Image.py", line 1550, in resize
return self._new(self.im.resize(size, resample))
TypeError: integer argument expected, got float
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Program Files\Python35\lib\idlelib\run.py", line 119, in main
seq, request = rpc.request_queue.get(block=True, timeout=0.05)
File "C:\Program Files\Python35\lib\queue.py", line 172, in get
raise Empty
queue.Empty

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Program Files\Python35\lib\tkinter\__init__.py", line 1549, in __call__
return self.func(*args)
File "C:\Program Files\Python35\lib\site-packages\mambaDisplay\display2D.py", line 156, in focusEvent
self.updateim()
File "C:\Program Files\Python35\lib\site-packages\mambaDisplay\display2D.py", line 424, in updateim
self.drawImage()
File "C:\Program Files\Python35\lib\site-packages\mambaDisplay\display2D.py", line 380, in drawImage
self.tkpi = ImageTk.PhotoImage(self.pilImage.resize(self.dsize, Image.NEAREST))
File "C:\Program Files\Python35\lib\site-packages\PIL\Image.py", line 1550, in resize
return self._new(self.im.resize(size, resample))
TypeError: integer argument expected, got float


---

Nicolas Beucher

unread,
Sep 24, 2016, 10:12:02 AM9/24/16
to Mamba Image
Hi,

After reviewing the code it seems there are still some divisions not upgraded to the python 3 format (/ instead of // which produce float where integer are expected). It is likely this is what provoke your problem. Lines 277, 278 and 279 in file display2D.py are certainly the culprit.

Tell us if that correct your problem.

Nicolas.

Serge Beucher

unread,
Sep 24, 2016, 1:40:57 PM9/24/16
to mamba...@googlegroups.com
Hi,

Just a precision: do not change the division for the zoom variable (line 279) which is a float. Other problems are likely to occur for other functions. We are checking this integer division issue and will post corrections in the github source as soon as possible.

SB



--
You received this message because you are subscribed to the Google Groups "Mamba Image" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mamba-image+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages