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 = [] data = []
while True: while True:
l, s, d = e.encode(bufsize) length, error_code, chunk = e.encode(bufsize)
data.append(d) data.append(chunk)
if s: if error_code:
break break
if s < 0: if error_code < 0:
msg = f"encoder error {s} in tobytes" msg = f"encoder error {error_code} in tobytes"
raise RuntimeError(msg) raise RuntimeError(msg)
return b"".join(data) return b"".join(data)