Initialize the ImageLabler. Args: presentation (Presentation): The presentation object. config (Config): The configuration object.
(self, presentation: Presentation, config: Config)
| 14 | """ |
| 15 | |
| 16 | def __init__(self, presentation: Presentation, config: Config): |
| 17 | """ |
| 18 | Initialize the ImageLabler. |
| 19 | |
| 20 | Args: |
| 21 | presentation (Presentation): The presentation object. |
| 22 | config (Config): The configuration object. |
| 23 | """ |
| 24 | self.presentation = presentation |
| 25 | self.slide_area = presentation.slide_width.pt * presentation.slide_height.pt |
| 26 | self.image_stats = {} |
| 27 | self.stats_file = pjoin(config.RUN_DIR, "image_stats.json") |
| 28 | self.config = config |
| 29 | self.collect_images() |
| 30 | if pexists(self.stats_file): |
| 31 | image_stats: dict[str, dict] = json.load(open(self.stats_file, "r")) |
| 32 | for name, stat in image_stats.items(): |
| 33 | if pbasename(name) in self.image_stats: |
| 34 | self.image_stats[pbasename(name)] = stat |
| 35 | |
| 36 | def apply_stats(self): |
| 37 | """ |
nothing calls this directly
no test coverage detected