Skip to content

Commit 6a421d7

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 65a9bbc commit 6a421d7

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

src/PIL/DdsImagePlugin.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
import struct
1616
import sys
17-
import math
1817
from enum import IntEnum, IntFlag
1918
from typing import IO
2019

@@ -508,7 +507,7 @@ def decode(self, buffer: bytes | Image.SupportsArrayInterface) -> tuple[int, int
508507
if not mask_total:
509508
mask_totals.append(0)
510509
else:
511-
mask_totals.append(255/mask_total)
510+
mask_totals.append(255 / mask_total)
512511

513512
data = bytearray()
514513
bytecount = bitcount // 8
@@ -523,9 +522,7 @@ def decode(self, buffer: bytes | Image.SupportsArrayInterface) -> tuple[int, int
523522
for i, mask in enumerate(masks):
524523
masked_value = value & mask
525524
# Remove the zero padding, and scale it to 8 bits
526-
data += o8(
527-
int((masked_value >> mask_offsets[i]) * mask_totals[i])
528-
)
525+
data += o8(int((masked_value >> mask_offsets[i]) * mask_totals[i]))
529526

530527
# extra padding pixels -- always all 0
531528
if len(data) < dest_length:
@@ -534,7 +531,6 @@ def decode(self, buffer: bytes | Image.SupportsArrayInterface) -> tuple[int, int
534531
ct_bytes = dest_length - len(data)
535532
data += pixel * ct_bytes
536533

537-
538534
self.set_as_raw(data)
539535
return -1, 0
540536

0 commit comments

Comments
 (0)