mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-29 19:36:19 +03:00
Corrected error messages
This commit is contained in:
parent
78756cd17b
commit
cadac4aad2
|
@ -319,7 +319,8 @@ class DdsImageFile(ImageFile.ImageFile):
|
||||||
)
|
)
|
||||||
self.tile = [("raw", extents, 0, (rawmode[::-1], 0, 1))]
|
self.tile = [("raw", extents, 0, (rawmode[::-1], 0, 1))]
|
||||||
else:
|
else:
|
||||||
raise OSError(f"Unsupported bitcount {bitcount} for {pfflags}")
|
msg = f"Unsupported bitcount {bitcount} for {pfflags_}"
|
||||||
|
raise OSError(msg)
|
||||||
elif pfflags & DDPF.LUMINANCE:
|
elif pfflags & DDPF.LUMINANCE:
|
||||||
if bitcount == 8:
|
if bitcount == 8:
|
||||||
self.mode = "L"
|
self.mode = "L"
|
||||||
|
@ -328,7 +329,8 @@ class DdsImageFile(ImageFile.ImageFile):
|
||||||
self.mode = "LA"
|
self.mode = "LA"
|
||||||
self.tile = [("raw", extents, 0, ("LA", 0, 1))]
|
self.tile = [("raw", extents, 0, ("LA", 0, 1))]
|
||||||
else:
|
else:
|
||||||
raise OSError(f"Unsupported bitcount {bitcount} for {pfflags}")
|
msg = f"Unsupported bitcount {bitcount} for {pfflags_}"
|
||||||
|
raise OSError(msg)
|
||||||
elif pfflags & DDPF.FOURCC:
|
elif pfflags & DDPF.FOURCC:
|
||||||
data_offs = header_size + 4
|
data_offs = header_size + 4
|
||||||
if fourcc == D3DFMT.DXT1:
|
if fourcc == D3DFMT.DXT1:
|
||||||
|
@ -398,12 +400,12 @@ class DdsImageFile(ImageFile.ImageFile):
|
||||||
msg = f"Unimplemented DXGI format {dxgi_format}"
|
msg = f"Unimplemented DXGI format {dxgi_format}"
|
||||||
raise NotImplementedError(msg)
|
raise NotImplementedError(msg)
|
||||||
else:
|
else:
|
||||||
msg = f"Unimplemented pixel format {repr(fourcc)}"
|
msg = f"Unimplemented pixel format {repr(fourcc_)}"
|
||||||
raise NotImplementedError(msg)
|
raise NotImplementedError(msg)
|
||||||
|
|
||||||
self.tile = [tile]
|
self.tile = [tile]
|
||||||
else:
|
else:
|
||||||
msg = f"Unknown pixel format flags {repr(pfflags)}"
|
msg = f"Unknown pixel format flags {repr(pfflags_)}"
|
||||||
raise NotImplementedError(msg)
|
raise NotImplementedError(msg)
|
||||||
|
|
||||||
def load_seek(self, pos):
|
def load_seek(self, pos):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user