feat(compression): add zlib compression for scene files and image optimization

- Add flate2 dependency for zlib compression support in Rust backend
- Implement compressed scene file format with magic number (PURGIFZ1) for format detection
- Add backward compatibility for loading uncompressed legacy scene files
- Convert scene JSON to compact format (no indentation) to reduce file size
- Add image compression utilities with configurable quality and dimensions
- Implement image size detection and compression necessity checking
- Add helper functions for base64 image size calculation and MIME type detection
- Disable global Tauri object in web context for security
- Reduce memory footprint for large scene files and high-resolution images through compression
This commit is contained in:
2025-12-22 12:16:22 +08:00
parent a9e998b603
commit 5416a2df36
7 changed files with 162 additions and 7 deletions

View File

@@ -28,6 +28,7 @@ serde_json = "1"
base64 = "0.22"
image = "0.25"
arboard = "3"
flate2 = "1.0" # zlib 压缩
[target.'cfg(windows)'.dependencies]
windows = { version = "0.58", features = [