mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-08-02 01:37:45 +03:00
#32: git diff/ls-files при дефолтном core.quotePath=true возвращают кириллицу в octal-виде → объект с кириллическим именем не распознавался в partial-load. Все git-вызовы теперь с `-c core.quotePath=false`. PY — в центральном run_git; PS — унифицировал inline-вызовы в хелпер Invoke-GitLines (паритет с py). v1.11. #33: img-grid падал ZeroDivisionError при -c 0 / некорректном -r. Добавлена валидация (cols>0, rows>=0, auto-rows max(1,...)). Pillow задокументирован как runtime-зависимость (README + python-porting-guide). overlay-grid.py получил версионный заголовок (v1.1). Тесты: runner error-кейсы db-dump-dt/db-load-dt/db-load-git (из PR #34). img-grid runner-кейс не вводили (py-only + Pillow-зависимость) — #33 проверен вручную. Closes #32, #33 Co-Authored-By: Korolev Pavel <korolev.vrn@gmail.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Korolev Pavel
Claude Opus 4.8
parent
fb9783240e
commit
78b5b73fa7
@@ -1,3 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
# img-grid v1.1 — Overlay numbered grid on image
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
"""Overlay a numbered grid on an image to help determine column/row proportions.
|
||||
|
||||
Usage: python overlay-grid.py <image> [-c COLS] [-r ROWS] [-o OUTPUT]
|
||||
@@ -29,6 +32,11 @@ def main():
|
||||
parser.add_argument("-o", "--output", help="Output path (default: <name>-grid.<ext>)")
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.cols <= 0:
|
||||
parser.error("--cols must be greater than 0")
|
||||
if args.rows < 0:
|
||||
parser.error("--rows must be greater than or equal to 0")
|
||||
|
||||
src = Image.open(args.image).convert("RGBA")
|
||||
sw, sh = src.size
|
||||
|
||||
@@ -36,7 +44,7 @@ def main():
|
||||
step_x = sw / cols
|
||||
rows = args.rows
|
||||
if rows == 0:
|
||||
rows = round(sh / step_x)
|
||||
rows = max(1, round(sh / step_x))
|
||||
step_y = sh / rows
|
||||
|
||||
# Canvas with margins for labels
|
||||
|
||||
Reference in New Issue
Block a user