Clarify variable names in Image

Co-authored-by: Yay295 <Yay295@users.noreply.github.com>
This commit is contained in:
Aarni Koskela 2023-02-24 09:59:54 +02:00
parent f52bbf8950
commit b6b72170a8

View File

@ -767,12 +767,12 @@ class Image:
data = []
while True:
l, s, d = e.encode(bufsize)
data.append(d)
if s:
length, error_code, chunk = e.encode(bufsize)
data.append(chunk)
if error_code:
break
if s < 0:
msg = f"encoder error {s} in tobytes"
if error_code < 0:
msg = f"encoder error {error_code} in tobytes"
raise RuntimeError(msg)
return b"".join(data)