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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
| /**
| *
| * 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([
| 'BWTif2Jpg',
| 'BmpConverJpg',
| 'BrightnessImg', // iis_image_process
| 'CheckNeedCrop',
| 'CheckSize',
| 'CleanupBorder',
| 'ClearLine',
| 'Color2BW_RTS', // iis_image_process
| 'Color2tif',
| 'ConvertTo256Gray',
| 'ConvertToBW',
| 'ConvertToGray',
| 'CreateDraft',
| 'CreateNote',
| 'CreateReportImg',
| 'CreateReportImg_JSON', // iis_image_process
| 'CreateStamp', // iis_image_process
| 'CropImg',
| 'DeskewImg',
| 'DpiResize',
| 'DrawPointLine',
| 'Emboss',
| 'FieldMask',
| 'FilterColor', // iis_image_process
| 'FindBlackPoint', // iis_image_process
| 'FindPoint',
| 'GetBlackSpots', // iis_image_process
| 'GetExif_CaptureDateTime',
| 'GetPixBW',
| 'GetPosAngle',
| 'GetSelectRect',
| 'GetSelectRect2String', // iis_image_process
| 'GetSelectRect_Back',
| 'GetSelectRect_Black2String',
| 'GetSiteOMR',
| 'GetTag', //
| 'Get_OMR',
| 'Gray2BW_RTS', // iis_image_process
| 'ImageProcessor.anchorAnalyzer',
| 'ImageProcessor.barcodeRecognizer',
| 'ImageProcessor.converter',
| 'ImageProcessor.transformer',
| 'ImageReSize_FormID',
| 'ImageReSize_tmp',
| 'ImageResize',
| 'ImageResize', // iis_image_process
| 'Image_Smooth',
| 'JpgReSize_Exif',
| 'JpgReSize_Exif', // iis
| 'MpsGetBarcode',
| 'NegativeImg',
| 'NegativeImg',
| 'PrintBarcode', // iis
| 'Rotate',
| 'SaveAnnotation',
| 'SetSelectRect',
| 'SetSelectRect_Original',
| 'SetTag', // iis
| 'ShowKeyinRect', // iis
| 'TDibGraphic',
| 'TJpegGraphic',
| 'TNBCleanupBorderTransform', // iis
| 'TTiffGraphic',
| 'TWatermarkTransform', // iis
| 'Watermark',
| 'Watermark1',
| 'Watermark1_Hong', // iis
| 'Watermark1_Hong_New',
| 'Watermark2',
|
| // 以下可省
| 'CleanupBorder',
| 'ConvertToBW',
| 'ConvertToGray',
| 'FJpgCompression',
| 'Image_Smooth',
| 'NegativeImg',
| 'SaveQuality',
| 'ifBlackWhite',
| 'ifColor25',
| 'ifGray256',
| 'ifTrueColor',
| 'tcGroup4',
| 'tcJpeg',
| 'tcPackBits',
| ])).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
| }
|
|