feat: Everything2Everything 양방향 변환 매트릭스 피보팅
EverythingToJpeg(N→JPEG 단방향)에서 Everything2Everything(N×M 매트릭스)으로 앱을 피보팅. 7개 Provider, 200+ 변환 쌍 지원. 리네이밍 - 디렉토리/솔루션/csproj/namespace/AssemblyName/MSIX Identity 일괄 치환 - 임시파일 prefix e2j_ → e2e_, 로고 라벨 E2J → E2E 아키텍처 - ConversionPair(input, output) 신규 + ProviderCapability.SupportedConversions - IConverterProvider.ConvertAsync에 outputExtension 파라미터 추가 - ProviderRegistry를 Dictionary<(input, output), Provider> 매트릭스로 재작성 + OutputsForInput / OutputsForFile 쿼리 API - ConversionEngine: 출력 ext 라우팅, 동일 입출력 자동 skip, 서브폴더 suffix를 출력 ext에서 자동 도출 - ConvertOptions를 형식별 sub-record로 분리 (Jpeg/Png/Webp/Avif/Tiff/Pdf*/Html*/Ocr) Provider 매트릭스 - MagickProvider: PNG/JPEG/WebP/AVIF/BMP/TIFF/GIF/PDF 양방향 + RAW/PSD 디코딩 (단일이미지→1페이지 PDF, GIF/TIFF→다페이지 PDF) - HeicProvider: HEIC/HEIF → 이미지 7종 - PdfProvider: PDF → 이미지 6종 (PNG임베드 후 ImageMagick 인코딩) - HtmlProvider: HTML/HTM → 이미지 + PDF (CDP printToPDF) - DocxProvider/HwpxProvider: PDF + 이미지 7종 (LibreOffice 활용) - OcrProvider 신규: 이미지/PDF → TXT/DOCX (Windows.Media.Ocr + DocumentFormat.OpenXml, PDF는 페이지별 OCR 후 결합) UI - 사이드바 TARGET FORMAT을 동적 ComboBox로 (큐 파일 매트릭스의 교집합만 표시) - 출력 형식별 색상 배지 + Quality 패널 라벨 동적 - OUTPUT DESTINATION hint도 출력 ext 기반 동적 CLI - 신규 'to <ext> <files...>' verb (예: to png photo.heic doc.docx) - help 텍스트 양방향 컨셉으로 갱신 셸 통합 - ContextMenuRegistrar 카스케이드로 재설계 (ExtendedSubCommandsKey + Everything2Everything.SubMenu.<ext>) - 입력별 매트릭스에 따라 인기 출력 10종(JPEG/PNG/WebP/PDF/TXT/DOCX/AVIF/GIF/TIFF/BMP) 동적 노출, 마지막에 '변환…' 옵션 - 메뉴 라벨 'JPEG로 변환' → 'Everything2Everything으로 변환' 기타 - Core.csproj TFM net9.0-windows → net9.0-windows10.0.19041.0 (WinRT API용) - DocumentFormat.OpenXml 3.1.0 NuGet 추가 - README 양방향 매트릭스 기준 전면 개편 - MSIX appxmanifest Description / IExplorerCommand DLL 라벨 갱신 빌드: 0 errors, 0 warnings
This commit is contained in:
parent
96861e627d
commit
9b7e5f0d0c
63 changed files with 1788 additions and 733 deletions
|
|
@ -1,155 +0,0 @@
|
|||
using System.Windows;
|
||||
using EverythingToJpeg.App.Cli;
|
||||
using EverythingToJpeg.App.Views;
|
||||
using EverythingToJpeg.Core;
|
||||
|
||||
namespace EverythingToJpeg.App;
|
||||
|
||||
public partial class App : Application
|
||||
{
|
||||
public ConversionEngine Engine { get; } = EverythingToJpegBootstrap.CreateDefault();
|
||||
|
||||
protected override async void OnStartup(StartupEventArgs e)
|
||||
{
|
||||
base.OnStartup(e);
|
||||
|
||||
WireGlobalExceptionLogging();
|
||||
|
||||
var parsed = CliRouter.Parse(e.Args);
|
||||
|
||||
switch (parsed.Mode)
|
||||
{
|
||||
case CliRouter.Mode.Help:
|
||||
ConsoleHelper.WriteLine(CliRouter.HelpText());
|
||||
Environment.Exit(0);
|
||||
return;
|
||||
|
||||
case CliRouter.Mode.Register:
|
||||
Environment.Exit(CliRouter.RunRegister(register: true));
|
||||
return;
|
||||
|
||||
case CliRouter.Mode.Unregister:
|
||||
Environment.Exit(CliRouter.RunRegister(register: false));
|
||||
return;
|
||||
|
||||
case CliRouter.Mode.Diagnose:
|
||||
ShowDiagnoseWindow();
|
||||
return;
|
||||
|
||||
case CliRouter.Mode.Quick:
|
||||
if (parsed.Files.Count == 0)
|
||||
{
|
||||
MessageBox.Show("변환할 파일이 없습니다.", "EverythingToJpeg",
|
||||
MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
Shutdown(1);
|
||||
return;
|
||||
}
|
||||
await RunQuickAsync(parsed.Files);
|
||||
return;
|
||||
|
||||
case CliRouter.Mode.Dialog:
|
||||
ShowConvertDialog(parsed.Files);
|
||||
return;
|
||||
|
||||
case CliRouter.Mode.ShowMain:
|
||||
default:
|
||||
ShowMainWindow();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private void ShowMainWindow()
|
||||
{
|
||||
var window = new MainWindow();
|
||||
MainWindow = window;
|
||||
window.Show();
|
||||
}
|
||||
|
||||
private void ShowConvertDialog(IReadOnlyList<string> files)
|
||||
{
|
||||
var window = new Views.MainWindow(files);
|
||||
MainWindow = window;
|
||||
window.Show();
|
||||
}
|
||||
|
||||
private void ShowDiagnoseWindow()
|
||||
{
|
||||
var window = new DiagnoseWindow(Engine);
|
||||
MainWindow = window;
|
||||
window.Show();
|
||||
}
|
||||
|
||||
private async Task RunQuickAsync(IReadOnlyList<string> files)
|
||||
{
|
||||
var logPath = Path.Combine(Path.GetTempPath(), "EverythingToJpeg_quick.log");
|
||||
var log = new System.Text.StringBuilder();
|
||||
log.AppendLine($"[{DateTime.Now:yyyy-MM-dd HH:mm:ss.fff}] Quick start, {files.Count} file(s)");
|
||||
foreach (var f in files) log.AppendLine($" src: {f}");
|
||||
|
||||
var progress = new QuickProgressWindow(files.Count);
|
||||
progress.Show();
|
||||
|
||||
try
|
||||
{
|
||||
var options = ConvertOptions.Quick();
|
||||
var reporter = new Progress<ConvertProgress>(p => progress.Report(p));
|
||||
var results = await Engine.ConvertManyAsync(files, options, reporter);
|
||||
|
||||
foreach (var r in results)
|
||||
{
|
||||
log.AppendLine($" [{r.Status}] {Path.GetFileName(r.SourcePath)} → {r.OutputPaths.Count} output(s)");
|
||||
if (r.Message is { Length: > 0 }) log.AppendLine($" msg: {r.Message}");
|
||||
if (r.Error is not null) log.AppendLine($" err: {r.Error}");
|
||||
foreach (var o in r.OutputPaths) log.AppendLine($" out: {o}");
|
||||
}
|
||||
|
||||
progress.Finish(results);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.AppendLine($" EXCEPTION {ex.GetType().Name}: {ex.Message}");
|
||||
log.AppendLine(ex.ToString());
|
||||
try { progress.Close(); } catch { }
|
||||
MessageBox.Show($"변환 중 오류: {ex.Message}\n\n로그: {logPath}", "EverythingToJpeg",
|
||||
MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
finally
|
||||
{
|
||||
try { File.WriteAllText(logPath, log.ToString()); } catch { }
|
||||
}
|
||||
}
|
||||
|
||||
private static void WireGlobalExceptionLogging()
|
||||
{
|
||||
var path = Path.Combine(Path.GetTempPath(), "EverythingToJpeg_unhandled.log");
|
||||
|
||||
void Append(string source, Exception? ex)
|
||||
{
|
||||
try
|
||||
{
|
||||
File.AppendAllText(path,
|
||||
$"[{DateTime.Now:yyyy-MM-dd HH:mm:ss.fff}] {source}\n{ex}\n\n");
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
AppDomain.CurrentDomain.UnhandledException += (_, e) =>
|
||||
Append("AppDomain.UnhandledException", e.ExceptionObject as Exception);
|
||||
|
||||
Current.DispatcherUnhandledException += (_, e) =>
|
||||
{
|
||||
Append("Application.DispatcherUnhandledException", e.Exception);
|
||||
MessageBox.Show(
|
||||
"예기치 못한 오류:\n\n" + e.Exception.Message + "\n\n로그: " + path,
|
||||
"EverythingToJpeg",
|
||||
MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
e.Handled = true;
|
||||
};
|
||||
|
||||
System.Threading.Tasks.TaskScheduler.UnobservedTaskException += (_, e) =>
|
||||
{
|
||||
Append("TaskScheduler.UnobservedTaskException", e.Exception);
|
||||
e.SetObserved();
|
||||
};
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue