fix!: pattern rendering, input validation and svg output - #6
Merged
Merged
Conversation
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ImageDraw.rectangle, so cells tile without seams or overlapsize/image_size/paddinginstead of hanging, dividing by zero or drawing garbageviewBoxand merged cell runsPIL.Image._check_sizeimport with own validation_make_svg_rectangleand the duplicatedmake_userpicpaddingdefault to(20, 20)across all generatorsmain, cancel superseded runsDevelopment Status :: 5 - Production/Stableand release 1.0.0just bumprecipe driving it from the conventional commitspyproject.tomlanduserpic.pyinstead of sed-ing a0.0.0placeholderset-outputrelease script.gitignorepatterns and align pre-commit ruff with the lockfile