refactor(P4): ConvertOptions God Object → 불변 record (init-only)
mutable sealed class(13 sub-record 가변)을 불변 record로 전환 — 배치 병렬 변환(P6)에서 공유해도 안전한 스레드 안전 전제 확보 + 값 의미론. 시그니처(ConvertAsync(ConvertOptions))는 비침습 유지. - ConvertOptions + 13개 옵션 타입(Jpeg/Png/Webp/Avif/Tiff/Bmp/Gif/PdfRender/PdfBuild/HtmlRender/ Ocr/PdfCompress/Ai) → sealed record, 전 프로퍼티 get;init;. 8개 Provider의 READ는 무영향. - 변이 5곳을 with 식/객체 초기화로 교정(WRITE만 깨지므로 국소적): MainWindow.BuildOptions(한 식으로 불변 구성), App.RunQuickAsync(with), OcrProvider(PdfRender 초기화), 특성화 테스트 2곳, ImageOptimProviderTests. - 카테고리 분해(RoutingOptions/OutputOptions)는 reader 파급이 커서 후속으로 보류(비침습 우선). 70개 테스트 전부 그린(골든마스터 동일성 = 동작 불변), 빌드 0경고/0오류.
This commit is contained in:
parent
12bda2dcbf
commit
379a4a738d
6 changed files with 95 additions and 98 deletions
|
|
@ -179,8 +179,8 @@ public sealed class OcrProvider : IConverterProvider
|
|||
OutputLocation = OutputLocation.Custom,
|
||||
CustomOutputDirectory = tempDir,
|
||||
OnCollision = NameCollision.Overwrite,
|
||||
PdfRender = new PdfRenderOptions { Dpi = Math.Max(150, options.PdfRender.Dpi) },
|
||||
};
|
||||
renderOptions.PdfRender.Dpi = Math.Max(150, options.PdfRender.Dpi);
|
||||
|
||||
var inner = new Progress<double>(p => progress?.Report(p * 0.4));
|
||||
var result = _pdfProvider.ConvertCore(pdfPath, tempDir, ".png", renderOptions, inner, cancellationToken);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue