Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
KenPanCS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QCD
Tools
KenPanCS
Commits
a4d7afb4
Commit
a4d7afb4
authored
May 08, 2022
by
AP matsuo koji
😲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Verify modeの追加
parent
c95477a8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
8 deletions
+31
-8
CSRender.cs
CSRender/CSRender.cs
+19
-5
Program.cs
CSRender/Program.cs
+11
-3
CSRender_ReadMe.adoc
CSRender_ReadMe.adoc
+1
-0
No files found.
CSRender/CSRender.cs
View file @
a4d7afb4
...
...
@@ -318,7 +318,8 @@ namespace CSRender {
UtHash
.
HashData
inHashDataTgt
=
null
,
UtHash
.
HashData
inHashDataRef
=
null
,
bool
bPDFium
=
false
,
int
nPageThreadNum
=
4
int
nPageThreadNum
=
4
,
bool
bVerify
=
false
// 比較結果を返す ページ番号とメッセージ
)
{
var
bDump
=
Check
.
bDump
;
...
...
@@ -389,7 +390,6 @@ namespace CSRender {
var
strm
=
RenderPageStream
(
docG
:
docGRef
,
index
:(
int
)
i
-
1
,
pm
:
pm
);
return
strm
;
}
// ターゲット処理
if
(
tgtHf
==
null
)
{
tgtStrm
=
RendPageTGT
();
// Render
...
...
@@ -413,7 +413,14 @@ namespace CSRender {
var
dateStr
=
DateTime
.
Now
.
ToString
();
//Console.WriteLine($@"tgt={i}:{tgtHash}");
//Console.WriteLine($@"ref={i}:{refHash}");
//bool bVerify=true;
if
(
bVerify
){
String
p
=
null
;
p
=
Path
.
Combine
(
otDir
,
"TGT"
);
if
(!
Directory
.
Exists
(
p
))
Directory
.
CreateDirectory
(
p
);
p
=
Path
.
Combine
(
otDir
,
"REF"
);
if
(!
Directory
.
Exists
(
p
))
Directory
.
CreateDirectory
(
p
);
}
if
(
tgtHash
!=
refHash
)
{
// no match
// nRet = 1;
...
...
@@ -427,7 +434,10 @@ namespace CSRender {
// diffのjpegを書き出してみる(tgt)
if
(
tgtStrm
==
null
)
tgtStrm
=
RendPageTGT
();
var
otPath
=
Path
.
Combine
(
otDir
,
$"
{
otBaseName
}
.
{
i
}
.tgt.
{
otExtention
}
"
);
var
otPath
=
bVerify
?
Path
.
Combine
(
otDir
,
"TGT"
,
$"
{
otBaseName
}
.
{
i
}
.
{
otExtention
}
"
)
:
Path
.
Combine
(
otDir
,
$"
{
otBaseName
}
.
{
i
}
.tgt.
{
otExtention
}
"
);
using
(
var
bmp
=
new
System
.
Drawing
.
Bitmap
(
tgtStrm
)){
var
imEnc
=
new
UtImage
.
Enc
(
pm
.
ImageType
)
{
JpegQuality
=
pm
.
JpegQ
};
// Init membrers.
bmp
.
SetResolution
((
float
)
pm
.
Dpi
,
(
float
)
pm
.
Dpi
);
...
...
@@ -437,7 +447,11 @@ namespace CSRender {
// diffのjpegを書き出してみる(ref)
if
(
refStrm
==
null
)
refStrm
=
RendPageREF
();
otPath
=
Path
.
Combine
(
otDir
,
$"
{
otBaseName
}
.
{
i
}
.ref.
{
otExtention
}
"
);
otPath
=
bVerify
?
Path
.
Combine
(
otDir
,
"REF"
,
$"
{
otBaseName
}
.
{
i
}
.
{
otExtention
}
"
)
:
Path
.
Combine
(
otDir
,
$"
{
otBaseName
}
.
{
i
}
.ref.
{
otExtention
}
"
);
using
(
var
bmp
=
new
System
.
Drawing
.
Bitmap
(
refStrm
)){
var
imEnc
=
new
UtImage
.
Enc
(
pm
.
ImageType
)
{
JpegQuality
=
pm
.
JpegQ
};
// Init membrers.
bmp
.
SetResolution
((
float
)
pm
.
Dpi
,
(
float
)
pm
.
Dpi
);
...
...
CSRender/Program.cs
View file @
a4d7afb4
...
...
@@ -69,6 +69,8 @@ namespace CSRenderMain {
// データはWCFの通信データを使う。引数はPipeName:PortAddressNameとする
[
DataMember
]
public
bool
bVerbose
=
false
;
// 詳細デバッグ
[
DataMember
]
public
bool
bVerify
=
false
;
// 詳細デバッグ
public
ParamData
Clone
()
{
return
(
ParamData
)
MemberwiseClone
();
...
...
@@ -137,6 +139,7 @@ For more information,see /H /? or /?
事前に/MkHashを実行しておくことで高速に処理できる
/Tgt|Target <<Target PDF|PDF dir>> : ターゲットファイル指定
/Ref|Reference <<Reference PDF|PDF dir>> : リファレンスファイル指定(比較先)
/Verify : PureVerify mode. Diff画像をTGTとREFのサブ階層に出力する
/Result <result file> : 比較結果を格納するファイルパス
/FCコマンドを指定すると一致したら0,不一致なら1を返却するようになる
<result file>は、<pageNum(1始まり)>,<[OK] or [@Difference]>の行で構成される
...
...
@@ -302,6 +305,8 @@ For more information,see /H /? or /?
pm
.
bExeSepa
=
false
;
}
else
if
(
isOpt
(
"/RESULT"
))
{
pm
.
resultPath
=
getValue
(
""
);
// next value.
}
else
if
(
isOpt
(
"/Verify"
))
{
pm
.
bVerify
=
true
;
}
else
if
(
wd
.
First
()
==
'/'
)
{
// 処理の無いオプションを明示的に無視する
Console
.
WriteLine
(
$"Warning::Ignore opt:
{
wd
}
"
);
...
...
@@ -470,7 +475,8 @@ For more information,see /H /? or /?
inHashDataTgt
:
hashDataTgt
,
inHashDataRef
:
hashDataRef
,
bPDFium
:
pm
.
bPDFium
,
nPageThreadNum
:
pm
.
paraPage
nPageThreadNum
:
pm
.
paraPage
,
bVerify
:
pm
.
bVerify
);
}
else
{
// Sync version.
...
...
@@ -711,7 +717,8 @@ For more information,see /H /? or /?
inHashDataTgt
:
hashDataTgt
,
inHashDataRef
:
hashDataRef
,
bPDFium
:
pm
.
bPDFium
,
nPageThreadNum
:
pm
.
paraPage
nPageThreadNum
:
pm
.
paraPage
,
bVerify
:
pm
.
bVerify
);
if
(
ret
>
0
)
{
// retは不一致ページ数
...
...
@@ -762,7 +769,8 @@ For more information,see /H /? or /?
inHashDataTgt
:
hashDataTgt
,
inHashDataRef
:
hashDataRef
,
bPDFium
:
pm
.
bPDFium
,
nPageThreadNum
:
pm
.
paraPage
nPageThreadNum
:
pm
.
paraPage
,
bVerify
:
pm
.
bVerify
);
}
else
{
// Sync version(Paralles).
...
...
CSRender_ReadMe.adoc
View file @
a4d7afb4
...
...
@@ -19,6 +19,7 @@ include::config.adoc[]
* V1.3.2.x:2022/05/08 :
- /fc時のhashFile異常時にhashFileを再作成する。PDFファイル更新をチェック
- /fc時のターゲットとリファレンスの同一パスを禁止
- /fc時のVerifyMode追加
* V1.3.2.0:2021/12/20 :aRGB4チャンネル保存からRGB3チャンネルに変更
* V1.3.1.0:2021/10/04 :UWP用、Data.pdfの削除、整理
- UWP用コード削除。通常のファイルアクセスやMemoryStreamに変更
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment