tzh
2024-08-22 c7d0944258c7d0943aa7b2211498fd612971ce27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
P\¬Qc    @sdZddlmZmZmZmZeddeƒZddlZddl    Z    ddl
Z
dZ ddddddd d"fZ e d „ee ƒDƒƒd#e ZddZd$Zde
jfd„ƒYZd„Zd„Zd„ZedkreƒndS(%s„Test script for the imageop module.  This has the side
   effect of partially testing the imgfile module as well.
   Roger E. Masse
iÿÿÿÿ(tverbosetunlinkt import_modulet run_unittesttimageopt
deprecatedNiiiii
iiccs|] }| VqdS(N((t.0tx((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_imageop.pys    <genexpr>sitAiitInputValidationTestscBs/eZdd„Zd„Zd„Zd„ZRS(c
GsÔtt|ƒ}x¾tD]¶}x­tD]¥}t||ƒ}|rL||9}n|tkred|}nt}|rŠ||||f|}    n|||f|}    y||    ŒWq#ttjfk
rÇq#Xq#WqWdS(NR(tgetattrRtVALUEStabstMAX_LENtAAAAAt
ValueErrorterror(
tselftnametsizetextratfunctheighttwidthtstrlentdatat    arguments((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_imageop.pyt_checks      cGs(x!tD]}|j|||ŒqWdS(N(tSIZESR(RRRR((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_imageop.pyt
check_size+s cGs|j|d|ŒdS(N(RtNone(RRR((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_imageop.pytcheck/scCsè|jdddddƒ|jdddƒ|jdddƒ|jdƒ|jddƒ|jd    ƒ|jd
ƒ|jd ƒ|jd ƒ|jd ddƒ|jdƒ|jdƒ|jdƒ|jdƒ|jdƒdS(Ntcropitscaleiiÿÿÿÿttovideot    grey2monoi€t
grey2grey4t
grey2grey2t dither2monot dither2grey2t    mono2greyt
grey22greytrgb2rgb8trgb82rgbtrgb2greytgrey2rgb(RR(R((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_imageop.pyttest_input_validation2s         N(t__name__t
__module__RRRRR.(((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_imageop.pyR    s         c    CsÅttƒyddl}Wntk
r.dSXtjtdtjdƒdtjdƒt    dtjdƒ\}}}t
r‰dGHnt j |d||ddd    d    ƒ}t
r»d
GHnt j |d||d    d    ƒ}t
rçd GHnt j|d||ƒ}t
r d GHnt j|||ƒ}t
r0d GHnt j|||ƒ}t
rSdGHnt j|||ƒ}t
rvdGHnt j|||ƒ}t
r™dGHnt j|||dƒ}t
r¿dGHnt j|||ddƒ}t
rèdGHnt j|||ƒ}t
r dGHnt j|||ƒ}    t
r.dGHnt j|||ƒ}
t
rQdGHnt j|||ƒ}
t
rtdGHnt j|    ||ƒ}t
r—dGHnt j|
||ƒ}tdtjdƒdS(NiÿÿÿÿttestrgbtuuettesttrgbR iiiR!R"R*R+R,R-R#R(iÿR&R$R%R't
grey42greyR)(RR    timgfilet ImportErrortuutdecodetget_qualified_pathtostextseptgetimageRRR R!R"R*R+R,R-R#R(R&R$R%R'R5R)R( R6timageRRtnewimaget
scaleimaget
videoimaget    greyimaget    monoimaget
grey4imaget
grey2image((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_imageop.pyt    test_mainDsj
 , $cCs“ddl}y|j|ƒ}Wn/|jk
rPt|ƒ}|j|ƒ}nXtrod|t|ƒfGHn|j|ƒ}||d|dfS(sUreturn a tuple consisting of
       image (in 'imgfile' format) width and height
    iÿÿÿÿNs)imgfile opening test image: %s, sizes: %sii(R6tgetsizesRR:Rtstrtread(RR6tsizesR>((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_imageop.pyR=³s  cCs’ddl}ddl}|j}y|jjtƒg|}Wntk
rQnXx9|D]1}|jj||ƒ}|jj|ƒrY|SqYW|S(s% return a more qualified path to nameiÿÿÿÿN(tsysR;tpathtdirnamet__file__t    NameErrortjointexists(RRKR;RLtdirtfullname((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_imageop.pyR:Ãs        t__main__(iiiiii€iÿi€i€i€I€iþÿÿI€iÿÿÿ(ii(t__doc__ttest.test_supportRRRRtTrueRR8R;tunittestRt_VALUESttupletreversedR RR tTestCaseR    RFR=R:R/(((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_imageop.pyt<module>s"$$
/    o