Commit Graph
3 Commits
Author SHA1 Message Date
d1f13fbea2 craft-heif: crop to the declared size, read_metadata, stereo test data (ports of open LightCraft PRs) (#841)
* craft-heif: stills decode at the size the container declares

A coded HEVC picture is a whole number of coding blocks and can be larger
than the image the container's ispe declares (Sony codes 1920x1080 as
1920x1088 without a conformance window). decode returned the coded size,
so probe and decode disagreed and the padding rows showed as a dark band.

decode_item now crops to ispe before the alpha merge and the transforms,
measures the clap parity on the declared size, and compares the alpha
item's declared size with the picture's instead of the coded planes.
A declared size larger than the coded picture is Malformed.

Ported from storytold/lightcraft#3977.

* craft-heif: read_metadata reads the primary image's EXIF and XMP without decoding

Cataloguing a photo needs its EXIF and XMP, not its pixels. read_metadata
opens the container under the same panic guard and box census as probe
and returns what decode would attach.

Ported from storytold/lightcraft#2087.

* craft-heif testdata: Spec::stereo builds a spatial photo (grpl/ster entity group)

A second image of the primary's size and a ster entity group naming both,
so callers can test stereo detection on a file this crate decodes.

Ported from storytold/lightcraft#1684.

* craft-heif: put_alpha uses is_multiple_of

---------

Co-authored-by: Mason <mason276752@gmail.com>
Co-authored-by: jkalkstein <76634771+jkalkstein@users.noreply.github.com>
Co-authored-by: Mitch Lindgren <mitch@lindg.ren>
2026-11-11 15:22:02 -05:00
Dylan M. Taylor 081078bb1b craft-heif: optional Apple-style chroma upsampling (#799)
* craft-heif: optional Apple-style chroma upsampling

* craft-heif: the Chroma docs say rows blend too, and the README example compiles
2026-11-10 22:32:39 -05:00
Dylan M. Taylor 6e21c5b0b1 Add craft-heif: the HEIF/HEIC decoder shared by LightCraft and PhotoCraft (#794)
Moved from lightcraft-heif (lightcraft b188295e), the more complete of the
two copies: libheif-matching YCbCr conversion from the VUI, monochrome,
thumbnails and the box caps. PhotoCraft's grid-tile ICC inheritance tests
are ported to it.

Part of #778. Closes #784 once both apps switch.
2026-11-10 20:24:21 -05:00