Skip to content

Drawing: a Stickers tool with the Memos fork's Kid Pix stickers - #331

Merged
9retirement6irk merged 4 commits into
mainfrom
feat/drawing-stickers
Nov 23, 2026
Merged

9retirement6irk merged 4 commits into
mainfrom
feat/drawing-stickers

Conversation

@9retirement6irk

@9retirement6irk 9retirement6irk commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

The drawing screen gets a Stickers tool in its side strip, under Text. It holds the Memos fork's Kid Pix stickers: 935 of them in 42 categories.

Needs memos fork PR 9retirement6irk/memos#33, which serves the stickers as SVG pictures (gzipped .svgz), because a Kindle can't read their Flash movies. Without it, the tool says your Memos server has no stickers.

What changes for the user

  • Picking a sticker. The first tap on Stickers opens the stickers as a grid, at the first category or the last one you opened.
    • Tap the category's name at the top to list all 42 categories.
    • ‹ › or a swipe turns the pages.
    • Tap a sticker to take it.
  • Putting it down. Each tap on the page puts the sticker down there, centred on the tap. A drag does nothing.
  • Panel. Tap Stickers again for its panel: Choose a sticker…, and the size, Small / Medium / Large. Small is the sticker's own size, as Kid Pix put it down; the others are ×1.6 and ×2.4. The sticker and size are kept for next time.
  • A sticker is a picture in the drawing, the way Memos' Kid Pix mode puts its stickers in. Undo takes it off, the lasso moves and sizes it, and Memos shows it.
  • Where they come from. Stickers come from your Memos server, at /kidpix/sticker-svg/. They're public files, fetched without sign-in, gzipped SVG.
  • Drawn from the SVG. KOReader's own SVG renderer draws each sticker for the picker and, when it's put down, at that size: 2 pixels a drawing unit, at most 1600 a side. So it's sharp at Small, Medium or Large. It's kept in the drawing as a PNG, so Memos and the drawing format are as before.
    • The list and each category are fetched over Wi‑Fi the first time they're opened.
    • Each sticker is unzipped (at most 4 MB) and kept in cache/gzreader-stickers/ as .svg, so a category you've opened works offline.
  • Colour. On a colour Kindle the stickers are in colour. On other Kindles they're greys.
  • Clear grounds. Pictures with a clear ground (stickers, any transparent PNG) now show the paper and the ink under them. Before, they were copied as an opaque box.
    • The PNG sent to Memos needed a workaround: KOReader's blitter can't blend into 24-bit colour, so the blend goes through a 32-bit copy of that part.

Files

What I tested

  • sketch_test.lua:
    • a tap with the tool (finger and pen) gives a sticker tap, with no ink;
    • a drag does nothing;
    • the picture lands centred, as a PNG the lasso can take, and Undo takes it off.
  • run_tests.lua, against the mock:
    • the list is read, and file names that aren't <category>/<n>.svgz are left out;
    • a stock Memos says it has no stickers;
    • the list is fetched and kept;
    • a category's pictures are fetched only when it's opened, and not again after that;
    • each sticker unzipped and kept as SVG;
    • drawn from the SVG at the size it's put down (2 px a unit, capped at 1600) and kept as a PNG data URL;
    • sizes, and finding the sticker again;
    • stampSticker puts it down centred at Medium and redraws only that part;
    • Undo, the panel's rows, and transparent pictures blended rather than copied.
  • In the emulator on a PW3, first with the mock: the picker, a pick, two stickers on ruled paper with the lines showing around them, Large, and Undo. Then with the fork's real SVG stickers, drawn by KOReader's NanoSVG: the Animals grid, and zebras at Medium and Large, sharp.
  • Full tools/gzreader/tests/run.sh: 0 suites failed.

Try on a device

  1. Merge or deploy memos#33. https://<your memos>/kidpix/sticker-svg/index.json should load.
  2. Notes → new drawing, with Wi‑Fi on. Tap the sticker icon (a smiling square with a peeled corner, under T). The Animals stickers should appear after "Fetching Animals stickers…".
  3. Tap a sticker, then tap the page a few times: it should go down at each tap.
  4. Tap the icon again, then Large, then tap the page. Then Undo.
  5. Use the lasso to move and resize a sticker.
  6. Save, and open the note in Memos: the stickers should be there.
  7. Turn Wi‑Fi off and open the same category again: it should still work.

If something fails, send GZreader/app/gzreader.log: it has the stickers: and drawing: a sticker lines.

https://claude.ai/code/session_01HqNYrwobY8un97LQ2jriQC


Generated by Claude Code

The stickers come from the fork's /kidpix/sticker-png/ (PNG pictures of
its Kid Pix stickers): the list and each category fetched once over Wi-Fi
and kept. A tap puts the picked sticker down as a picture (undo, lasso).
Pictures with a clear ground are now blended onto the page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HqNYrwobY8un97LQ2jriQC
@9retirement6irk 9retirement6irk added the beta Include in the beta branch (test builds over Wi-Fi) label Nov 20, 2026 — with Claude
github-actions Bot added a commit that referenced this pull request Nov 20, 2026
# Conflicts:
#	plugins/gzreader.koplugin/gzreader_changelog.lua
…ies, 500 stickers each

A server sending more than it may (the list over 1 MB, a picture over
512 kB) has its download stopped and nothing of it kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HqNYrwobY8un97LQ2jriQC

Copy link
Copy Markdown
Owner Author

Hardening after a security review: the sticker list's download is capped at 1 MB and each picture at 512 kB (the download stops and nothing of it is kept), and a list is read for at most 100 categories of 500 stickers. Tests added; full suite 0 failed.


Generated by Claude Code

github-actions Bot added a commit that referenced this pull request Nov 20, 2026
# Conflicts:
#	plugins/gzreader.koplugin/gzreader_changelog.lua
…ut down

The fork now serves its Kid Pix stickers as gzipped SVG
(/kidpix/sticker-svg/<slug>/<n>.svgz). GZreader unzips each (capped at
4 MB), keeps it as .svg and draws it with KOReader's SVG renderer: for
the picker, and for a sticker put down at its size (2 px a unit, at most
1600 a side), kept in the drawing as a PNG. Gzip.inflate takes a limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HqNYrwobY8un97LQ2jriQC
github-actions Bot added a commit that referenced this pull request Nov 20, 2026
# Conflicts:
#	plugins/gzreader.koplugin/gzreader_changelog.lua
github-actions Bot added a commit that referenced this pull request Nov 20, 2026
# Conflicts:
#	plugins/gzreader.koplugin/gzreader_changelog.lua
github-actions Bot added a commit that referenced this pull request Nov 20, 2026
# Conflicts:
#	plugins/gzreader.koplugin/gzreader_changelog.lua
github-actions Bot added a commit that referenced this pull request Nov 20, 2026
# Conflicts:
#	plugins/gzreader.koplugin/gzreader_changelog.lua
github-actions Bot added a commit that referenced this pull request Nov 20, 2026
# Conflicts:
#	plugins/gzreader.koplugin/gzreader_changelog.lua
github-actions Bot added a commit that referenced this pull request Nov 20, 2026
# Conflicts:
#	plugins/gzreader.koplugin/gzreader_changelog.lua
github-actions Bot added a commit that referenced this pull request Nov 20, 2026
# Conflicts:
#	plugins/gzreader.koplugin/gzreader_changelog.lua
github-actions Bot added a commit that referenced this pull request Nov 20, 2026
# Conflicts:
#	plugins/gzreader.koplugin/gzreader_changelog.lua
github-actions Bot added a commit that referenced this pull request Nov 20, 2026
# Conflicts:
#	plugins/gzreader.koplugin/gzreader_changelog.lua
github-actions Bot added a commit that referenced this pull request Nov 21, 2026
# Conflicts:
#	plugins/gzreader.koplugin/gzreader_changelog.lua
github-actions Bot added a commit that referenced this pull request Nov 21, 2026
# Conflicts:
#	plugins/gzreader.koplugin/gzreader_changelog.lua
github-actions Bot added a commit that referenced this pull request Nov 21, 2026
# Conflicts:
#	plugins/gzreader.koplugin/gzreader_changelog.lua
github-actions Bot added a commit that referenced this pull request Nov 21, 2026
# Conflicts:
#	plugins/gzreader.koplugin/gzreader_changelog.lua
github-actions Bot added a commit that referenced this pull request Nov 21, 2026
# Conflicts:
#	plugins/gzreader.koplugin/gzreader_changelog.lua
github-actions Bot added a commit that referenced this pull request Nov 21, 2026
# Conflicts:
#	plugins/gzreader.koplugin/gzreader_changelog.lua
github-actions Bot added a commit that referenced this pull request Nov 21, 2026
# Conflicts:
#	plugins/gzreader.koplugin/gzreader_changelog.lua
github-actions Bot added a commit that referenced this pull request Nov 22, 2026
# Conflicts:
#	plugins/gzreader.koplugin/gzreader_changelog.lua
github-actions Bot added a commit that referenced this pull request Nov 22, 2026
# Conflicts:
#	plugins/gzreader.koplugin/gzreader_changelog.lua
github-actions Bot added a commit that referenced this pull request Nov 22, 2026
# Conflicts:
#	plugins/gzreader.koplugin/gzreader_changelog.lua
github-actions Bot added a commit that referenced this pull request Nov 22, 2026
# Conflicts:
#	plugins/gzreader.koplugin/gzreader_changelog.lua
github-actions Bot added a commit that referenced this pull request Nov 22, 2026
# Conflicts:
#	plugins/gzreader.koplugin/gzreader_changelog.lua
github-actions Bot added a commit that referenced this pull request Nov 22, 2026
# Conflicts:
#	plugins/gzreader.koplugin/gzreader_changelog.lua
github-actions Bot added a commit that referenced this pull request Nov 22, 2026
# Conflicts:
#	plugins/gzreader.koplugin/gzreader_changelog.lua
github-actions Bot added a commit that referenced this pull request Nov 22, 2026
# Conflicts:
#	plugins/gzreader.koplugin/gzreader_changelog.lua
github-actions Bot added a commit that referenced this pull request Nov 23, 2026
# Conflicts:
#	plugins/gzreader.koplugin/gzreader_changelog.lua
github-actions Bot added a commit that referenced this pull request Nov 23, 2026
# Conflicts:
#	plugins/gzreader.koplugin/gzreader_changelog.lua
github-actions Bot added a commit that referenced this pull request Nov 23, 2026
# Conflicts:
#	plugins/gzreader.koplugin/gzreader_changelog.lua
github-actions Bot added a commit that referenced this pull request Nov 23, 2026
# Conflicts:
#	plugins/gzreader.koplugin/gzreader_changelog.lua
github-actions Bot added a commit that referenced this pull request Nov 23, 2026
# Conflicts:
#	plugins/gzreader.koplugin/gzreader_changelog.lua
github-actions Bot added a commit that referenced this pull request Nov 23, 2026
# Conflicts:
#	plugins/gzreader.koplugin/gzreader_changelog.lua
@9retirement6irk
9retirement6irk merged commit 179ea60 into main Nov 23, 2026
2 checks passed
@9retirement6irk
9retirement6irk deleted the feat/drawing-stickers branch November 23, 2026 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beta Include in the beta branch (test builds over Wi-Fi)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants