feat: thumbnail generator plugin with configurable size/format
- ThumbnailGeneratorPort in domain (bytes + config → resized bytes) - adapters-thumbnail: ImageThumbnailGenerator using image crate - ThumbnailGeneratorPlugin reads width/height/format/profile from step config - PostgresDerivativeRepository + 012_derivatives migration - Seeded in extract_metadata pipeline as step 2 (300x300 webp) - Standalone generate_derivative pipeline for on-demand use
This commit is contained in:
@@ -81,3 +81,22 @@ pub trait DuplicateRepository: Send + Sync {
|
||||
pub trait MetadataExtractorPort: Send + Sync {
|
||||
fn extract(&self, bytes: &Bytes) -> Result<StructuredData, DomainError>;
|
||||
}
|
||||
|
||||
// --- ThumbnailGeneratorPort ---
|
||||
|
||||
pub struct ThumbnailOutput {
|
||||
pub bytes: Bytes,
|
||||
pub width: u32,
|
||||
pub height: u32,
|
||||
pub mime_type: String,
|
||||
}
|
||||
|
||||
pub trait ThumbnailGeneratorPort: Send + Sync {
|
||||
fn generate(
|
||||
&self,
|
||||
source: &Bytes,
|
||||
width: u32,
|
||||
height: u32,
|
||||
format: &str,
|
||||
) -> Result<ThumbnailOutput, DomainError>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user