1a40cc236d
- 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.
42 lines
1007 B
Markdown
42 lines
1007 B
Markdown
# 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_photo` function to create Apple-compatible
|
|
HEIC/MOV pairs (with optional MOV ContentIdentifier injection via `exiftool`)
|
|
- CLI tool: `pyheic-struct samsung.heic`
|
|
|
|
## Installation
|
|
|
|
```bash
|
|
pip install .
|
|
```
|
|
|
|
## Usage
|
|
|
|
```python
|
|
from pyheic_struct import convert_samsung_motion_photo
|
|
|
|
convert_samsung_motion_photo("samsung.heic")
|
|
```
|
|
|
|
Command line:
|
|
|
|
```bash
|
|
pyheic-struct samsung.heic --output-heic samsung_fixed.HEIC
|
|
```
|
|
|
|
## Development
|
|
|
|
The package targets Python 3.10+. Run the CLI in editable mode:
|
|
|
|
```bash
|
|
python -m pyheic_struct path/to/samsung.heic
|
|
```
|