1a40cc236daf8252ed1f67bb9c8fe63f4485b4e6
- Add `heic_types.py` to define structures for HEIC/HEIF boxes including ItemLocationBox, ItemInfoEntryBox, and others. - Introduce parsing logic in `parser.py` to handle various box types and their contents, including nested structures. - Implement rebuilding functionality for ItemLocationBox to adjust offsets based on new metadata. - Enhance ItemInfoBox to correctly parse and build content for ItemInfoEntry. - Update `pyproject.toml` to include project metadata and dependencies.
pyheic-struct
Utilities for inspecting, modifying, and rebuilding HEIC/HEIF files with a focus on cross-vendor quirks between Samsung and Apple motion photos.
Features
- Lightweight parser that exposes core ISOBMFF boxes (
ftyp,meta,iloc,iinf, etc.) - Helpers for reconstructing Samsung grid images into flat HEIC pictures
- Rebuilder that writes updated metadata and payload offsets safely
- High-level
convert_samsung_motion_photofunction to create Apple-compatible HEIC/MOV pairs (with optional MOV ContentIdentifier injection viaexiftool) - CLI tool:
pyheic-struct samsung.heic
Installation
pip install .
Usage
from pyheic_struct import convert_samsung_motion_photo
convert_samsung_motion_photo("samsung.heic")
Command line:
pyheic-struct samsung.heic --output-heic samsung_fixed.HEIC
Development
The package targets Python 3.10+. Run the CLI in editable mode:
python -m pyheic_struct path/to/samsung.heic
Description
Languages
Python
100%