|
elif dxgi_format == DXGI_FORMAT_BC7_UNORM_SRGB: |
|
self.pixel_format = "BC7" |
|
self.im_info["gamma"] = 1 / 2.2 |
|
n = 7 |
At self.im_info["gamma"] = 1 / 2.2, self.im_info has never been initialized and so trying to set self.im_info["gamma"] fails with:
AttributeError: 'DdsImageFile' object has no attribute 'im_info'
As far as I can tell, this is the only place im_info is ever referenced in this or the ancestor classes.
A possible solution would be to change this section to:
elif dxgi_format == DXGI_FORMAT_BC7_UNORM_SRGB:
self.pixel_format = "BC7"
if not hasattr(self, 'im_info'):
self.im_info = {}
self.im_info["gamma"] = 1 / 2.2
n = 7
An alternate solution would be to initialize im_info earlier in the loader method.
Pillow/src/PIL/DdsImagePlugin.py
Lines 156 to 159 in 84fed4d
At
self.im_info["gamma"] = 1 / 2.2,self.im_infohas never been initialized and so trying to setself.im_info["gamma"]fails with:As far as I can tell, this is the only place
im_infois ever referenced in this or the ancestor classes.A possible solution would be to change this section to:
An alternate solution would be to initialize
im_infoearlier in the loader method.