Skip to content

Commit 65f7063

Browse files
xiesubinxiesubin
authored andcommitted
fix bug happens on reqWidth is between 1/2 * width and width
1 parent 31d924e commit 65f7063

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Compressor is a lightweight and powerful android image compression library. Comp
77
# Gradle
88
```groovy
99
dependencies {
10-
implementation 'id.zelory:compressor:2.1.0'
10+
implementation 'id.zelory:compressor:2.1.1'
1111
}
1212
```
1313
# Let's compress the image size!

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ dependencies {
2323
compile fileTree(include: ['*.jar'], dir: 'libs')
2424
testCompile 'junit:junit:4.12'
2525
compile 'com.android.support:appcompat-v7:25.3.1'
26-
compile 'id.zelory:compressor:2.1.0'
26+
compile 'id.zelory:compressor:2.1.1'
2727
//compile project(':compressor')
2828
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
2929
}

compressor/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ ext {
2626
siteUrl = 'https://github.com/zetbaitsu/Compressor'
2727
gitUrl = 'https://github.com/zetbaitsu/Compressor.git'
2828

29-
libraryVersion = '2.1.0'
29+
libraryVersion = '2.1.1'
3030

3131
developerId = 'zetbaitsu'
3232
developerName = 'Zetra'
@@ -45,7 +45,7 @@ android {
4545
minSdkVersion 9
4646
targetSdkVersion 25
4747
versionCode 5
48-
versionName "2.1.0"
48+
versionName "2.1.1"
4949
}
5050
buildTypes {
5151
release {

compressor/src/main/java/id/zelory/compressor/ImageUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ private static int calculateInSampleSize(BitmapFactory.Options options, int reqW
7878
int inSampleSize = 1;
7979

8080
if (height > reqHeight || width > reqWidth) {
81-
81+
inSampleSize *= 2;
8282
final int halfHeight = height / 2;
8383
final int halfWidth = width / 2;
8484

0 commit comments

Comments
 (0)