使用ImageCms.ImageCmsProfile加载文件时出现如下错误
1 | with open(profile_path, 'rb') as f: |
错误原因:读取文件时,返回的是一个bytes对象,而ImageCms.ImageCmsProfile需要一个文件路径或者一个BytesIO对象
解决方法:使用BytesIO对象
1 | with open(profile_path, 'rb') as f: |
使用ImageCms.ImageCmsProfile加载文件时出现如下错误
1 | with open(profile_path, 'rb') as f: |
错误原因:读取文件时,返回的是一个bytes对象,而ImageCms.ImageCmsProfile需要一个文件路径或者一个BytesIO对象
解决方法:使用BytesIO对象
1 | with open(profile_path, 'rb') as f: |