From 77de1924e8b5a7220c43d14d72737abfb73f0b45 Mon Sep 17 00:00:00 2001 From: xiesubin Date: Wed, 23 Jan 2019 11:41:12 +0800 Subject: [PATCH] fix --- README.md | 2 +- app/build.gradle | 2 +- compressor/build.gradle | 4 ++-- compressor/src/main/java/id/zelory/compressor/ImageUtil.java | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index eafbc38..bfdcb47 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Compressor is a lightweight and powerful android image compression library. Comp # Gradle ```groovy dependencies { - implementation 'id.zelory:compressor:2.1.1' + implementation 'id.zelory:compressor:2.1.2' } ``` # Let's compress the image size! diff --git a/app/build.gradle b/app/build.gradle index 8fd2ddf..698412d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -23,7 +23,7 @@ dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:25.3.1' - compile 'id.zelory:compressor:2.1.1' + compile 'id.zelory:compressor:2.1.2' //compile project(':compressor') compile 'io.reactivex.rxjava2:rxandroid:2.0.1' } diff --git a/compressor/build.gradle b/compressor/build.gradle index 8023b0c..9688d41 100644 --- a/compressor/build.gradle +++ b/compressor/build.gradle @@ -26,7 +26,7 @@ ext { siteUrl = 'https://github.com/zetbaitsu/Compressor' gitUrl = 'https://github.com/zetbaitsu/Compressor.git' - libraryVersion = '2.1.1' + libraryVersion = '2.1.2' developerId = 'zetbaitsu' developerName = 'Zetra' @@ -45,7 +45,7 @@ android { minSdkVersion 9 targetSdkVersion 25 versionCode 5 - versionName "2.1.1" + versionName "2.1.2" } buildTypes { release { diff --git a/compressor/src/main/java/id/zelory/compressor/ImageUtil.java b/compressor/src/main/java/id/zelory/compressor/ImageUtil.java index 8dd68da..d1b9405 100644 --- a/compressor/src/main/java/id/zelory/compressor/ImageUtil.java +++ b/compressor/src/main/java/id/zelory/compressor/ImageUtil.java @@ -77,7 +77,7 @@ private static int calculateInSampleSize(BitmapFactory.Options options, int reqW final int width = options.outWidth; int inSampleSize = 1; - if (height > reqHeight || width > reqWidth) { + if (height > reqHeight && width > reqWidth) { inSampleSize *= 2; final int halfHeight = height / 2; final int halfWidth = width / 2;