Format overview
External bytes enter PhotoCraft through four main paths:
craft-psdparses and writes PSD and PSB structures.photocraft-codecsdecodes and encodes flat raster formats.photocraft-formatloads and saves the native.pcraftbundle.craft-affinityreads native Affinity documents (.af,.afdesign,.afphoto,.afpub): layers, artboards, vectors, text, images and masks; it does not write them.
photocraft-io maps PSD and flat images into the document model and exports documents back to those formats. It is the integration layer; parsing limits remain the responsibility of the underlying format crates.
Formats are a primary security boundary. File extension is not a trust signal, metadata can be attacker-controlled, and small compressed inputs can declare very large decoded outputs. Callers should use the bounded default APIs and preserve errors rather than retrying with unlimited limits.
See PSD and PSB, Raster formats, SVG, Affinity documents, and The .pcraft format. Cross-format hardening guidance is in Parser hardening.