
from PIL import Image
from glob import glob

import os

covers = glob(os.path.join("./", "*.jpg") )

    
for cover in covers:
    try:
        print (cover)
        
        img = Image.open(cover)
        img2 = img.resize((512,512), Image.ANTIALIAS)

        if img2.mode != "RGB":
            img2 = img2.convert("RGB")
        
        img2.save( cover )
    except:
        print ("EERRRRRROOOOOR")
        pass
