mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-06-05 13:43:28 +03:00
Fixed big-endian bug
This commit is contained in:
parent
b87d4e075e
commit
9a7bd0d10b
|
@ -15,6 +15,7 @@ from enum import IntEnum, IntFlag
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
|
|
||||||
from . import Image, ImageFile
|
from . import Image, ImageFile
|
||||||
|
from ._binary import i32le as i32
|
||||||
from ._binary import o32le as o32
|
from ._binary import o32le as o32
|
||||||
|
|
||||||
# Magic ("DDS ")
|
# Magic ("DDS ")
|
||||||
|
@ -191,10 +192,6 @@ class DXGI_FORMAT(IntEnum):
|
||||||
return cls.INVALID
|
return cls.INVALID
|
||||||
|
|
||||||
|
|
||||||
def make_fourcc(name):
|
|
||||||
return struct.unpack("I", name.encode("ascii"))[0]
|
|
||||||
|
|
||||||
|
|
||||||
class D3DFMT(IntEnum):
|
class D3DFMT(IntEnum):
|
||||||
UNKNOWN = 0
|
UNKNOWN = 0
|
||||||
R8G8B8 = 20
|
R8G8B8 = 20
|
||||||
|
@ -252,20 +249,20 @@ class D3DFMT(IntEnum):
|
||||||
A2B10G10R10_XR_BIAS = 119
|
A2B10G10R10_XR_BIAS = 119
|
||||||
BINARYBUFFER = 199
|
BINARYBUFFER = 199
|
||||||
|
|
||||||
UYVY = make_fourcc("UYVY")
|
UYVY = i32(b"UYVY")
|
||||||
R8G8_B8G8 = make_fourcc("RGBG")
|
R8G8_B8G8 = i32(b"RGBG")
|
||||||
YUY2 = make_fourcc("YUY2")
|
YUY2 = i32(b"YUY2")
|
||||||
G8R8_G8B8 = make_fourcc("GRGB")
|
G8R8_G8B8 = i32(b"GRGB")
|
||||||
DXT1 = make_fourcc("DXT1")
|
DXT1 = i32(b"DXT1")
|
||||||
DXT2 = make_fourcc("DXT2")
|
DXT2 = i32(b"DXT2")
|
||||||
DXT3 = make_fourcc("DXT3")
|
DXT3 = i32(b"DXT3")
|
||||||
DXT4 = make_fourcc("DXT4")
|
DXT4 = i32(b"DXT4")
|
||||||
DXT5 = make_fourcc("DXT5")
|
DXT5 = i32(b"DXT5")
|
||||||
DX10 = make_fourcc("DX10")
|
DX10 = i32(b"DX10")
|
||||||
BC5S = make_fourcc("BC5S")
|
BC5S = i32(b"BC5S")
|
||||||
ATI1 = make_fourcc("ATI1")
|
ATI1 = i32(b"ATI1")
|
||||||
ATI2 = make_fourcc("ATI2")
|
ATI2 = i32(b"ATI2")
|
||||||
MULTI2_ARGB8 = make_fourcc("MET1")
|
MULTI2_ARGB8 = i32(b"MET1")
|
||||||
INVALID = -1
|
INVALID = -1
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
Loading…
Reference in New Issue
Block a user