WebViews / browsers do not natively decode TIFF format images. Setting raw TIFF base64 into img.src fails to render previews in the gallery.
Additionally, the image crate is currently placed in [target.'cfg(windows)'.dependencies] in Cargo.toml, making it unavailable on Linux and macOS builds.
Acceptance Criteria
Cross-Platform image Dependency:
Move image = { version = "0.25", default-features = false, features = ["png", "tiff"] } from [target.'cfg(windows)'.dependencies] into standard [dependencies] in src-tauri/Cargo.toml.
TIFF to PNG Conversion Command:
Add read_tiff_preview_png(path: String) command in src-tauri/src/commands.rs.
Decode TIFF, optionally constrain max edge to ~1200px, encode to PNG base64, and return to frontend.
Frontend Integration:
Update src/js/printtarg.js to use read_tiff_preview_png for rendering target sheet previews.
Keep read_file_base64 strictly for text artefacts (such as .gam files).
### Problem
WebViews / browsers do not natively decode TIFF format images. Setting raw TIFF base64 into `img.src` fails to render previews in the gallery.
Additionally, the `image` crate is currently placed in `[target.'cfg(windows)'.dependencies]` in `Cargo.toml`, making it unavailable on Linux and macOS builds.
### Acceptance Criteria
1. **Cross-Platform `image` Dependency**:
- Move `image = { version = "0.25", default-features = false, features = ["png", "tiff"] }` from `[target.'cfg(windows)'.dependencies]` into standard `[dependencies]` in `src-tauri/Cargo.toml`.
2. **TIFF to PNG Conversion Command**:
- Add `read_tiff_preview_png(path: String)` command in `src-tauri/src/commands.rs`.
- Decode TIFF, optionally constrain max edge to ~1200px, encode to PNG base64, and return to frontend.
3. **Frontend Integration**:
- Update `src/js/printtarg.js` to use `read_tiff_preview_png` for rendering target sheet previews.
- Keep `read_file_base64` strictly for text artefacts (such as `.gam` files).
gronod
added the Kind/Bug label 2026-08-25 09:16:17 +01:00
gronod
added this to the Milestone 7: v0.2 ship milestone 2026-08-25 09:42:06 +01:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
WebViews / browsers do not natively decode TIFF format images. Setting raw TIFF base64 into
img.srcfails to render previews in the gallery.Additionally, the
imagecrate is currently placed in[target.'cfg(windows)'.dependencies]inCargo.toml, making it unavailable on Linux and macOS builds.Acceptance Criteria
imageDependency:image = { version = "0.25", default-features = false, features = ["png", "tiff"] }from[target.'cfg(windows)'.dependencies]into standard[dependencies]insrc-tauri/Cargo.toml.read_tiff_preview_png(path: String)command insrc-tauri/src/commands.rs.src/js/printtarg.jsto useread_tiff_preview_pngfor rendering target sheet previews.read_file_base64strictly for text artefacts (such as.gamfiles).