Created
September 11, 2019 15:06
-
-
Save Draradech/46405d91184afa20d080e2afcd4cb1bc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import shutil | |
from PIL import Image | |
assetpath = "C:\\Users\\kaste\\AppData\\Local\\Packages\\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\\LocalState\\Assets\\" | |
_, _, assets = next(os.walk(assetpath), (None, None, [])) | |
jpegpath = "D:\\LockScreen\\Images\\" | |
_, _, jpegs = next(os.walk(jpegpath), (None, None, [])) | |
jpegs = list(map(lambda jpg: jpg[:-4], jpegs)) | |
assets = list(filter(lambda asset: asset not in jpegs, assets)) | |
assets = list(filter(lambda asset: os.stat(assetpath + asset).st_size > 200 * 1024, assets)) | |
assets = list(filter(lambda asset: Image.open(assetpath + asset).size[0] >= 1600, assets)) | |
for asset in assets: | |
shutil.copyfile(assetpath + asset, jpegpath + asset + ".jpg") | |
print("Copying " + assetpath + asset + " to " + jpegpath + asset + ".jpg") | |
os.system('pause') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment