1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
| /**
| *
| * IMAGE 模組列表輸出至 CSV scripts/dist/*.image.csv
| *
| *
| * */
| const fs = require('fs');
| const readline = require('readline');
| const path = require('path');
| const {findImageKeywords} = require('./list_dependencies')
| const baseDir = path.join(process.cwd(), 'scripts/dist');
| const exclusions = Array.from(new Set([
| 'ScanRotate',
| 'ImageFormat <> ifBlackWhite',
|
| ])).join('|')
| // 您提供的關鍵字 (以 | 分隔)
| const keywordsStr = Array.from(new Set([
| 'TTiffGraphic',
| 'TDibGraphic',
| 'DeskewImg',
| 'Rotate',
| 'CropImg',
| 'ImageReSize_FormID',
| 'ImageReSize_tmp',
| 'CheckNeedCrop',
| 'ImageProcessor.transformer',
| 'ConvertToBW',
| 'ConvertToGray',
| 'Image_Smooth',
| 'NegativeImg',
| 'CleanupBorder',
| 'ImageProcessor.converter',
| 'MpsGetBarcode',
| 'Get_OMR',
| 'ImageProcessor.barcodeRecognizer',
| 'FindPoint',
| 'CheckSize',
| 'GetSiteOMR',
| 'ImageProcessor.anchorAnalyzer',
| 'TJpegGraphic',
| 'DpiResize',
| // 以下可省
| 'SaveQuality',
| 'FJpgCompression',
| 'ifTrueColor',
| 'ifGray256',
| 'ConvertToBW',
| 'ConvertToGray',
| 'Image_Smooth',
| 'NegativeImg',
| 'CleanupBorder',
| 'ifBlackWhite',
| 'tcGroup4',
| 'tcPackBits',
| 'tcJpeg',
| 'ifColor25'
| ])).join('|')
| // 執行腳本 (請確認您的目標檔案名稱,預設為 CB_IMGPSScanImp.pas)
| const targetFiles = [
| 'CB_IMGPSScanImp.pas.bk',
| 'DocCopy.pas',
| 'DocList.pas',
| 'DocPrt.pas',
| 'ErrList.pas',
| 'InputMask.pas',
| 'OldCaseImg.pas',
| 'OldCaseInfo.pas',
| 'PatchFom.pas',
| 'ScanMemo.pas'
| ]
|
| async function listDependencies() {
| console.log(`${'方法名'.padEnd(30)} | ${'所在檔名'.padEnd(20)} | ${'行號'.padEnd(5)} | ${'引用了什麼相依 (關鍵字)'}`);
| console.log(`--- | --- | --- | --- |`);
| return await Promise.all(targetFiles.map((_) => findImageKeywords(_, keywordsStr, exclusions, path.join(baseDir, `${_}.image.csv`))))
| }
|
| module.exports = {
| listDependencies
| }
|
|