PIL中分离通道发生“AttributeError: 'NoneType' object has no attribute 'bands'”
2015-11-05 10:30
585 查看
解决方法: 把Image.py中的1500行左右的split函数改成如下即可:
[/code]
def split(self): "Split image into bands" self.load() //增加这一行 if self.im.bands == 1: ims = [self.copy()] else: ims = [] #self.load() //注释这一行 for i in range(self.im.bands): ims.append(self._new(self.im.getband(i))) return tuple(ims)
[/code]
相关文章推荐
- ThreadPool.RegisterWaitForSingleObject
- Error: ORA-16698: LOG_ARCHIVE_DEST_n parameter set for object to be added
- OC基础知识 -- 属性
- 解决a different object with the same identifier value was already associated with the session错误
- OC基础知识 -- Block
- OC基础知识 -- 常见类的一些方法
- NULL Nil nil NSNULL 关系与区别
- 关于EnumerateObjectsUsingBlock和for-in之间的较量
- org.hibernate.TransientObjectException
- 对于AttributeError: ‘module’ object has no attribute ‘AF_INET
- objective-c 关于 self 的用法总结
- OC基础知识 -- 基本行为方法
- Objective-C 理解之方括号[ ]的使用
- QAxWidget (QAxObject)调用com组件
- READING NOTE: Learning to Segment Moving Objects in Videos
- OC基础知识 -- 类和对象
- 浅谈 Swift 2 中的 Objective-C 指针
- A PAPER LIST FOR OBJECT DETECTION IN VIDEOS
- [Object C]_[初级]_[文件修改创建时间和修改时间]
- IOS开发基础Object-C(07)—OC内存管理(1)-retain和release