def_mean_brightness(path:str)->float:img=Image.open(path).convert("L")# File-Handle bleibt offenarr=np.array(img,dtype=np.float32)returnfloat(arr.mean())# und in find_duplicates():h=imagehash.phash(Image.open(path))
Bei vielen Bildern -> OSError: [Errno 24] Too many open files.
Alle Image.open()-Stellen in analyzer.py und processor.py pruefen.
## Problem
`analyzer.py:21`, `analyzer.py:66`:
```python
def _mean_brightness(path: str) -> float:
img = Image.open(path).convert("L") # File-Handle bleibt offen
arr = np.array(img, dtype=np.float32)
return float(arr.mean())
# und in find_duplicates():
h = imagehash.phash(Image.open(path))
```
Bei vielen Bildern -> OSError: [Errno 24] Too many open files.
## Fix
```python
with Image.open(path) as img:
img = img.convert("L")
arr = np.array(img, dtype=np.float32)
return float(arr.mean())
```
Alle `Image.open()`-Stellen in analyzer.py und processor.py pruefen.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
analyzer.py:21,analyzer.py:66:Bei vielen Bildern -> OSError: [Errno 24] Too many open files.
Fix
Alle
Image.open()-Stellen in analyzer.py und processor.py pruefen.Fix umgesetzt:
analyzer.py:_mean_brightness->with Image.open(...)analyzer.py:find_duplicates->with Image.open(...) as img: phash(img)processor.py:get_exif_info->with Image.open(...)processor.py:apply_image_watermark->with Image.open(wm_path) as wm_srcprocessor.py:process_photo->with Image.open() as src: src.load(); img = src.copy()(Copy noetig weil img nach with weiter verwendet wird)server.pyHEIC-Konvertierung ->with Image.open(io.BytesIO(raw)) as srcManueller Test: 3 Bilder analysiert, FD-Count stabil bei 15.