File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 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+ ```
You can’t perform that action at this time.
0 commit comments