processing / processing/processing4

Support GZip compression for Base64 encoded sketches in Processing URI schema

未关闭
#1,212 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

enhancement lower priority
主要语言
Java
星标
497
派生
183
平均合并
4 小时 39 分钟
30 天内合并 PR
3

描述

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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 SCHEMA.md 开始,跟踪 PDE schema 解析和生成的入口点。确定压缩标记如何保留现有的原始 Base64 链接,然后记录这两种格式,并验证压缩的草图能够正确解码且不会破坏向后兼容性。

由索引模型根据 Issue 内容生成。

评估

技术栈
java
领域
desktop, tooling
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。