photocraft/crates/format
Brandon Thomas ffd811d679 feat(save): File › Save keeps a JPEG's quality and a WebP's lossy/lossless encoding (#2399)
Opening a JPEG now estimates the quality it was saved at from its quantisation
tables (the Annex K tables of ITU-T T.81 scaled by the IJG quality curve; exact
for such tables, the closest fit otherwise). Opening a WebP records whether it
is lossless (VP8L) or lossy (VP8), and a lossy one's quality from its base
quantiser index. The settings live on the document (`Document::file_encoding`,
saved in .pcraft) and a save that asks for no quality writes the file back the
same way, as Photoshop's Save does: File › Save, Save As and Save a Copy start
there instead of the fixed codec defaults (quality 90, WebP always lossless).
An explicit quality still wins; new documents and other formats keep the
defaults. Hostile or truncated DQT/VP8 headers give no estimate, never a panic.

Refs #2399

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 04:13:51 -04:00
..
fuzz Format: admit the declared .pcraft canvas before loading it (#2935) (#3295) 2026-10-11 21:22:11 -04:00
src feat(save): File › Save keeps a JPEG's quality and a WebP's lossy/lossless encoding (#2399) 2026-10-12 04:13:51 -04:00
tests Security: harden document exports and automation inputs (#2269) 2026-10-11 23:18:52 -06:00
Cargo.toml macOS: save to SMB shares that refuse a full flush (#1639) 2026-10-09 09:36:03 -04:00