Image Archival System
This application is designed to manage image storage, metadata extraction, database integration, and tagging functionalities. The system provides an asynchronous command interface to efficiently archive images, allowing for the addition of tags and source URLs.
Features
- Image Storage: Handles uploading and storing images using a scalable storage system.
- Metadata Extraction: Automatically extracts metadata such as width, height, format, and color type.
- Database Integration: Stores image data and metadata in a relational database using SQLite.
- Tagging System: Allows for tagging of images to facilitate search and categorization.
- Source URL Handling: Supports optional setting of a source URL for each image.
Setup
Prerequisites
Installation
-
Clone the repository:
-
Navigate to the project directory:
-
Build the project:
Configuration
Ensure that your database is set up by running the necessary migrations:
The migrations are defined in src/dialect/sqlite.rs.
Usage
Archiving an Image
You can create an ArchiveImageCommand and execute it to store an image along with its metadata and tags:
let image_bytes: & = //... get image bytes
let tags = vec!;
let command = new
.with_tags
.with_source;
let storage = //... obtain storage reference
let db = //... obtain database reference
command.execute.await?;
Querying Images
Use the ImageQuery system to retrieve images based on tags or other criteria:
let query = new
.with_limit
.with_offset;
let = query.to_sql;
// Execute the query using your database connection
Contributing
Contributions are welcome! Please submit a pull request with a clear description of your changes.
License
This project is licensed under the MIT License. See the LICENSE file for details.