Prerequisites
Relevant source files
The following files were used as context for generating this wiki page:This document outlines the necessary software, dependencies, and environmental configurations required to run, develop, and build the hdrify application. The project consists of a Rust backend for image processing and a vanilla HTML, CSS, and JavaScript frontend.
The prerequisites are divided into two main categories: Runtime Prerequisites for users who want to run the pre-built application, and Development Prerequisites for developers who intend to build the project from the source code.
Runtime Prerequisites
To run the hdrify application, either locally or via Docker, the following components are required.
System Dependencies
The core image processing logic relies on an external command-line tool.
| Dependency | Requirement |
|---|---|
| ImageMagick | Must be installed and accessible in the system's PATH as magick. This is used by the Rust backend to perform the HDR conversion. |
| Docker | Required if running the application via the provided Dockerfile. This encapsulates all other dependencies, including ImageMagick and the Rust runtime environment. |
Sources: README.md:37-41, src/main.rs:92
Browser Requirements
For the user-facing application, a modern web browser is necessary. For the full experience, specific features are recommended.
- HDR Support: An HDR-compatible display and a browser that supports it (e.g., Chrome) are needed to see the effect of the image processing.
- Modern CSS: The interface uses features like
backdrop-filter, which requires a modern browser for correct visual rendering.
Sources: README.md:52, static/index.html:17-19, static/style.css:269
Development Prerequisites
To compile and build the hdrify project from source, the following development toolchain and libraries are necessary.
Build & Toolchain
The backend is built using the Rust programming language and its standard build tool, Cargo.
| Tool | Version/Edition | Purpose |
|---|---|---|
| Rust | Edition 2021 | The programming language used for the backend server. |
| Cargo | - | The Rust package manager and build tool, used to manage dependencies and compile the project. |
The following diagram illustrates the dependency hierarchy for a local development setup.
Sources: README.md:41-42, Cargo.toml:4
To build and run the project locally, you would execute:
# Install system dependency (example for macOS)
brew install imagemagick
# Run the application
cargo run
Sources: README.md:41-42
Backend Dependencies (Crates)
The Cargo.toml file defines the Rust libraries (crates) required for the backend.
| Crate | Version | Purpose |
|---|---|---|
warp | 0.3 | A lightweight, composable web server framework for building the API. |
tokio | 1.0 | An asynchronous runtime for Rust, required by warp. |
serde | 1.0 | A framework for serializing and deserializing Rust data structures. |
serde_json | 1.0 | Provides JSON serialization/deserialization for serde. |
base64 | 0.21 | Used for encoding and decoding image data sent between frontend and backend. |
tempfile | 3.0 | Creates temporary files to store the input and output images during processing. |
uuid | 1.0 | Not directly used in the provided main.rs but listed as a dependency. |
bytes | 1.0 | Not directly used in the provided main.rs but listed as a dependency. |
futures-util | 0.3 | Not directly used in the provided main.rs but listed as a dependency. |
Sources: Cargo.toml:7-15, src/main.rs:1-6, 42, 90-91
The following diagram shows the sequence of a successful image upload, highlighting the interaction between the frontend, the Rust backend, and ImageMagick.
Sources: src/main.rs, static/script.js
Frontend Dependencies
The frontend is built with vanilla HTML, CSS, and JavaScript, and has no external build dependencies or package manager. The only prerequisites are the source files themselves, served statically by the backend.
static/index.html: The main entry point of the application.static/style.css: Contains all styles for the application.static/script.js: Contains all client-side logic for handling uploads, UI interactions, and API communication.
Sources: static/index.html:7, 80, src/main.rs:175