UNPKG

photo-watermark-cli

Version:

A modern TypeScript CLI tool to add timestamp watermarks to photos with intelligent size scaling

34 lines 1.41 kB
import type { WatermarkConfig, WatermarkOptions, ProcessResult } from '../types'; /** * 从图片中提取拍摄时间 */ export declare function extractPhotoDate(imagePath: string): Promise<Date>; /** * 格式化日期,使用 moment.js 提供更好的格式化支持 */ export declare function formatDate(date: Date, format?: string): string; /** * 计算相对于图片尺寸的字体大小 */ export declare function calculateRelativeFontSize(imageWidth: number, imageHeight: number, baseFontSize?: number, baseResolution?: number): number; /** * 计算相对于图片尺寸的边距 */ export declare function calculateRelativePadding(imageWidth: number, imageHeight: number, basePadding?: number): number; /** * 为单张图片添加水印 */ export declare function addWatermarkToImage(inputPath: string, outputPath: string, config: WatermarkConfig): Promise<void>; /** * 仅调整图片亮度,不添加水印 */ export declare function adjustImageBrightness(inputPath: string, outputPath: string, brightness?: number, quality?: number): Promise<void>; /** * 处理目录下的所有图片,仅调整亮度 */ export declare function processBrightnessOnly(options: WatermarkOptions): Promise<ProcessResult>; /** * 处理目录下的所有图片 */ export declare function processDirectory(options: WatermarkOptions): Promise<ProcessResult>; //# sourceMappingURL=watermark.d.ts.map