@@ -74,6 +74,26 @@ test('image/resize,w_50/crop,w_100,h_100/rounded-corners,r_100/format,png', asyn
74
74
expect ( info . channels ) . toBe ( 4 ) ;
75
75
} ) ;
76
76
77
+ test ( 'example.jpg?x-oss-process=image/resize,w_50/threshold,10' , async ( ) => {
78
+ const ctx = await ImageProcessor . getInstance ( ) . newContext ( 'example.jpg' , 'image/resize,w_50/threshold,10' . split ( '/' ) , fixtureStore ) ;
79
+ await ImageProcessor . getInstance ( ) . process ( ctx ) ;
80
+ const { info } = await ctx . image . toBuffer ( { resolveWithObject : true } ) ;
81
+
82
+ expect ( info . width ) . toBe ( 50 ) ;
83
+ expect ( info . height ) . toBe ( 33 ) ;
84
+ expect ( info . channels ) . toBe ( 3 ) ;
85
+ } ) ;
86
+
87
+ test ( 'example.jpg?x-oss-process=image/resize,w_50/threshold,23000' , async ( ) => {
88
+ const ctx = await ImageProcessor . getInstance ( ) . newContext ( 'example.jpg' , 'image/resize,w_50/threshold,23000' . split ( '/' ) , fixtureStore ) ;
89
+ await ImageProcessor . getInstance ( ) . process ( ctx ) ;
90
+ const { info } = await ctx . image . toBuffer ( { resolveWithObject : true } ) ;
91
+
92
+ expect ( info . width ) . toBe ( 400 ) ;
93
+ expect ( info . height ) . toBe ( 267 ) ;
94
+ expect ( info . channels ) . toBe ( 3 ) ;
95
+ } ) ;
96
+
77
97
test ( 'image/resize,w_20/indexcrop,x_50,i_0/' , async ( ) => {
78
98
const ctx = await ImageProcessor . getInstance ( ) . newContext ( 'example.jpg' , 'image/resize,w_20/indexcrop,x_50,i_0/' . split ( '/' ) , fixtureStore ) ;
79
99
await ImageProcessor . getInstance ( ) . process ( ctx ) ;
0 commit comments