28
28
import com .bumptech .glide .load .engine .bitmap_recycle .BitmapPool ;
29
29
import com .bumptech .glide .load .engine .bitmap_recycle .BitmapPoolAdapter ;
30
30
import com .bumptech .glide .load .engine .bitmap_recycle .LruArrayPool ;
31
+ import com .bumptech .glide .request .target .Target ;
31
32
import com .bumptech .glide .util .Preconditions ;
32
33
import java .io .BufferedInputStream ;
33
34
import java .io .BufferedOutputStream ;
@@ -121,6 +122,9 @@ public void calculateScaling_withAtMost() throws IOException {
121
122
.givenSquareImageWithDimensionOf (200 , onAllApisAndAllFormatsExpect (200 , 200 ))
122
123
.givenSquareImageWithDimensionOf (450 , onAllApisAndAllFormatsExpect (450 , 450 ))
123
124
.givenImageWithDimensionsOf (200 , 450 , onAllApisAndAllFormatsExpect (200 , 450 ))
125
+ // Original scaling
126
+ .setTargetDimensions (Target .SIZE_ORIGINAL , Target .SIZE_ORIGINAL )
127
+ .givenImageWithDimensionsOf (1821 , 2634 , onAllApisAndAllFormatsExpect (1821 , 2634 ))
124
128
.run ();
125
129
}
126
130
@@ -144,6 +148,9 @@ public void calculateScaling_withAtLeast() throws IOException {
144
148
.givenSquareImageWithDimensionOf (200 , onAllApisAndAllFormatsExpect (200 , 200 ))
145
149
.givenSquareImageWithDimensionOf (450 , onAllApisAndAllFormatsExpect (450 , 450 ))
146
150
.givenImageWithDimensionsOf (200 , 450 , onAllApisAndAllFormatsExpect (200 , 450 ))
151
+ // Original scaling
152
+ .setTargetDimensions (Target .SIZE_ORIGINAL , Target .SIZE_ORIGINAL )
153
+ .givenImageWithDimensionsOf (1821 , 2634 , onAllApisAndAllFormatsExpect (1821 , 2634 ))
147
154
.run ();
148
155
}
149
156
@@ -207,6 +214,9 @@ public void calculateScaling_withCenterInside() throws IOException {
207
214
.givenSquareImageWithDimensionOf (200 , onAllApisAndAllFormatsExpect (200 , 200 ))
208
215
.givenSquareImageWithDimensionOf (450 , onAllApisAndAllFormatsExpect (450 , 450 ))
209
216
.givenImageWithDimensionsOf (200 , 450 , onAllApisAndAllFormatsExpect (200 , 450 ))
217
+ // Original scaling
218
+ .setTargetDimensions (Target .SIZE_ORIGINAL , Target .SIZE_ORIGINAL )
219
+ .givenImageWithDimensionsOf (1821 , 2634 , onAllApisAndAllFormatsExpect (1821 , 2634 ))
210
220
.run ();
211
221
}
212
222
@@ -253,6 +263,9 @@ public void calculateScaling_withCenterOutside() throws IOException {
253
263
450 ,
254
264
atAndAbove (KITKAT ).with (allFormats ().expect (500 , 1125 )),
255
265
below (KITKAT ).with (allFormats ().expect (200 , 450 )))
266
+ // Original scaling
267
+ .setTargetDimensions (Target .SIZE_ORIGINAL , Target .SIZE_ORIGINAL )
268
+ .givenImageWithDimensionsOf (1821 , 2634 , onAllApisAndAllFormatsExpect (1821 , 2634 ))
256
269
.run ();
257
270
}
258
271
@@ -276,6 +289,9 @@ public void calculateScaling_withNone() throws IOException {
276
289
.givenSquareImageWithDimensionOf (200 , onAllApisAndAllFormatsExpect (200 , 200 ))
277
290
.givenSquareImageWithDimensionOf (450 , onAllApisAndAllFormatsExpect (450 , 450 ))
278
291
.givenImageWithDimensionsOf (200 , 450 , onAllApisAndAllFormatsExpect (200 , 450 ))
292
+ // Original scaling
293
+ .setTargetDimensions (Target .SIZE_ORIGINAL , Target .SIZE_ORIGINAL )
294
+ .givenImageWithDimensionsOf (1821 , 2634 , onAllApisAndAllFormatsExpect (1821 , 2634 ))
279
295
.run ();
280
296
}
281
297
@@ -386,6 +402,9 @@ public void calculateScaling_withFitCenter() throws IOException {
386
402
450 ,
387
403
atAndAbove (KITKAT ).with (allFormats ().expect (222 , 500 )),
388
404
below (KITKAT ).with (allFormats ().expect (200 , 450 )))
405
+ // Original scaling
406
+ .setTargetDimensions (Target .SIZE_ORIGINAL , Target .SIZE_ORIGINAL )
407
+ .givenImageWithDimensionsOf (1821 , 2634 , onAllApisAndAllFormatsExpect (1821 , 2634 ))
389
408
.run ();
390
409
}
391
410
0 commit comments