mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2025-07-18 20:04:16 -04:00
Improved write test
Closes #10 Added image format test: I pass every image format supported by QImage (except Alpha8) to the plugin and check the result.
This commit is contained in:
502
autotests/write/basic/bw.eps
Normal file
502
autotests/write/basic/bw.eps
Normal file
@ -0,0 +1,502 @@
|
||||
%!PS-Adobe-3.0 EPSF-3.0
|
||||
%Produced by poppler pdftops version: 0.24.5 (http://poppler.freedesktop.org)
|
||||
%%Creator: KDE EPS image plugin
|
||||
%%LanguageLevel: 2
|
||||
%%DocumentSuppliedResources: (atend)
|
||||
%%BoundingBox: 0 0 32 32
|
||||
%%HiResBoundingBox: 0 0 32 32
|
||||
%%DocumentSuppliedResources: (atend)
|
||||
%%EndComments
|
||||
%%BeginProlog
|
||||
%%BeginResource: procset xpdf 3.00 0
|
||||
%%Copyright: Copyright 1996-2011 Glyph & Cog, LLC
|
||||
/xpdf 75 dict def xpdf begin
|
||||
% PDF special state
|
||||
/pdfDictSize 15 def
|
||||
/pdfSetup {
|
||||
/setpagedevice where {
|
||||
pop 2 dict begin
|
||||
/Policies 1 dict dup begin /PageSize 6 def end def
|
||||
{ /Duplex true def } if
|
||||
currentdict end setpagedevice
|
||||
} {
|
||||
pop
|
||||
} ifelse
|
||||
} def
|
||||
/pdfSetupPaper {
|
||||
2 array astore
|
||||
/setpagedevice where {
|
||||
pop 2 dict begin
|
||||
/PageSize exch def
|
||||
/ImagingBBox null def
|
||||
currentdict end setpagedevice
|
||||
} {
|
||||
pop
|
||||
} ifelse
|
||||
} def
|
||||
/pdfStartPage {
|
||||
pdfDictSize dict begin
|
||||
/pdfFillCS [] def
|
||||
/pdfFillXform {} def
|
||||
/pdfStrokeCS [] def
|
||||
/pdfStrokeXform {} def
|
||||
/pdfFill [0] def
|
||||
/pdfStroke [0] def
|
||||
/pdfFillOP false def
|
||||
/pdfStrokeOP false def
|
||||
/pdfLastFill false def
|
||||
/pdfLastStroke false def
|
||||
/pdfTextMat [1 0 0 1 0 0] def
|
||||
/pdfFontSize 0 def
|
||||
/pdfCharSpacing 0 def
|
||||
/pdfTextRender 0 def
|
||||
/pdfPatternCS false def
|
||||
/pdfTextRise 0 def
|
||||
/pdfWordSpacing 0 def
|
||||
/pdfHorizScaling 1 def
|
||||
/pdfTextClipPath [] def
|
||||
} def
|
||||
/pdfEndPage { end } def
|
||||
% PDF color state
|
||||
/cs { /pdfFillXform exch def dup /pdfFillCS exch def
|
||||
setcolorspace } def
|
||||
/CS { /pdfStrokeXform exch def dup /pdfStrokeCS exch def
|
||||
setcolorspace } def
|
||||
/sc { pdfLastFill not { pdfFillCS setcolorspace } if
|
||||
dup /pdfFill exch def aload pop pdfFillXform setcolor
|
||||
/pdfLastFill true def /pdfLastStroke false def } def
|
||||
/SC { pdfLastStroke not { pdfStrokeCS setcolorspace } if
|
||||
dup /pdfStroke exch def aload pop pdfStrokeXform setcolor
|
||||
/pdfLastStroke true def /pdfLastFill false def } def
|
||||
/op { /pdfFillOP exch def
|
||||
pdfLastFill { pdfFillOP setoverprint } if } def
|
||||
/OP { /pdfStrokeOP exch def
|
||||
pdfLastStroke { pdfStrokeOP setoverprint } if } def
|
||||
/fCol {
|
||||
pdfLastFill not {
|
||||
pdfFillCS setcolorspace
|
||||
pdfFill aload pop pdfFillXform setcolor
|
||||
pdfFillOP setoverprint
|
||||
/pdfLastFill true def /pdfLastStroke false def
|
||||
} if
|
||||
} def
|
||||
/sCol {
|
||||
pdfLastStroke not {
|
||||
pdfStrokeCS setcolorspace
|
||||
pdfStroke aload pop pdfStrokeXform setcolor
|
||||
pdfStrokeOP setoverprint
|
||||
/pdfLastStroke true def /pdfLastFill false def
|
||||
} if
|
||||
} def
|
||||
% build a font
|
||||
/pdfMakeFont {
|
||||
4 3 roll findfont
|
||||
4 2 roll matrix scale makefont
|
||||
dup length dict begin
|
||||
{ 1 index /FID ne { def } { pop pop } ifelse } forall
|
||||
/Encoding exch def
|
||||
currentdict
|
||||
end
|
||||
definefont pop
|
||||
} def
|
||||
/pdfMakeFont16 {
|
||||
exch findfont
|
||||
dup length dict begin
|
||||
{ 1 index /FID ne { def } { pop pop } ifelse } forall
|
||||
/WMode exch def
|
||||
currentdict
|
||||
end
|
||||
definefont pop
|
||||
} def
|
||||
% graphics state operators
|
||||
/q { gsave pdfDictSize dict begin } def
|
||||
/Q {
|
||||
end grestore
|
||||
/pdfLastFill where {
|
||||
pop
|
||||
pdfLastFill {
|
||||
pdfFillOP setoverprint
|
||||
} {
|
||||
pdfStrokeOP setoverprint
|
||||
} ifelse
|
||||
} if
|
||||
} def
|
||||
/cm { concat } def
|
||||
/d { setdash } def
|
||||
/i { setflat } def
|
||||
/j { setlinejoin } def
|
||||
/J { setlinecap } def
|
||||
/M { setmiterlimit } def
|
||||
/w { setlinewidth } def
|
||||
% path segment operators
|
||||
/m { moveto } def
|
||||
/l { lineto } def
|
||||
/c { curveto } def
|
||||
/re { 4 2 roll moveto 1 index 0 rlineto 0 exch rlineto
|
||||
neg 0 rlineto closepath } def
|
||||
/h { closepath } def
|
||||
% path painting operators
|
||||
/S { sCol stroke } def
|
||||
/Sf { fCol stroke } def
|
||||
/f { fCol fill } def
|
||||
/f* { fCol eofill } def
|
||||
% clipping operators
|
||||
/W { clip newpath } def
|
||||
/W* { eoclip newpath } def
|
||||
/Ws { strokepath clip newpath } def
|
||||
% text state operators
|
||||
/Tc { /pdfCharSpacing exch def } def
|
||||
/Tf { dup /pdfFontSize exch def
|
||||
dup pdfHorizScaling mul exch matrix scale
|
||||
pdfTextMat matrix concatmatrix dup 4 0 put dup 5 0 put
|
||||
exch findfont exch makefont setfont } def
|
||||
/Tr { /pdfTextRender exch def } def
|
||||
/Tp { /pdfPatternCS exch def } def
|
||||
/Ts { /pdfTextRise exch def } def
|
||||
/Tw { /pdfWordSpacing exch def } def
|
||||
/Tz { /pdfHorizScaling exch def } def
|
||||
% text positioning operators
|
||||
/Td { pdfTextMat transform moveto } def
|
||||
/Tm { /pdfTextMat exch def } def
|
||||
% text string operators
|
||||
/xyshow where {
|
||||
pop
|
||||
/xyshow2 {
|
||||
dup length array
|
||||
0 2 2 index length 1 sub {
|
||||
2 index 1 index 2 copy get 3 1 roll 1 add get
|
||||
pdfTextMat dtransform
|
||||
4 2 roll 2 copy 6 5 roll put 1 add 3 1 roll dup 4 2 roll put
|
||||
} for
|
||||
exch pop
|
||||
xyshow
|
||||
} def
|
||||
}{
|
||||
/xyshow2 {
|
||||
currentfont /FontType get 0 eq {
|
||||
0 2 3 index length 1 sub {
|
||||
currentpoint 4 index 3 index 2 getinterval show moveto
|
||||
2 copy get 2 index 3 2 roll 1 add get
|
||||
pdfTextMat dtransform rmoveto
|
||||
} for
|
||||
} {
|
||||
0 1 3 index length 1 sub {
|
||||
currentpoint 4 index 3 index 1 getinterval show moveto
|
||||
2 copy 2 mul get 2 index 3 2 roll 2 mul 1 add get
|
||||
pdfTextMat dtransform rmoveto
|
||||
} for
|
||||
} ifelse
|
||||
pop pop
|
||||
} def
|
||||
} ifelse
|
||||
/cshow where {
|
||||
pop
|
||||
/xycp {
|
||||
0 3 2 roll
|
||||
{
|
||||
pop pop currentpoint 3 2 roll
|
||||
1 string dup 0 4 3 roll put false charpath moveto
|
||||
2 copy get 2 index 2 index 1 add get
|
||||
pdfTextMat dtransform rmoveto
|
||||
2 add
|
||||
} exch cshow
|
||||
pop pop
|
||||
} def
|
||||
}{
|
||||
/xycp {
|
||||
currentfont /FontType get 0 eq {
|
||||
0 2 3 index length 1 sub {
|
||||
currentpoint 4 index 3 index 2 getinterval false charpath moveto
|
||||
2 copy get 2 index 3 2 roll 1 add get
|
||||
pdfTextMat dtransform rmoveto
|
||||
} for
|
||||
} {
|
||||
0 1 3 index length 1 sub {
|
||||
currentpoint 4 index 3 index 1 getinterval false charpath moveto
|
||||
2 copy 2 mul get 2 index 3 2 roll 2 mul 1 add get
|
||||
pdfTextMat dtransform rmoveto
|
||||
} for
|
||||
} ifelse
|
||||
pop pop
|
||||
} def
|
||||
} ifelse
|
||||
/Tj {
|
||||
fCol
|
||||
0 pdfTextRise pdfTextMat dtransform rmoveto
|
||||
currentpoint 4 2 roll
|
||||
pdfTextRender 1 and 0 eq {
|
||||
2 copy xyshow2
|
||||
} if
|
||||
pdfTextRender 3 and dup 1 eq exch 2 eq or {
|
||||
3 index 3 index moveto
|
||||
2 copy
|
||||
currentfont /FontType get 3 eq { fCol } { sCol } ifelse
|
||||
xycp currentpoint stroke moveto
|
||||
} if
|
||||
pdfTextRender 4 and 0 ne {
|
||||
4 2 roll moveto xycp
|
||||
/pdfTextClipPath [ pdfTextClipPath aload pop
|
||||
{/moveto cvx}
|
||||
{/lineto cvx}
|
||||
{/curveto cvx}
|
||||
{/closepath cvx}
|
||||
pathforall ] def
|
||||
currentpoint newpath moveto
|
||||
} {
|
||||
pop pop pop pop
|
||||
} ifelse
|
||||
0 pdfTextRise neg pdfTextMat dtransform rmoveto
|
||||
} def
|
||||
/TJm { 0.001 mul pdfFontSize mul pdfHorizScaling mul neg 0
|
||||
pdfTextMat dtransform rmoveto } def
|
||||
/TJmV { 0.001 mul pdfFontSize mul neg 0 exch
|
||||
pdfTextMat dtransform rmoveto } def
|
||||
/Tclip { pdfTextClipPath cvx exec clip newpath
|
||||
/pdfTextClipPath [] def } def
|
||||
/Tclip* { pdfTextClipPath cvx exec eoclip newpath
|
||||
/pdfTextClipPath [] def } def
|
||||
% Level 2/3 image operators
|
||||
/pdfImBuf 100 string def
|
||||
/pdfImStr {
|
||||
2 copy exch length lt {
|
||||
2 copy get exch 1 add exch
|
||||
} {
|
||||
()
|
||||
} ifelse
|
||||
} def
|
||||
/skipEOD {
|
||||
{ currentfile pdfImBuf readline
|
||||
not { pop exit } if
|
||||
(%-EOD-) eq { exit } if } loop
|
||||
} def
|
||||
/pdfIm { image skipEOD } def
|
||||
/pdfImM { fCol imagemask skipEOD } def
|
||||
/pr { 2 index 2 index 3 2 roll putinterval 4 add } def
|
||||
/pdfImClip {
|
||||
gsave
|
||||
0 2 4 index length 1 sub {
|
||||
dup 4 index exch 2 copy
|
||||
get 5 index div put
|
||||
1 add 3 index exch 2 copy
|
||||
get 3 index div put
|
||||
} for
|
||||
pop pop rectclip
|
||||
} def
|
||||
/pdfImClipEnd { grestore } def
|
||||
% shading operators
|
||||
/colordelta {
|
||||
false 0 1 3 index length 1 sub {
|
||||
dup 4 index exch get 3 index 3 2 roll get sub abs 0.004 gt {
|
||||
pop true
|
||||
} if
|
||||
} for
|
||||
exch pop exch pop
|
||||
} def
|
||||
/funcCol { func n array astore } def
|
||||
/funcSH {
|
||||
dup 0 eq {
|
||||
true
|
||||
} {
|
||||
dup 6 eq {
|
||||
false
|
||||
} {
|
||||
4 index 4 index funcCol dup
|
||||
6 index 4 index funcCol dup
|
||||
3 1 roll colordelta 3 1 roll
|
||||
5 index 5 index funcCol dup
|
||||
3 1 roll colordelta 3 1 roll
|
||||
6 index 8 index funcCol dup
|
||||
3 1 roll colordelta 3 1 roll
|
||||
colordelta or or or
|
||||
} ifelse
|
||||
} ifelse
|
||||
{
|
||||
1 add
|
||||
4 index 3 index add 0.5 mul exch 4 index 3 index add 0.5 mul exch
|
||||
6 index 6 index 4 index 4 index 4 index funcSH
|
||||
2 index 6 index 6 index 4 index 4 index funcSH
|
||||
6 index 2 index 4 index 6 index 4 index funcSH
|
||||
5 3 roll 3 2 roll funcSH pop pop
|
||||
} {
|
||||
pop 3 index 2 index add 0.5 mul 3 index 2 index add 0.5 mul
|
||||
funcCol sc
|
||||
dup 4 index exch mat transform m
|
||||
3 index 3 index mat transform l
|
||||
1 index 3 index mat transform l
|
||||
mat transform l pop pop h f*
|
||||
} ifelse
|
||||
} def
|
||||
/axialCol {
|
||||
dup 0 lt {
|
||||
pop t0
|
||||
} {
|
||||
dup 1 gt {
|
||||
pop t1
|
||||
} {
|
||||
dt mul t0 add
|
||||
} ifelse
|
||||
} ifelse
|
||||
func n array astore
|
||||
} def
|
||||
/axialSH {
|
||||
dup 0 eq {
|
||||
true
|
||||
} {
|
||||
dup 8 eq {
|
||||
false
|
||||
} {
|
||||
2 index axialCol 2 index axialCol colordelta
|
||||
} ifelse
|
||||
} ifelse
|
||||
{
|
||||
1 add 3 1 roll 2 copy add 0.5 mul
|
||||
dup 4 3 roll exch 4 index axialSH
|
||||
exch 3 2 roll axialSH
|
||||
} {
|
||||
pop 2 copy add 0.5 mul
|
||||
axialCol sc
|
||||
exch dup dx mul x0 add exch dy mul y0 add
|
||||
3 2 roll dup dx mul x0 add exch dy mul y0 add
|
||||
dx abs dy abs ge {
|
||||
2 copy yMin sub dy mul dx div add yMin m
|
||||
yMax sub dy mul dx div add yMax l
|
||||
2 copy yMax sub dy mul dx div add yMax l
|
||||
yMin sub dy mul dx div add yMin l
|
||||
h f*
|
||||
} {
|
||||
exch 2 copy xMin sub dx mul dy div add xMin exch m
|
||||
xMax sub dx mul dy div add xMax exch l
|
||||
exch 2 copy xMax sub dx mul dy div add xMax exch l
|
||||
xMin sub dx mul dy div add xMin exch l
|
||||
h f*
|
||||
} ifelse
|
||||
} ifelse
|
||||
} def
|
||||
/radialCol {
|
||||
dup t0 lt {
|
||||
pop t0
|
||||
} {
|
||||
dup t1 gt {
|
||||
pop t1
|
||||
} if
|
||||
} ifelse
|
||||
func n array astore
|
||||
} def
|
||||
/radialSH {
|
||||
dup 0 eq {
|
||||
true
|
||||
} {
|
||||
dup 8 eq {
|
||||
false
|
||||
} {
|
||||
2 index dt mul t0 add radialCol
|
||||
2 index dt mul t0 add radialCol colordelta
|
||||
} ifelse
|
||||
} ifelse
|
||||
{
|
||||
1 add 3 1 roll 2 copy add 0.5 mul
|
||||
dup 4 3 roll exch 4 index radialSH
|
||||
exch 3 2 roll radialSH
|
||||
} {
|
||||
pop 2 copy add 0.5 mul dt mul t0 add
|
||||
radialCol sc
|
||||
encl {
|
||||
exch dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add
|
||||
0 360 arc h
|
||||
dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add
|
||||
360 0 arcn h f
|
||||
} {
|
||||
2 copy
|
||||
dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add
|
||||
a1 a2 arcn
|
||||
dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add
|
||||
a2 a1 arcn h
|
||||
dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add
|
||||
a1 a2 arc
|
||||
dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add
|
||||
a2 a1 arc h f
|
||||
} ifelse
|
||||
} ifelse
|
||||
} def
|
||||
end
|
||||
%%EndResource
|
||||
%%EndProlog
|
||||
%%BeginSetup
|
||||
xpdf begin
|
||||
%%EndSetup
|
||||
pdfStartPage
|
||||
[] 0 d
|
||||
1 i
|
||||
0 j
|
||||
0 J
|
||||
10 M
|
||||
1 w
|
||||
/DeviceGray {} cs
|
||||
[0] sc
|
||||
/DeviceGray {} CS
|
||||
[0] SC
|
||||
false op
|
||||
false OP
|
||||
{} settransfer
|
||||
0 0 32 32 re
|
||||
W
|
||||
q
|
||||
/DeviceRGB {} cs
|
||||
[0 0 0] sc
|
||||
/DeviceRGB {} CS
|
||||
[0 0 0] SC
|
||||
[1 0 0 -1 0 32] cm
|
||||
q
|
||||
q
|
||||
Q
|
||||
Q
|
||||
q
|
||||
q
|
||||
q
|
||||
[1 0 0 1 0 0] cm
|
||||
[32 0 0 -32 0 32] cm
|
||||
/DeviceRGB setcolorspace
|
||||
<<
|
||||
/ImageType 1
|
||||
/Width 32
|
||||
/Height 32
|
||||
/ImageMatrix [32 0 0 -32 0 32]
|
||||
/BitsPerComponent 8
|
||||
/Decode [0 1 0 1 0 1]
|
||||
/DataSource currentfile
|
||||
/ASCII85Decode filter
|
||||
<< >> /DCTDecode filter
|
||||
>>
|
||||
pdfIm
|
||||
s4IA0!"_al8O`[\!<E0k!([(is4[N@!!30%!W`<'!WiE)!WiE*"Tni/!s8`1"9Sf4
|
||||
"pYA<"pYA=#n%%F#RUhB#7:nI$4@7N$k*@I%M'!W%LW[R%0,&^6NI5i!WrN,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