ocr 및 스캐너 기능 구현

This commit is contained in:
ysj7705 committed 2026-07-22 11:48:48 +09:00
1 parent 1dbc73312b
commit 2c64369694
24 files changed
+3556 -8

No files matched your search

+28
View File
@@ -7,6 +7,7 @@ export const APP_DISPLAY_NAME = "Sejong Office";
export type DiagramKind = "excalidraw" | "mermaid" | "drawio";
export type ViewerKind = "cad" | "model3d";
export type ToolKind = "scanner";
const DIAGRAM_EXTENSION_KIND: Record<string, DiagramKind> = {
excalidraw: "excalidraw",
@@ -16,6 +17,25 @@ const DIAGRAM_EXTENSION_KIND: Record<string, DiagramKind> = {
xml: "drawio",
};
/** Image files opened in the document scanner tool. */
export const SCANNER_EXTENSIONS = new Set([
"png",
"jpg",
"jpeg",
"webp",
"gif",
"bmp",
]);
const TOOL_EXTENSION_KIND: Record<string, ToolKind> = {
png: "scanner",
jpg: "scanner",
jpeg: "scanner",
webp: "scanner",
gif: "scanner",
bmp: "scanner",
};
/** Online3DViewer import formats (+ zip container). */
export const MODEL3D_EXTENSIONS = [
"3dm",
@@ -95,3 +115,11 @@ export function diagramKindFor(filename: string): DiagramKind | null {
export function viewerKindFor(filename: string): ViewerKind | null {
return VIEWER_EXTENSION_KIND[extensionOf(filename)] ?? null;
}
export function toolKindFor(filename: string): ToolKind | null {
return TOOL_EXTENSION_KIND[extensionOf(filename)] ?? null;
}
export function isScannerImage(filename: string): boolean {
return SCANNER_EXTENSIONS.has(extensionOf(filename));
}