How luongwnv/convert-raw-to-jpeg works
Main Components
• Application UI (Renderer Process): Represented by index.html, renderer.js, and styles.css. This is where users interact with the app (drag & drop, file selection, and conversion commands).
• Main Process: Represented by main.js. This is the Electron main process that creates browser windows, handles application lifecycle events, and orchestrates inter-process communication (IPC) between UI and back-end operations.
• External Conversion Tools: The app relies on system-installed tools – dcraw, ImageMagick, and ExifTool – to perform the image conversion, metadata preservation, and cleanup processes.
• File System: Although not a coded module, file system interactions (reading the source .ARW file, writing the converted .jpeg, and optionally deleting intermediate .TIFF files) are crucial parts of the workflow.
• Package & Configuration: Files such as package.json and package-lock.json specify dependencies and serve as build/startup configuration, indicating a Node.js environment.
Relationships and Interactions
• The UI sends user actions (e.g., a drag & drop event or file selection) via IPC messages to the Main Process.
• The Main Process receives these events and calls on the external conversion tools by spawning child processes or executing system commands to handle the conversion.
• After conversion, the Main Process updates the UI with the output status or image preview.
• The file system is accessed to both read the input .ARW and write the output .JPEG file in the same folder as the original.
Architectural Patterns and Design Principles
• Separation of Concerns: The front-end (renderer) is exclusively focused on the user interface and interactions, while the main process handles back-end operations like file conversion and managing the external tool executions.
• External Integration: Clearly mark integration points with system-level commands/tools (dcraw, ImageMagick, ExifTool) used for image processing.
Relevant Technologies, Frameworks, or Libraries
• Electron framework as the underlying platform.
• Node.js runtime that runs the main process.
• External utilities (dcraw, ImageMagick, ExifTool), which are crucial for the conversion process.
• UI technologies (HTML, CSS, JavaScript in renderer.js).