Skip to content

Commit 4ab2b45

Browse files
authored
Create README.md
1 parent 4018c46 commit 4ab2b45

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# ResizeImageJava
2+
이미지 리사이징 기능 구현체
3+
from: https://stackoverflow.com/a/36367652
4+
5+
## dependencies
6+
put this in project's "libs" folder as described in fileTree
7+
```
8+
repositories {
9+
mavenCentral()
10+
}
11+
12+
dependencies {
13+
implementation 'com.mortennobel:java-image-scaling:0.8.6'
14+
implementation 'net.coobird:thumbnailator:0.4.8'
15+
implementation fileTree(dir: 'libs', include: ['*.jar'])
16+
}
17+
```
18+
19+
## Usage
20+
```Java
21+
// listOfFiles : File[] or String[]
22+
// targetWidth/targetHeight : int, pixel
23+
// doStretch : boolean for ignoring aspect ratio
24+
ResizeProcessor.resizeImagesWithThese(listOfFiles, targetWidth, targetHeight, doStretch);
25+
```
26+
27+
```Java
28+
// file : File
29+
// targetWidth/targetHeight : int, pixel
30+
// doStretch : boolean for ignoring aspect ratio
31+
ResizeProcessor.resizeImageForThis(file, targetWidth, targetHeight, doStretch);
32+
```
33+
34+
## Change Algorithm
35+
set into
36+
```Java
37+
ResizeProcessor.resizerAlgorithm = ResizeProcessor.RESIZER_LANCOZ;
38+
```
39+
pick from these
40+
```Java
41+
public static final int RESIZER_JDK_PROGRESSIVE = 1;
42+
public static final int RESIZER_JDK_DIRECT = 2;
43+
public static final int RESIZER_LANCOZ = 3;
44+
public static final int RESIZER_THUMBNAILATOR = 4;
45+
```

0 commit comments

Comments
 (0)