processing / processing/processing4

Support GZip compression for Base64 encoded sketches in Processing URI schema

Open
#1,212 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement lower priority
Dominant language
Java
Stars
494
Forks
183
Avg merge
4h 39m
Merged PRs (30d)
3

Description

Most relevant area for this enhancement?

PDE

Feature to enhance

pde:// schema

Enhancement details
Enhancement description

Add support for GZip compression in the Processing URI schema for sketches. Right now, encoded sketches are stored as raw base64, which produces very long strings.

Benefits

Allowing sketches to be compressed with GZip before base64-encoding would make the URIs shorter, allowing to fit larger sketches within URL length limitations.

Proposed Changes
  • Add support for GZip-compressed sketches in the pde://sketch/base64/ schema.
  • Use a prefix or content-type flag (e.g., pde://sketch/base64/gzip/<compressed_string>) to distinguish between raw base64 and compressed+base64.
  • Update documentation to include examples for both formats.
Challenges
  • Must ensure backward compatibility with existing base64 links.
  • Requires adding GZip decompression logic in the schema handler.
  • Slight increase in complexity when generating and parsing schema links.
  • Needs clear documentation so users know when and how to use the compressed format.
Additional context

Example of the same sketch encoded both ways:

With GZip (476 characters):

eNpdUctugzAQvPsr5ugEFEjIo1KaQ9VrD1WrnqIcXDBghdjImEZtxL93DaSJKrFiH7Ozs+toOmWY4lVJPJfCOsCH3j4a2cCVEsKmfIK81alTRsMZFFJLKxyVUFNj2jfm1px6fCac8ASNM1ZmUBqCPmvF98wTR4wp7fYHyhYVjdjhgiQOMSdbrkIkZGvyk4cQG+9v0G0Z+zIqQyNdW5OYCwMa9SP5eumR63iypYw2786ao+Rj9GIMgbdAFOGt1TA6Jck688pq1o2cmRXnkfJTpMfCmlZnfB4PnLRffxeexDRpkEyFa/NfOa+McMiUOEknbYhhRX+KgXqoV6JxT56Dto49fW4sOGGh+gz9HvumWSV14UpKBMFAcKUo6I6EPYmaqxCk6Q7ex4vVqldODaqquMePsX/Is8pcGS1ClFIVpfPeTfTN+xN65wZWEEA33E/cq8NkpL0tFezwH+MhHet+AdGftnE=

Without GZip (820 characters):

LyoqCiAqIFBpZSBDaGFydCAgCiAqIAogKiBVc2VzIHRoZSBhcmMoKSBmdW5jdGlvbiB0byBnZW5lcmF0ZSBhIHBpZSBjaGFydCBmcm9tIHRoZSBkYXRhCiAqIHN0b3JlZCBpbiBhbiBhcnJheS4gCiAqLwoKaW50W10gYW5nbGVzID0geyAzMCwgMTAsIDQ1LCAzNSwgNjAsIDM4LCA3NSwgNjcgfTsKCnZvaWQgc2V0dXAoKSB7CiAgc2l6ZSg2NDAsIDM2MCk7CiAgbm9TdHJva2UoKTsKICBub0xvb3AoKTsgIC8vIFJ1biBvbmNlIGFuZCBzdG9wCn0KCnZvaWQgZHJhdygpIHsKICBiYWNrZ3JvdW5kKDEwMCk7CiAgcGllQ2hhcnQoMzAwLCBhbmdsZXMpOwp9Cgp2b2lkIHBpZUNoYXJ0KGZsb2F0IGRpYW1ldGVyLCBpbnRbXSBkYXRhKSB7CiAgZmxvYXQgbGFzdEFuZ2xlID0gMDsKICBmb3IgKGludCBpID0gMDsgaSA8IGRhdGEubGVuZ3RoOyBpKyspIHsKICAgIGZsb2F0IGdyYXkgPSBtYXAoaSwgMCwgZGF0YS5sZW5ndGgsIDAsIDI1NSk7CiAgICBmaWxsKGdyYXkpOwogICAgYXJjKHdpZHRoLzIsIGhlaWdodC8yLCBkaWFtZXRlciwgZGlhbWV0ZXIsIGxhc3RBbmdsZSwgbGFzdEFuZ2xlK3JhZGlhbnMoZGF0YVtpXSkpOwogICAgbGFzdEFuZ2xlICs9IHJhZGlhbnMoZGF0YVtpXSk7CiAgfQp9

The compressed version is significantly shorter.

Source: https://bugdays.com/gzip-base64

Would you like to help implement this enhancement?

No, I’m just suggesting the enhancement

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with SCHEMA.md and trace the PDE schema parsing and generation entry points. Determine how a compression marker can preserve existing raw Base64 links, then document both formats and verify that compressed sketches decode correctly without breaking backward compatibility.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
desktop, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.