processing / processing/processing4

Support GZip compression for Base64 encoded sketches in Processing URI schema

Aperta
#1,212 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

enhancement lower priority
Lingua principale
Java
Stelle
494
Fork
183
Merge medio
4h 39m
PR unite (30g)
3

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia da SCHEMA.md e segui i punti di ingresso per l’analisi e la generazione dello schema PDE. Determina come un marcatore di compressione possa preservare i link Base64 grezzi esistenti, quindi documenta entrambi i formati e verifica che gli schizzi compressi vengano decodificati correttamente senza compromettere la retrocompatibilità.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java
Ambito
desktop, tooling
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.