Skip to content

Commit

Permalink
Merge pull request #42 from YellowTech/master
Browse files Browse the repository at this point in the history
  • Loading branch information
victordomingos authored May 25, 2024
2 parents 07acfb2 + f2df118 commit 0da9c8c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion optimize_images/img_optimize_jpg.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ def optimize_jpg(task: Task) -> TaskResult:

if task.keep_exif and had_exif:
try:
piexif.transplant(os.path.expanduser(task.src_path), tmp_buffer)
tmp_buffer_exif = BytesIO()
piexif.transplant(os.path.expanduser(task.src_path),
tmp_buffer.getbuffer(), new_file=tmp_buffer_exif)
tmp_buffer.close()
tmp_buffer = tmp_buffer_exif
has_exif = True
except ValueError:
has_exif = False
Expand Down

0 comments on commit 0da9c8c

Please sign in to comment.