Get resized image, caching by (path, size) to avoid redundant work.
(path, resize_size)
| 329 | _resized_cache = {} |
| 330 | |
| 331 | def _get_resized(path, resize_size): |
| 332 | """Get resized image, caching by (path, size) to avoid redundant work.""" |
| 333 | cache_key = (path, resize_size) |
| 334 | if cache_key not in _resized_cache: |
| 335 | img_pil = img_pil_map.get(path) |
| 336 | if img_pil is None: |
| 337 | _resized_cache[cache_key] = None |
| 338 | elif self.resize_image: |
| 339 | _resized_cache[cache_key] = apply_resize_image_pil( |
| 340 | img_pil, resize_size |
| 341 | ) |
| 342 | else: |
| 343 | _resized_cache[cache_key] = img_pil |
| 344 | return _resized_cache[cache_key] |
| 345 | |
| 346 | # Step 6: Distribute to batch items (shared references, no copy) |
| 347 | for item in batch: |
nothing calls this directly
no test coverage detected