2 Jan 2003 06:02
numarray types and PIL modes, revisited
Edward C. Jones <edcjones <at> erols.com>
2003-01-02 05:02:18 GMT
2003-01-02 05:02:18 GMT
Perry Greenfield wrote: > Edward Jones writes: > > I write code using both PIL and numarray. PIL uses strings for > > modes and numarray uses (optionally) strings as typecodes. This > > causes problems. One fix is to emit a DeprecationWarning when > > string typecodes are used. Two functions are needed: > > StringTypeWarningOn and StringTypeWarningOff. The default > > should be to ignore this warning. > > I'm not sure I understand. Can you give me an example of problem > code or usage? It sounds like you are trying to test the types of > PIL and numarray objects in a generic sense. But I'd understand > better if you could show an example. That's what I was thinking (incorrectly). But I don't need to directly compare PIL modes with numarray types. My code never tries to deduce whether an array is a numarray or a PIL image from just the natype_or_mode. A module name (MODULE.NUMARRY, MODULE.PIL) must also be given. I do things this way because I might want to include other array/image systems. In an earlier version, I had a MODULE.IPL for the Intel Image Processing Library. The code also implements a policy of forbidding string types. So now all I can say is: 1. UInt8 == 'X' should not raise an exception. It should return False.(Continue reading)
RSS Feed