mirror of
https://github.com/zadam/trilium.git
synced 2026-04-03 10:39:00 +02:00
fix(ocr): TIFF overlapping with image processor
This commit is contained in:
@@ -41,10 +41,10 @@ class OCRService {
|
||||
private processors: Map<string, FileProcessor> = new Map();
|
||||
|
||||
constructor() {
|
||||
// Initialize file processors
|
||||
this.processors.set('image', new ImageProcessor());
|
||||
const imageProcessor = new ImageProcessor();
|
||||
this.processors.set('image', imageProcessor);
|
||||
this.processors.set('pdf', new PDFProcessor());
|
||||
this.processors.set('tiff', new TIFFProcessor());
|
||||
this.processors.set('tiff', new TIFFProcessor(imageProcessor));
|
||||
this.processors.set('office', new OfficeProcessor());
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ export class ImageProcessor extends FileProcessor {
|
||||
'image/png',
|
||||
'image/gif',
|
||||
'image/bmp',
|
||||
'image/tiff',
|
||||
'image/webp'
|
||||
];
|
||||
|
||||
|
||||
@@ -9,12 +9,10 @@ import { ImageProcessor } from './image_processor.js';
|
||||
* TIFF processor for extracting text from multi-page TIFF files
|
||||
*/
|
||||
export class TIFFProcessor extends FileProcessor {
|
||||
private imageProcessor: ImageProcessor;
|
||||
private readonly supportedTypes = ['image/tiff', 'image/tif'];
|
||||
|
||||
constructor() {
|
||||
constructor(private imageProcessor: ImageProcessor) {
|
||||
super();
|
||||
this.imageProcessor = new ImageProcessor();
|
||||
}
|
||||
|
||||
canProcess(mimeType: string): boolean {
|
||||
|
||||
Reference in New Issue
Block a user