/** * * 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 }