Skip to content

Commit

Permalink
Updated variable name to match tile
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Nov 21, 2023
1 parent 2f7caad commit 2c59674
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/PIL/DdsImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ def _open(self):
self._mode = "P"
self.palette = ImagePalette.raw("RGBA", self.fp.read(1024))
elif pfflags & DDPF.FOURCC:
data_offs = header_size + 4
offset = header_size + 4
if fourcc == D3DFMT.DXT1:
self._mode = "RGBA"
self.pixel_format = "DXT1"
Expand All @@ -405,7 +405,7 @@ def _open(self):
self.pixel_format = "BC5"
n = 5
elif fourcc == D3DFMT.DX10:
data_offs += 20
offset += 20
# ignoring flags which pertain to volume textures and cubemaps
(dxgi_format,) = struct.unpack("<I", self.fp.read(4))
self.fp.read(16)
Expand Down Expand Up @@ -462,7 +462,7 @@ def _open(self):

extents = (0, 0) + self.size
if n:
self.tile = [Image._Tile("bcn", extents, data_offs, (n, self.pixel_format))]
self.tile = [Image._Tile("bcn", extents, offset, (n, self.pixel_format))]
else:
self.tile = [Image._Tile("raw", extents, 0, rawmode or self.mode)]

Expand Down

0 comments on commit 2c59674

Please sign in to comment.