Skip to content

fix!: pattern rendering, input validation and svg output - #6

Merged
shpaker merged 8 commits into
mainfrom
fix/rendering-validation-and-svg-output
Aug 22, 2026
Merged

shpaker merged 8 commits into
mainfrom
fix/rendering-validation-and-svg-output

Conversation

@shpaker

@shpaker shpaker commented Aug 22, 2026

Copy link
Copy Markdown
Owner
  • derive cell boundaries once and account for the inclusive bounds of ImageDraw.rectangle, so cells tile without seams or overlap
  • restore pixel-level mirror symmetry of the rendered pattern
  • reject degenerate size / image_size / padding instead of hanging, dividing by zero or drawing garbage
  • escape colors in SVG attributes and render RGB/RGBA tuples as valid paint values
  • build SVG from a viewBox and merged cell runs
  • replace the private PIL.Image._check_size import with own validation
  • drop the unused _make_svg_rectangle and the duplicated make_userpic
  • align the padding default to (20, 20) across all generators
  • rewrite the readme: correct imports, actual defaults, parameter reference
  • add regression tests for symmetry, seams, svg/image parity, escaping and validation
  • lint and type-check the tests, enable mypy strict
  • test on Python 3.14 and refresh the trove classifiers
  • pin the interpreter per matrix entry, run tests on main, cancel superseded runs
  • move to Development Status :: 5 - Production/Stable and release 1.0.0
  • add a changelog and a just bump recipe driving it from the conventional commits
  • keep the version in pyproject.toml and userpic.py instead of sed-ing a 0.0.0 placeholder
  • tag and publish releases from a workflow, replacing the deprecated set-output release script
  • fix the .gitignore patterns and align pre-commit ruff with the lockfile
  • seed the example images so they are reproducible

A.Shpak added 5 commits August 22, 2026 10:30
- derive cell boundaries once and account for the inclusive bounds of
  ImageDraw.rectangle, so cells tile without seams or overlap
- restore pixel-level mirror symmetry of the rendered pattern
- reject degenerate size/image_size/padding instead of hanging, dividing
  by zero or drawing garbage
- escape colors in SVG attributes and render RGB/RGBA tuples as valid
  paint values
- build SVG from a viewBox and merged cell runs
- replace the private PIL.Image._check_size import with own validation
- drop the unused _make_svg_rectangle and the duplicated make_userpic
- align the padding default to (20, 20) across all generators
- fix the imports and stale defaults in the readme
- add regression tests for symmetry, seams, svg/image parity, escaping
  and validation
- lint and type-check the tests, enable mypy strict
- pin the interpreter per matrix entry, run tests on main, cancel
  superseded runs
- anchor the release version substitution and replace set-output
- fix the .gitignore patterns and align pre-commit ruff with the lockfile
- seed the example images so they are reproducible
The version no longer gets sed-ed into a 0.0.0 placeholder at release time:
it lives in pyproject.toml and userpic.py and is bumped from the conventional
commits since the last tag, together with the changelog entry.

The classifier moves to Development Status :: 5 - Production/Stable, so the
first automated release is 1.0.0 and the public API is covered by semver from
that point on.

BREAKING CHANGE: the padding default changed from (0, 0) to (20, 20) in
make_userpic_svg and in both *_from_string functions, make_userpic was removed,
and degenerate size/image_size/padding values now raise ValueError instead of
hanging or returning a broken image. The rendered pixels and the SVG markup
differ from 0.4.0, although the pattern for a given seed or string is unchanged.
@shpaker shpaker changed the title fix: pattern rendering, input validation and svg output fix!: pattern rendering, input validation and svg output Aug 22, 2026
A.Shpak added 3 commits August 22, 2026 11:09
Branch protection on main requires a pull request, so a workflow cannot push
the bump commit there. The version and the changelog are bumped in the pull
request with 'just bump'; on merge the workflow only creates the tag, which
branch protection does not cover, and then publishes.
@shpaker
shpaker merged commit 254e9ec into main Aug 22, 2026
6 checks passed
@shpaker
shpaker deleted the fix/rendering-validation-and-svg-output branch August 22, 2026 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant