Skip to content

Commit

Permalink
delete False added
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Benes committed Jan 28, 2024
1 parent 1bd99a3 commit e98e8f0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/jpeglib/spatial_jpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ def unquantized_coefficients(
assert self.samp_factor == '4:4:4' or (self.samp_factor == 1).all()
assert version.get() in version.LIBJPEG_VERSIONS
# write to temporary files
dst = tempfile.NamedTemporaryFile('w', suffix='.jpeg')
dst_uq = tempfile.NamedTemporaryFile('w', suffix='.bin')
dst = tempfile.NamedTemporaryFile('w', suffix='.jpeg', delete=False)
dst_uq = tempfile.NamedTemporaryFile('w', suffix='.bin', delete=False)
dst.close()
dst_uq.close()
self.write_spatial(
Expand All @@ -238,6 +238,8 @@ def unquantized_coefficients(
content = fp.read()
os.remove(dst.name)
os.remove(dst_uq.name)
del dst
del dst_uq
uq = struct.unpack(f'<{len(content)//4}f', content)
uq = np.reshape(uq, (
self.height//8, self.width//8,
Expand Down

0 comments on commit e98e8f0

Please sign in to comment.