diff --git a/controller/cuda_grid_controller/browser_overlays.py b/controller/cuda_grid_controller/browser_overlays.py index b6008a2..9497677 100644 --- a/controller/cuda_grid_controller/browser_overlays.py +++ b/controller/cuda_grid_controller/browser_overlays.py @@ -202,6 +202,11 @@ class BrowserRenderer: img = Image.open(io.BytesIO(screenshot_bytes)) if img.mode != "RGBA": img = img.convert("RGBA") + # Resize к target w_px×h_px — overlay поместится exactly в configured slot. + # Без resize element скриншот возвращается в native dims (e.g. 790×258 для + # Grafana panel) → overflow / gap в slot. LANCZOS = high-quality downscale. + if img.size != (cfg.w_px, cfg.h_px): + img = img.resize((cfg.w_px, cfg.h_px), Image.LANCZOS) path = self.icon_dir / f"{cfg.id}.png" tmp = path.with_suffix(".png.tmp") img.save(tmp, "PNG")