[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openslide-users
Subject:    Re: Problem with OpenSlide Python
From:       Benjamin Gilbert <bgilbert () cs ! cmu ! edu>
Date:       2017-11-07 20:14:03
Message-ID: 20171107201402.GA17569 () hyliota ! hl ! backtick ! net
[Download RAW message or body]

On Mon, Nov 06, 2017 at 12:08:04PM +0000, Francesco Daneluzzi wrote:
> File "C:\Users\Francesco\Anaconda3\envs\py35\lib\site-packages\openslide\lowlevel.py", \
> line 260, in read_region buf = (w * h * float(c_uint32))()
> TypeError: float() argument must be a string or a number, not \
> '_ctypes.PyCSimpleType' 
> The fact is that, in the last row, w and h are float (I printed them for
> debugging), but c_uint32 is not and I am getting that error.  What should
> I do about it?

Hi Francesco,

Are you using a modified version of OpenSlide Python?  Upstream OpenSlide
Python 1.1.1 doesn't have that float conversion:

    https://github.com/openslide/openslide-python/blob/v1.1.1/openslide/lowlevel.py#L258


Note that w and h must be int, not float.

--Benjamin Gilbert
_______________________________________________
openslide-users mailing list
openslide-users@lists.andrew.cmu.edu
https://lists.andrew.cmu.edu/mailman/listinfo/openslide-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic