forked from 1b-agent/opencadstudio-upstream
feat: bounded huge-image decoding, webp/gif, remote rasters, Georgian/Armenian fonts
Giant rasters (500 MB aerial/GIS TIFFs) decoded whole: multiple GB of RGBA on a wasm heap is tab death, and even desktop silently failed past the image crate's 512 MiB default allocation cap. Decoding now probes the header for dimensions first and runs in tiers — full decode under a per-target budget (512 MB wasm / 4 GB native, enforced through the decoder's allocation limits so oversize fails fast instead of ballooning), Lanczos3 downsample to a display cap (4096² wasm / 8192² native) when the decode fits but the buffer is oversized, and a clear localized refusal naming the dimensions and the limit when it cannot. The probed source dimensions stay the entity's sizing truth, so a downsampled buffer never shrinks the on-paper footprint; PDF export self-corrects (effective DPI derives from placement × stored pixels). Refusals surface once per image through the pick, open, and drop/re-resolve paths. Decode coverage gains webp and gif (pure Rust in image 0.25 — no C, no lockfile churn), with the attach picker and drop filters matching. Remote http(s) raster references now fetch on web: CORS-classified failures name CORS, HTTP errors name the status, bodies over 64 MB and 8 s deadlines are bounded, and fetched bytes join the session source registry (so ARCHIVE can package them and re-resolution reads cache). Georgian and Armenian Noto subsets ship (generation blocks included), so those scripts render instead of skipping; scripts still without subsets remain silently skipped, unchanged.
This commit is contained in:
1 parent
f70d3fda44
commit
ca0d7b962d
31 files changed
+841
-40
No files matched your search
Binary file not shown.
@@ -48,6 +48,16 @@ dl /tmp/NotoDeva.ttf "$RAW/NotoSansDevanagari/hinted/ttf/NotoSansDevanagari-Regu
|
||||
merge /tmp/NotoDeva.ttf /tmp/NotoDevaMerged.ttf
|
||||
sub /tmp/NotoDevaMerged.ttf "U+0000-024F,U+1E00-1EFF,U+2000-206F,U+0900-097F,U+A8E0-A8FF" devanagari.ttf
|
||||
|
||||
# Armenian + Georgian follow the same one-source pattern (both are
|
||||
# non-CJK alphabets; no shaping tables needed beyond the merge).
|
||||
dl /tmp/NotoArmenian.ttf "$RAW/NotoSansArmenian/hinted/ttf/NotoSansArmenian-Regular.ttf"
|
||||
merge /tmp/NotoArmenian.ttf /tmp/NotoArmenianMerged.ttf
|
||||
sub /tmp/NotoArmenianMerged.ttf "U+0000-024F,U+1E00-1EFF,U+2000-206F,U+0530-058F,U+FB13-FB17" armenian.ttf
|
||||
|
||||
dl /tmp/NotoGeorgian.ttf "$RAW/NotoSansGeorgian/hinted/ttf/NotoSansGeorgian-Regular.ttf"
|
||||
merge /tmp/NotoGeorgian.ttf /tmp/NotoGeorgianMerged.ttf
|
||||
sub /tmp/NotoGeorgianMerged.ttf "U+0000-024F,U+1E00-1EFF,U+2000-206F,U+10A0-10FF,U+1C90-1CBF,U+2D00-2D5F" georgian.ttf
|
||||
|
||||
# CJK comes from the noto-cjk repo (CFF/OTF; ttf-parser reads CFF outlines) and
|
||||
# is split by language: Simplified Chinese, Traditional Chinese, Japanese and
|
||||
# Korean each get their own file.
|
||||
|
||||
Binary file not shown.
Reference in new issue
Block a user