processing / processing/processing4
Support GZip compression for Base64 encoded sketches in Processing URI schema
Personne n'a encore pris cette issue.
- Langage dominant
- Java
- Étoiles
- 494
- Forks
- 183
- Merge moyen
- 4 h 39 min
- PR mergées (30 j)
- 3
Description
Most relevant area for this enhancement?
PDE
Feature to enhance
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
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par SCHEMA.md et suivez les points d’entrée de l’analyse et de la génération du schéma PDE. Déterminez comment un marqueur de compression peut préserver les liens Base64 bruts existants, puis documentez les deux formats et vérifiez que les esquisses compressées sont décodées correctement sans rompre la rétrocompatibilité.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- java
- Domaine
- desktop, tooling
- Type d'issue
- Fonctionnalité
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100