diff --git a/lib/png_renderer.py b/lib/png_renderer.py index d8d1546..933bbdf 100644 --- a/lib/png_renderer.py +++ b/lib/png_renderer.py @@ -1,4 +1,5 @@ +import os from lib.renderer import Renderer from PIL import Image, ImageDraw, ImageFont, ImageFile @@ -41,4 +42,6 @@ class PNG_Renderer(Renderer): draw.text((text_x,artist_y), artist, font=artist_font, fill='#' + self._config['TitleFontColor']) draw.text((text_x,album_y), album, font=album_font, fill='#' + self._config['TitleFontColor']) - image.save(self._config['OutputPath']) \ No newline at end of file + # Write file and then move it in position + image.save(self._config['OutputPath'] + '.part', 'PNG') + os.replace(self._config['OutputPath'] + '.part', self._config['OutputPath']) \ No newline at end of file