| 67 | # Remove all files Not having Wallpaper Resolution |
| 68 | @staticmethod |
| 69 | def extract_wall(): |
| 70 | w = Wallpaper |
| 71 | w.time_gap("Extracting Wallpapers") |
| 72 | for filename in os.listdir(w.file_urls["wall_dst"]): |
| 73 | base_file, ext = os.path.splitext(filename) |
| 74 | if ext == ".jpg": |
| 75 | try: |
| 76 | im = Image.open(w.file_urls["wall_dst"] + filename) |
| 77 | except IOError: |
| 78 | print("This isn't a picture.", filename) |
| 79 | if list(im.size)[0] != 1920 and list(im.size)[0] != 1080: |
| 80 | im.close() |
| 81 | os.remove(w.file_urls["wall_dst"] + filename) |
| 82 | else: |
| 83 | im.close() |
| 84 | |
| 85 | # Arrange the wallpapers into the corresponding folders |
| 86 | @staticmethod |