mirror of
https://github.com/storytold/photocraft.git
synced 2026-11-12 05:02:51 +00:00
* Format: take the .pcraft envelope from craft-pcraft-format The manifest envelope, TileRef, Hash, FORMAT_VERSION, EXTENSION, the entry names, tile_path and blob_path, is_valid_hash, the manifest nesting and item checks and the migration runner now come from craft-libs' craft-pcraft-format. photocraft-format re-exports them, so callers do not change. Manifest is craft_pcraft_format::Manifest<DocM>. Saved bundles keep the same bytes. A save still checks only the nesting and the item count of its manifest, not its size, and the manifest nesting limit is still computed from photocraft_doc::MAX_GROUP_DEPTH. Tests: a save, load and save again gives the same bytes in every color mode and depth, with and without previews; MAX_GROUP_DEPTH equals craft_pcraft_format::MAX_GROUP_DEPTH. * Format: pin craft-pcraft-format from storytold/craft-libs * Format: read manifests with craft-pcraft-format's read_manifest_with Pins craft-pcraft-format to dca870a0, the head of craft-libs #407. Loading reads the manifest with read_manifest_with, which runs the limit check, the version check, the migration steps and the envelope read in one path; the layers are still decoded one at a time after the rest of the document. A save builds the manifest with Manifest::new and tile references with TileRef::new, and the bundle's directory names and the .zst suffix come from the crate's constants. Saved bytes and error messages are unchanged. * Format: pin craft-pcraft-format to craft-libs #407's head 04dd1bd 04dd1bd changes only the crate's docs and a test, so photocraft-format builds the same code. * Format: pin craft-pcraft-format to craft-libs main at b8f7d93 craft-libs #407 merged as b8f7d93. Its read_manifest also refuses a thumbnail other than thumb.png and a composite other than composite/preview.png, the only names photocraft-format writes.
51 lines
2.0 KiB
TOML
51 lines
2.0 KiB
TOML
[package]
|
|
name = "photocraft-format"
|
|
description = "Native .pcraft document bundle: manifest + content-addressed zstd tiles"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
rust-version.workspace = true
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[dependencies]
|
|
photocraft-geom = { workspace = true }
|
|
photocraft-color = { workspace = true }
|
|
photocraft-raster = { workspace = true }
|
|
photocraft-doc = { workspace = true }
|
|
photocraft-codecs = { workspace = true }
|
|
craft-pcraft-format = { workspace = true }
|
|
serde = { workspace = true }
|
|
serde_json = { workspace = true, features = ["unbounded_depth", "float_roundtrip"] }
|
|
thiserror = { workspace = true }
|
|
flate2 = { workspace = true }
|
|
# Same IEEE CRC-32 the ZIP container needs; already in Cargo.lock through flate2.
|
|
crc32fast = "1.5"
|
|
blake3 = { version = "1.8", default-features = false, features = ["pure"] }
|
|
ruzstd = "0.9.1"
|
|
|
|
# Unix directory cleanup uses no-follow descriptor-relative operations; the same
|
|
# dependency provides the plain-fsync fallback on Apple file systems.
|
|
[target.'cfg(unix)'.dependencies]
|
|
rustix = { version = "1.1", default-features = false, features = ["std", "fs"] }
|
|
|
|
# rustix does not expose Apple's directory-search open mode. Only the named
|
|
# constant is used; all descriptor operations remain in safe rustix APIs.
|
|
[target.'cfg(target_vendor = "apple")'.dependencies]
|
|
libc = "0.2"
|
|
|
|
# Replacing a file keeps its ACL (#7073). `fcopyfile(COPYFILE_ACL)` is an `unsafe fn` and
|
|
# `fclonefileat(CLONE_ACL)` is APFS-only; exacl is a safe wrapper over acl_get_file/acl_set_file.
|
|
[target.'cfg(target_os = "macos")'.dependencies]
|
|
exacl = "0.13"
|
|
|
|
# `ReplaceFileW` is how Windows replaces a file without dropping its DACL, named streams
|
|
# (Zone.Identifier, the Mark of the Web) and creation time (#7094, #7096). winsafe's `kernel`
|
|
# feature is a dependency-free safe wrapper; the workspace forbids writing the FFI call here.
|
|
[target.'cfg(windows)'.dependencies]
|
|
winsafe = { version = "0.0.29", features = ["kernel"] }
|
|
|
|
[dev-dependencies]
|
|
proptest = { workspace = true }
|