synology-thumbgen icon indicating copy to clipboard operation
synology-thumbgen copied to clipboard

OSError: cannot write mode P as JPEG

Open michalsindler opened this issue 9 years ago • 0 comments

Hi. This script is freaking awesome! Lightning fast thumbs generator. Great work, man, thx!

Fixing error - OSError: cannot write mode P as JPEG:

   im.thumbnail((thumb[1], thumb[1]), Image.ANTIALIAS)
    #fixing error "OSError: cannot write mode P as JPEG" - begin
    if im.mode in ['1', 'P']:
      im = im.convert('RGB')
    #fixing error "OSError: cannot write mode P as JPEG" - end
    im.save(os.path.join(dest_dir, thumb[0]))

michalsindler avatar Jan 31 '16 10:01 michalsindler