# saschiwy/heicconverter architecture

> Architecture diagram of the GitHub repository saschiwy/heicconverter, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/saschiwy/heicconverter
- Repository: https://github.com/saschiwy/heicconverter

## Overview

##### Main Components

a) User Interface Layer
- GUI Interface (heicConverterGui.py)
- CLI Interface (heicConverter.py)

b) Core Processing Layer
- Converter Module (converter.py)

c) File System Integration
- Input: HEIC files
- Output: JPG files
- Metadata handling

##### Component Relationships

**[User] → [GUI/CLI Interface] → [Converter Core] → [File System]**

##### Specific Implementation Details

a) Input Processing:
- File/Directory path handling
- Recursive directory scanning
- File existence checking

b) Conversion Pipeline:
- HEIC file reading
- Metadata extraction
- Image conversion
- JPG file writing
- Optional source file removal

##### Detailed Component Breakdown

**┌─ User Interface Layer ─┐**
- ┌─ GUI Interface ─┐  │
- File selection│  │
- Options UI    │  │
- ┘  │
- ┌─ CLI Interface ─┐ │
- Arg parsing   │ │
- Path handling │ │
- ┘  │
- ┘
- ↓
**┌─ Converter Core ──┐**
- HEIC processing │
- JPG conversion  │
- Metadata handling│
- ┘
- ↓
**┌─ File System ────┐**
- Input HEIC     │
- Output JPG     │
- Optional Delete│
- ┘

##### Additional Elements

- Configuration options (overwrite, recursive, remove source)
- Error handling paths
- Progress feedback loops to UI
- File validation steps

##### Technical Details to Highlight

- Python-based implementation
- Dependencies (from requirements.txt)
- File format handling (HEIC → JPG)
- Metadata preservation flow

Remember to indicate the bidirectional flow of information between the UI and core converter components for progress updates and error handling.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and classes
    classDef ui fill:#a8d1f0,stroke:#333
    classDef core fill:#90EE90,stroke:#333
    classDef fs fill:#FFE5B4,stroke:#333
    classDef config fill:#E6E6FA,stroke:#333

    %% Legend
    subgraph Legend
        L1[User Interface]:::ui
        L2[Core Processing]:::core
        L3[File System]:::fs
        L4[Configuration]:::config
    end

    %% User Interface Layer
    subgraph UI[User Interface Layer]
        GUI[GUI Interface]:::ui
        CLI[CLI Interface]:::ui
        GUI -->|Input| UIProcess[UI Processing]:::ui
        CLI -->|Input| UIProcess
    end

    %% Core Processing Layer
    subgraph Core[Core Processing Layer]
        Conv[Converter Core]:::core
        MetaHandler[Metadata Handler]:::core
        ErrorHandler[Error Handler]:::core
        
        Conv --> MetaHandler
        Conv --> ErrorHandler
    end

    %% File System Layer
    subgraph FS[File System Layer]
        Input[HEIC Files]:::fs
        Output[JPG Files]:::fs
        Delete[Optional Source Removal]:::fs
        
        Input --> Output
        Output -.-> Delete
    end

    %% Configuration
    Config[Configuration Options]:::config

    %% Main Flow
    UIProcess --> Conv
    Conv --> Output
    Config --> UIProcess
    Config --> Conv
    ErrorHandler --> UIProcess

    %% Click Events
    click GUI "https://github.com/saschiwy/HeicConverter/blob/main/heicConverterGui.py"
    click CLI "https://github.com/saschiwy/HeicConverter/blob/main/heicConverter.py"
    click Conv "https://github.com/saschiwy/HeicConverter/blob/main/converter.py"
    click Config "https://github.com/saschiwy/HeicConverter/blob/main/requirements.txt"
    click ErrorHandler "https://github.com/saschiwy/HeicConverter/tree/main/doc"
```
