From 02b9270a4e8ce1e55e97a33663c71e49942ac1be Mon Sep 17 00:00:00 2001
From: Hong <chlin1022@i-mps.com>
Date: 星期五, 07 八月 2020 15:03:12 +0800
Subject: [PATCH] ver 2,0,1,73

---
 CB_IMGPSScanImp.pas |   44 +++++++++++++++++++++++++++++++++-----------
 1 files changed, 33 insertions(+), 11 deletions(-)

diff --git a/CB_IMGPSScanImp.pas b/CB_IMGPSScanImp.pas
index 99818e3..0b115dd 100644
--- a/CB_IMGPSScanImp.pas
+++ b/CB_IMGPSScanImp.pas
@@ -2964,11 +2964,31 @@
             End;
           End;
 //ShowMessage(IntToStr(iGraphic.Palette.palNumEntries));
-          if (iGraphic.Palette.palNumEntries = 0) or (iGraphic.Palette.palNumEntries = 256) then  //20171130 彩色 會為0  黑白 為2  灰階256
+          if iGraphic.ImageFormat = ifBlackWhite then   //20200806 出現無法匯入,是因color256無法壓JPEG,待報會後再開啟
+          begin
+            iGraphic.Compression:=tcGroup4;
+          end
+          else if iGraphic.ImageFormat= ifColor256 then
+          begin
+            ConverttoGray(iGraphic);
+            iGraphic.Compression:=tcJPEG;
+            iGraphic.JpegQuality:=cooom;
+          end
+          else if (iGraphic.ImageFormat = ifTrueColor) or (iGraphic.ImageFormat = ifGray256) then
           begin
             iGraphic.Compression:=tcJPEG;
             iGraphic.JpegQuality:=cooom;
+          end
+          else
+          begin
+            iGraphic.Compression:=tcLZW;
           end;
+
+          {if (iGraphic.Palette.palNumEntries = 0) or (iGraphic.Palette.palNumEntries = 256) then  //20171130 彩色 會為0  黑白 為2  灰階256     //20200806拿掉
+          begin
+            iGraphic.Compression:=tcJPEG;
+            iGraphic.JpegQuality:=cooom;
+          end;}
 
           If LowerCase(ExtractFileExt(SavePath + SaveFilename)) = '.tif' Then
           Begin
@@ -9799,9 +9819,9 @@
       Anchor := FormID2Anchor(FormID);
       //ParserPoint(CropMpsV.FindPoint(Anchor));
       FindPoint(ImageScrollBox1.Graphic,UpLPoint,UpRPoint,DownLPoint,Anchor);
-      if FileExists(CheckXmlPath+FormID+'.xml') then  //沒有Xml就不用遮罩
+      if FileExists(CheckXmlPath+FWork_no+'\'+FormID+'.xml') then  //沒有Xml就不用遮罩
       begin
-        XT.LoadFromFile(CheckXmlPath+FormID+'.xml');
+        XT.LoadFromFile(CheckXmlPath+FWork_no+'\'+FormID+'.xml');
         if XT.SubNodes['/form/settype10/'].First then
         Repeat
           ColEName := XT.SubNodes['/form/settype10/'].NodeName;
@@ -12219,11 +12239,11 @@
 //Display1.Lines.Add('OMRFile='+OMRFile+',OMRFormCode='+OMRFormCode+',OMRFormName='+OMRFormName);
 LogFile1.LogToFile(logTimeString+'OMRFile='+OMRFile+',OMRFormCode='+OMRFormCode+',OMRFormName='+OMRFormName);
 //ShowMessage('KKKKK');
-          if not FileExists(CheckXmlPath+OMRFormCode+'.xml') then  //沒有Xml就不用檢核
+          if not FileExists(CheckXmlPath+FWork_no+'\'+OMRFormCode+'.xml') then  //沒有Xml就不用檢核
             Continue;
 
 //ShowMessage('11638 OMRFileList.Strings['+IntToStr(i)+']'+OMRFileList.Strings[i]);
-          XT := TXmltool.Create(CheckXmlPath+OMRFormCode+'.xml');
+          XT := TXmltool.Create(CheckXmlPath+FWork_no+'\'+OMRFormCode+'.xml');
           RelaXT := TXmltool.Create;
 //ShowMessage('ModeNeedCheck='+BoolToStr(ModeNeedCheck(OMRErrInfo[4].Mode,FMode),true));
           try
@@ -12312,7 +12332,7 @@
                       RelaFile := FormCode2FileName(RelaFormCode,ContextList);
                       RelaFormName := FormCode2FormName(CaseID,RelaFormCode);
                       Anchor1 := FormID2Anchor(RelaFormCode);
-                      RelaXT.LoadFromFile(CheckXmlPath+RelaFormCode+'.xml');
+                      RelaXT.LoadFromFile(CheckXmlPath+FWork_no+'\'+RelaFormCode+'.xml');
 Display1.Lines.Add(RelaFile+','+RelaFormName);
 //ShowMessage(RelaFile);
 //ShowMessage(ImageSavePath+CaseID+'\upload\'+RelaFile);
@@ -12416,7 +12436,7 @@
                     RelaFile := FormCode2FileName(RelaFormCode,ContextList);
                     RelaFormName := FormCode2FormName(CaseID,RelaFormCode);
                     Anchor1 := FormID2Anchor(RelaFormCode);
-                    RelaXT.LoadFromFile(CheckXmlPath+RelaFormCode+'.xml');
+                    RelaXT.LoadFromFile(CheckXmlPath+FWork_no+'\'+RelaFormCode+'.xml');
 
                     if RelaFile<>'' then
                     begin
@@ -14239,7 +14259,7 @@
     end;
     if FileExists(CheckXmlPath+'OMRSet.zip') then   //有更新
     begin
-      ExecuteUnZip(CheckXmlPath+'OMRSet.zip',CheckXmlPath,False);
+      ExecuteUnZip(CheckXmlPath+'OMRSet.zip',CheckXmlPath,True);
       S.Clear;
       S.Add(ServerDate+GetBalance2Time(Balance));
       S.SaveToFile(CheckXmlPath+'LastDateTime.dat');
@@ -14297,7 +14317,7 @@
     end;
     if FileExists(SitePath+'KeyinSet.zip') then  //有更新
     begin
-      ExecuteUnZip(SitePath+'KeyinSet.zip',SitePath,False);
+      ExecuteUnZip(SitePath+'KeyinSet.zip',SitePath,True);
       S.Clear;
       S.Add(ServerDate+GetBalance2Time(Balance));
       S.SaveToFile(SitePath+'LastDateTime.dat');
@@ -14835,9 +14855,11 @@
   if ImagePath[Length(ImagePath)] <> '\' then
     ImagePath := ImagePath + '\';
 //ShowMessage('ImagePath='+ImagePath);
-  CheckXmlPath := ImagePath+'OMRSITE\'+FWork_No;
+  //CheckXmlPath := ImagePath+'OMRSITE\'+FWork_No;
+  CheckXmlPath := ImagePath+'OMRSITE\';  // 20200612 發現影像平台是取回所有業務的設定,所以不能有業務別目錄
 //ShowMessage('CheckXmlPath='+CheckXmlPath);
-  SitePath := ImagePath+'Site\'+FWork_No+'\';
+  //SitePath := ImagePath+'Site\'+FWork_No+'\';
+  SitePath := ImagePath+'Site\';  // 20200612 發現影像平台是取回所有業務的設定,所以不能有業務別目錄
   LngPath := ImagePath;
   SamplePath := ImagePath+'Sample\'+FWork_No+'\';
   ImagePath := ImagePath + 'Scantemp\';

--
Gitblit v1.8.0