Clean up low-severity code quality issues
- Share IMAGE_EXTENSIONS between discovery.rs and watcher.rs (DRY) - Extract compute_renamed_path() to deduplicate ~100 lines in executor - Extract estimate_text_dimensions() to deduplicate watermark calc (3 copies) - Fix encoder fallback defaults: WebP 85, AVIF 63 (match QualityPreset::High) - Extract watch_config_dir() and load_watches() helpers in CLI (4 copies) - Remove redundant else branches after unwrap_or_default() - Rename misleading chrono_timestamp() to unix_timestamp()
This commit is contained in:
@@ -40,8 +40,8 @@ impl OutputEncoder {
|
||||
match format {
|
||||
ImageFormat::Jpeg => self.encode_jpeg(img, quality.unwrap_or(85)),
|
||||
ImageFormat::Png => self.encode_png(img, quality.unwrap_or(3)),
|
||||
ImageFormat::WebP => self.encode_webp(img, quality.unwrap_or(80)),
|
||||
ImageFormat::Avif => self.encode_avif(img, quality.unwrap_or(80)),
|
||||
ImageFormat::WebP => self.encode_webp(img, quality.unwrap_or(85)),
|
||||
ImageFormat::Avif => self.encode_avif(img, quality.unwrap_or(63)),
|
||||
ImageFormat::Gif => self.encode_fallback(img, image::ImageFormat::Gif),
|
||||
ImageFormat::Tiff => self.encode_fallback(img, image::ImageFormat::Tiff),
|
||||
ImageFormat::Bmp => self.encode_fallback(img, image::ImageFormat::Bmp),
|
||||
|
||||
Reference in New Issue
Block a user