pike.git
/
src
/
modules
/
Image
/
testsuite.in
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/modules/Image/testsuite.in:1:
-
dnl $Id: testsuite.in,v 1.
14
2002/12/12
16
:
40
:
41
nilsson Exp $
+
dnl $Id: testsuite.in,v 1.
15
2002/12/12
21
:
18
:
46
nilsson Exp $
test_eq([[ Image.PNM.decode("P1\n5 5\n0 1 1 1 1\n1 0 1 1 1\n" "1 1 0 1 1\n1 1 1 0 1\n1 1 1 1 0") ]], Image.PNM.decode("P4\n5 5\nx¸Øèð") ) test_eq([[ Image.GIF.decode(MIME.decode_base64( "R0lGODlhBQAFAIAAAAAAAP///ywAAAAABQAFAAACCAxwEWrY8BwoADs=")) ]], Image.PNM.decode("P4\n5 5\nx\00èØèð") ) test_true( objectp(Image.Image()) )
pike.git/src/modules/Image/testsuite.in:407:
cond( master()->resolv("Image.$1")->encode,[[ test_any([[ object img=Image.Image(100,100)->test(40); $2 object img1=Image.$1.decode(Image.$1.encode(img$3)); return img==img1; ]],1) ]]) ]])
-
test_encoding(PNM,,)
-
test_encoding(GIF,[[
-
img = Image.Colortable(img,250)->cubicles(10,10,10,1)->
-
floyd_steinberg()*img;
-
]],)
-
test_encoding(GIF,[[
-
object c=Image.Colortable(img,256)->cubicles(16,16,16,1);
-
img=c*img;
-
]],[[,c]])
-
-
test_any([[
-
object img=Image.Image(100,100)->test(43);
-
object c=Image.Colortable(img,256)->floyd_steinberg()->cubicles(16,16,16);
-
img=c*img;
-
object img1=Image.GIF.decode(Image.GIF.encode(img,c));
-
return img-img1<50;
-
]],1)
-
+
test_encoding(AVS,,) test_encoding(BMP,,) test_encoding(BMP,[[ img=Image.Colortable(img,256)*img; ]],[[,(["bpp":8])]]) test_encoding(BMP,[[ img=Image.Colortable(img,16)*img; ]],[[,(["bpp":4])]]) test_encoding(BMP,[[ img=Image.Colortable(img,2)->floyd_steinberg()*img;
pike.git/src/modules/Image/testsuite.in:461:
img=img->scale(400,100); object c=Image.Colortable(img,256); img=c*img; ]],[[,(["bpp":8,"rle":1])]]) test_encoding(BMP,[[ img=img->scale(400,100); object c=Image.Colortable(img,16); img=c*img; ]],[[,(["bpp":4,"rle":1])]])
+
test_encoding(GIF,[[
+
img = Image.Colortable(img,250)->cubicles(10,10,10,1)->
+
floyd_steinberg()*img;
+
]],)
+
test_encoding(GIF,[[
+
object c=Image.Colortable(img,256)->cubicles(16,16,16,1);
+
img=c*img;
+
]],[[,c]])
+
test_any([[
-
+
object img=Image.Image(100,100)->test(43);
+
object c=Image.Colortable(img,256)->floyd_steinberg()->cubicles(16,16,16);
+
img=c*img;
+
object img1=Image.GIF.decode(Image.GIF.encode(img,c));
+
return img-img1<50;
+
]],1)
+
+
test_any([[
object img=Image.Image(256,240)->test(43); img=Image.Colortable( ({"white","black","red","green"}) )*img; return Image.HRZ.decode(Image.HRZ.encode(img))==img; ]],1) test_encoding(ILBM,[[ img=Image.Colortable(img,16)*img; ]],)
-
+
+
cond( master()->resolv("Image.JPEG")->encode,[[
+
test_any([[
+
object img=Image.Image(100,100)->test(43);
+
object img1=Image.JPEG.decode(Image.JPEG.encode(img,(["quality":100])));
+
return img-img1<10;
+
]],1)
+
]])
+
test_encoding(PCX,,)
-
+
test_encoding(PNG,,)
test_encoding(PNM,,)
-
+
dnl test_encoding(PVR,,)
+
test_encoding(RAS,,)
test_encoding(TGA,,)
-
+
dnl test_encoding(WBF,[[
+
dnl object c=Image.Colortable(({Image.Color.white,Image.Color.black}));
+
dnl img=c*img;
+
dnl ]],)
+
dnl test_encoding(WBMP,[[
+
dnl object c=Image.Colortable(({Image.Color.white,Image.Color.black}));
+
dnl img=c*img;
+
dnl ]],)
test_encoding(XBM,[[ object c=Image.Colortable(({Image.Color.white,Image.Color.black})); img=c*img; ]],)
-
test_encoding(XPM,[[
-
object c=Image.Colortable(16,16,16);
-
img=c*img;
-
]],[[,(["colortable":c]) ]])
-
test_encoding(TIFF,,)
+
cond( master()->resolv("Image.XFace")->encode,[[ test_any([[ object img=Image.Image(48,48)->test(43); object c=Image.Colortable(({Image.Color.white,Image.Color.black})); c->floyd_steinberg(); img=c*img; return Image.XFace.decode(Image.XFace.encode(img))==img; ]],1) ]])
-
cond( master()->resolv("Image.JPEG")->encode,[[
-
test_
any
([[
-
object
img
=Image.
Image
(
100
,
100
)
->test(43)
;
-
object img1
=
Image.JPEG.decode(Image.JPEG.encode(
img,(["
quality
":
100
])
));
-
return img-img1<10;
-
]]
,1
)
-
]]
)
+
test_
encoding
(
XPM,
[[
+
object
c
=Image.
Colortable
(
16
,
16,16
);
+
img
=
c*
img
;
+
]]
,
[[,
(["
colortable
":
c
]) ]])
+
test_encoding(TIFF,,
)